mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-01 18:13:48 +00:00
fix(Core/Pet): Implement sound playback when dismissing warlock's pet. (#23240)
This commit is contained in:
@@ -76,10 +76,10 @@ enum ActionFeedback
|
||||
FEEDBACK_CANT_ATT_TARGET = 3
|
||||
};
|
||||
|
||||
enum PetTalk
|
||||
enum PetAction : int32
|
||||
{
|
||||
PET_TALK_SPECIAL_SPELL = 0,
|
||||
PET_TALK_ATTACK = 1
|
||||
PET_ACTION_SPECIAL_SPELL = 0,
|
||||
PET_ACTION_ATTACK = 1
|
||||
};
|
||||
|
||||
enum PetLoadState
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
#include "PassiveAI.h"
|
||||
#include "Pet.h"
|
||||
#include "PetAI.h"
|
||||
#include "PetPackets.h"
|
||||
#include "Player.h"
|
||||
#include "ReputationMgr.h"
|
||||
#include "ScriptMgr.h"
|
||||
@@ -16672,7 +16673,7 @@ Player* Unit::GetSpellModOwner() const
|
||||
}
|
||||
|
||||
///----------Pet responses methods-----------------
|
||||
void Unit::SendPetActionFeedback(uint8 msg)
|
||||
void Unit::SendPetActionFeedback(uint8 msg) const
|
||||
{
|
||||
Unit* owner = GetOwner();
|
||||
if (!owner || !owner->IsPlayer())
|
||||
@@ -16683,19 +16684,18 @@ void Unit::SendPetActionFeedback(uint8 msg)
|
||||
owner->ToPlayer()->GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
void Unit::SendPetTalk(uint32 pettalk)
|
||||
void Unit::SendPetActionSound(PetAction action) const
|
||||
{
|
||||
Unit* owner = GetOwner();
|
||||
if (!owner || !owner->IsPlayer())
|
||||
return;
|
||||
|
||||
WorldPacket data(SMSG_PET_ACTION_SOUND, 8 + 4);
|
||||
data << GetGUID();
|
||||
data << uint32(pettalk);
|
||||
owner->ToPlayer()->GetSession()->SendPacket(&data);
|
||||
SendMessageToSet(WorldPackets::Pet::PetActionSound(GetGUID(), static_cast<int32>(action)).Write(), false);
|
||||
}
|
||||
|
||||
void Unit::SendPetAIReaction(ObjectGuid guid)
|
||||
void Unit::SendPetDismissSound() const
|
||||
{
|
||||
if (CreatureDisplayInfoEntry const* displayInfo = sCreatureDisplayInfoStore.LookupEntry(GetNativeDisplayId()))
|
||||
SendMessageToSet(WorldPackets::Pet::PetDismissSound(static_cast<int32>(displayInfo->ModelId), GetPosition()).Write(), false);
|
||||
}
|
||||
|
||||
void Unit::SendPetAIReaction(ObjectGuid guid) const
|
||||
{
|
||||
Unit* owner = GetOwner();
|
||||
if (!owner || !owner->IsPlayer())
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "ItemTemplate.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "Object.h"
|
||||
#include "PetDefines.h"
|
||||
#include "SharedDefines.h"
|
||||
#include "SpellAuraDefines.h"
|
||||
#include "SpellDefines.h"
|
||||
@@ -1962,9 +1963,10 @@ public:
|
||||
void SendPlaySpellVisual(uint32 id);
|
||||
void SendPlaySpellImpact(ObjectGuid guid, uint32 id);
|
||||
|
||||
void SendPetActionFeedback (uint8 msg);
|
||||
void SendPetTalk (uint32 pettalk);
|
||||
void SendPetAIReaction(ObjectGuid guid);
|
||||
void SendPetActionFeedback(uint8 msg) const;
|
||||
void SendPetActionSound(PetAction action) const;
|
||||
void SendPetDismissSound() const;
|
||||
void SendPetAIReaction(ObjectGuid guid) const;
|
||||
|
||||
void SendPeriodicAuraLog(SpellPeriodicAuraLogInfo* pInfo);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user