mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-24 14:16:31 +00:00
fix(Core/Pet): Implement sound playback when dismissing warlock's pet. (#23240)
This commit is contained in:
@@ -50,3 +50,19 @@ WorldPacket const* WorldPackets::Pet::PetUnlearnedSpell::Write()
|
||||
_worldPacket << uint32(SpellID);
|
||||
return &_worldPacket;
|
||||
}
|
||||
|
||||
WorldPacket const* WorldPackets::Pet::PetActionSound::Write()
|
||||
{
|
||||
_worldPacket << UnitGUID;
|
||||
_worldPacket << int32(Action);
|
||||
return &_worldPacket;
|
||||
}
|
||||
|
||||
WorldPacket const* WorldPackets::Pet::PetDismissSound::Write()
|
||||
{
|
||||
_worldPacket << int32(ModelId);
|
||||
_worldPacket << float(ModelPosition.x);
|
||||
_worldPacket << float(ModelPosition.y);
|
||||
_worldPacket << float(ModelPosition.z);
|
||||
return &_worldPacket;
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "ObjectGuid.h"
|
||||
#include "Packet.h"
|
||||
#include "G3D/Vector3.h"
|
||||
|
||||
namespace WorldPackets
|
||||
{
|
||||
@@ -94,6 +95,30 @@ namespace WorldPackets
|
||||
|
||||
void Read() override { }
|
||||
};
|
||||
|
||||
class PetActionSound final : public ServerPacket
|
||||
{
|
||||
public:
|
||||
PetActionSound(ObjectGuid unitGUID, int32 action)
|
||||
: ServerPacket(SMSG_PET_ACTION_SOUND, 8 + 4), UnitGUID(unitGUID), Action(action) { }
|
||||
|
||||
WorldPacket const* Write() override;
|
||||
|
||||
ObjectGuid UnitGUID;
|
||||
int32 Action = 0;
|
||||
};
|
||||
|
||||
class PetDismissSound final : public ServerPacket
|
||||
{
|
||||
public:
|
||||
PetDismissSound(int32 modelId, G3D::Vector3 modelPosition)
|
||||
: ServerPacket(SMSG_PET_DISMISS_SOUND, 4 + 12), ModelId(modelId), ModelPosition(modelPosition) { }
|
||||
|
||||
WorldPacket const* Write() override;
|
||||
|
||||
int32 ModelId = 0;
|
||||
G3D::Vector3 ModelPosition;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user