Core/Packets: converted SMSG_EMOTE to packet class
This commit is contained in:
1 parent
b5f2c6f4c5
commit
40ec92758c
4 files changed
+28
-7
No files matched your search
@@ -26,6 +26,7 @@
|
||||
#include "CharacterCache.h"
|
||||
#include "Chat.h"
|
||||
#include "ChatTextBuilder.h"
|
||||
#include "ChatPackets.h"
|
||||
#include "CombatLogPackets.h"
|
||||
#include "CombatPackets.h"
|
||||
#include "Common.h"
|
||||
@@ -1507,12 +1508,13 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss)
|
||||
}
|
||||
}
|
||||
|
||||
void Unit::HandleEmoteCommand(uint32 anim_id)
|
||||
void Unit::HandleEmoteCommand(uint32 emoteId)
|
||||
{
|
||||
WorldPacket data(SMSG_EMOTE, 4 + 8);
|
||||
data << uint32(anim_id);
|
||||
data << uint64(GetGUID());
|
||||
SendMessageToSet(&data, true);
|
||||
WorldPackets::Chat::Emote emote;
|
||||
emote.Guid = GetGUID();
|
||||
emote.EmoteID = emoteId;
|
||||
|
||||
SendMessageToSet(emote.Write(), true);
|
||||
}
|
||||
|
||||
/*static*/ bool Unit::IsDamageReducedByArmor(SpellSchoolMask schoolMask, SpellInfo const* spellInfo /*= nullptr*/)
|
||||
|
||||
@@ -1042,7 +1042,7 @@ class TC_GAME_API Unit : public WorldObject
|
||||
DamageInfo* damageInfo, HealInfo* healInfo);
|
||||
void TriggerAurasProcOnEvent(ProcEventInfo& eventInfo, AuraApplicationProcContainer& procAuras);
|
||||
|
||||
void HandleEmoteCommand(uint32 anim_id);
|
||||
void HandleEmoteCommand(uint32 emoteId);
|
||||
void AttackerStateUpdate(Unit* victim, WeaponAttackType attType = BASE_ATTACK, bool extra = false);
|
||||
|
||||
void CalculateMeleeDamage(Unit* victim, CalcDamageInfo* damageInfo, WeaponAttackType attackType = BASE_ATTACK);
|
||||
|
||||
@@ -34,3 +34,11 @@ WorldPacket const* WorldPackets::Chat::STextEmote::Write()
|
||||
|
||||
return &_worldPacket;
|
||||
}
|
||||
|
||||
WorldPacket const* WorldPackets::Chat::Emote::Write()
|
||||
{
|
||||
_worldPacket << uint32(EmoteID);
|
||||
_worldPacket << Guid;
|
||||
|
||||
return &_worldPacket;
|
||||
}
|
||||
@@ -49,7 +49,18 @@ namespace WorldPackets
|
||||
int32 SoundIndex = 0;
|
||||
int32 EmoteID = 0;
|
||||
};
|
||||
|
||||
class Emote final : public ServerPacket
|
||||
{
|
||||
public:
|
||||
Emote() : ServerPacket(SMSG_EMOTE, 8 + 4) { }
|
||||
|
||||
WorldPacket const* Write() override;
|
||||
|
||||
ObjectGuid Guid;
|
||||
uint32 EmoteID = 0;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // ArchaeologyPackets_h__
|
||||
#endif // ChatPackets_h__
|
||||
Reference in new issue
Block a user