Core/PacketIO: implement and enable SMSG_PLAY_SPELL_VISUAL

This commit is contained in:
Ovahlord committed 2021-03-12 21:56:15 +01:00
1 parent b3cc23a6d4
commit c1cb11c19f
5 files changed
+91 -1

No files matched your search

+22
View File
@@ -12310,6 +12310,28 @@ void Unit::SendPlaySpellVisualKit(uint32 id, uint32 type, uint32 duration) const
SendMessageToSet(packet.Write(), IsPlayer());
}
void Unit::SendPlaySpellVisual(uint32 spellVisualId, Unit const* target /*= nullptr*/, Optional<Position> targetPosition /*= {}*/, float travelSpeed /*= 0.f*/, uint16 missReason /*= 0*/, uint16 reflectStatus /*= 0*/, bool speedAsTime /*= false*/) const
{
if (!sSpellVisualStore.LookupEntry(spellVisualId))
return;
WorldPackets::Spells::PlaySpellVisual packet;
packet.SpellVisualID = spellVisualId;
packet.Source = GetGUID();
if (target)
packet.Target = target->GetGUID();
if (targetPosition)
packet.TargetPosition = *targetPosition;
packet.TravelSpeed = travelSpeed;
packet.MissReason = missReason;
packet.ReflectStatus = reflectStatus;
packet.SpeedAsTime = speedAsTime;
SendMessageToSet(packet.Write(), true);
}
void Unit::CancelSpellMissiles(uint32 spellId, bool reverseMissile /*= false*/)
{
bool hasMissile = false;