mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Units: Added helper function to clear boss emote frame and enable SMSG_CLEAR_BOSS_EMOTES
This commit is contained in:
@@ -13581,6 +13581,22 @@ void Unit::Whisper(uint32 textId, Player* target, bool isBossWhisper /*= false*/
|
||||
target->SendDirectMessage(packet.Write());
|
||||
}
|
||||
|
||||
void Unit::ClearBossEmotes(Optional<uint32> zoneId, Player const* target) const
|
||||
{
|
||||
WorldPackets::Chat::ClearBossEmotes clearBossEmotes;
|
||||
clearBossEmotes.Write();
|
||||
|
||||
if (target)
|
||||
{
|
||||
target->SendDirectMessage(clearBossEmotes.GetRawPacket());
|
||||
return;
|
||||
}
|
||||
|
||||
for (MapReference const& ref : GetMap()->GetPlayers())
|
||||
if (!zoneId || DB2Manager::IsInArea(ref.GetSource()->GetAreaId(), *zoneId))
|
||||
ref.GetSource()->SendDirectMessage(clearBossEmotes.GetRawPacket());
|
||||
}
|
||||
|
||||
SpellInfo const* Unit::GetCastSpellInfo(SpellInfo const* spellInfo, TriggerCastFlags& triggerFlag) const
|
||||
{
|
||||
auto findMatchingAuraEffectIn = [this, spellInfo, &triggerFlag](AuraType type) -> SpellInfo const*
|
||||
|
||||
@@ -1767,6 +1767,13 @@ class TC_GAME_API Unit : public WorldObject
|
||||
virtual void TextEmote(uint32 textId, WorldObject const* target = nullptr, bool isBossEmote = false);
|
||||
virtual void Whisper(uint32 textId, Player* target, bool isBossWhisper = false);
|
||||
|
||||
/**
|
||||
@brief Clears boss emotes frame
|
||||
@param zoneId Only clears emotes for players in that zone id
|
||||
@param target Only clears emotes for that player
|
||||
*/
|
||||
void ClearBossEmotes(Optional<uint32> zoneId = {}, Player const* target = nullptr) const;
|
||||
|
||||
float GetCollisionHeight() const override;
|
||||
uint32 GetVirtualItemId(uint32 slot) const;
|
||||
uint16 GetVirtualItemAppearanceMod(uint32 slot) const;
|
||||
|
||||
@@ -223,6 +223,14 @@ namespace WorldPackets
|
||||
int32 EmoteID = 0;
|
||||
};
|
||||
|
||||
class ClearBossEmotes final : public ServerPacket
|
||||
{
|
||||
public:
|
||||
ClearBossEmotes() : ServerPacket(SMSG_CLEAR_BOSS_EMOTES, 0) { }
|
||||
|
||||
WorldPacket const* Write() override { return &_worldPacket; }
|
||||
};
|
||||
|
||||
class TC_GAME_API PrintNotification final : public ServerPacket
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -1219,7 +1219,7 @@ void OpcodeTable::Initialize()
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_CHROMIE_TIME_SELECT_EXPANSION_SUCCESS, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_CLAIM_RAF_REWARD_RESPONSE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_CLEAR_ALL_SPELL_CHARGES, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_CLEAR_BOSS_EMOTES, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_CLEAR_BOSS_EMOTES, STATUS_NEVER, CONNECTION_TYPE_REALM);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_CLEAR_COOLDOWN, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_CLEAR_COOLDOWNS, STATUS_NEVER, CONNECTION_TYPE_INSTANCE);
|
||||
DEFINE_SERVER_OPCODE_HANDLER(SMSG_CLEAR_RESURRECT, STATUS_UNHANDLED, CONNECTION_TYPE_REALM);
|
||||
|
||||
Reference in New Issue
Block a user