public static void HandleTextEmote(IRealmClient client, RealmPacketIn packet) { Character activeCharacter = client.ActiveCharacter; if (!activeCharacter.CanMove || !activeCharacter.CanInteract) { return; } TextEmote emote1 = (TextEmote)packet.ReadUInt32(); packet.SkipBytes(4); EntityId id = packet.ReadEntityId(); INamed target = activeCharacter.Map.GetObject(id); if (target != null) { SendTextEmote(activeCharacter, emote1, target); } EmoteType emote2; EmoteDBC.EmoteRelationReader.Entries.TryGetValue((int)emote1, out emote2); switch (emote2) { case EmoteType.StateDance: case EmoteType.StateSleep: case EmoteType.StateSit: case EmoteType.StateKneel: activeCharacter.EmoteState = emote2; break; default: activeCharacter.Emote(emote2); break; } }
public void DoTextEmote(TextEmote emote) { var packet = new OutPacket(WorldCommand.CMSG_TEXT_EMOTE); packet.Write((uint)emote); packet.Write((uint)0); packet.Write((ulong)0); SendPacket(packet); }
public void DoTextEmote(TextEmote emote) { var packet = new OutPacket(NetworkOperationCode.CMSG_TEXT_EMOTE); packet.Write((uint)emote); packet.Write((uint)0); packet.Write((ulong)0); SendPacket(packet); }
public static void SendTextEmote(WorldObject obj, TextEmote emote, INamed target) { using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.SMSG_TEXT_EMOTE, target == null ? 20 : target.Name.Length + 21)) { packet.Write(obj.EntityId); packet.WriteUInt((uint)emote); packet.WriteInt(-1); packet.WriteUIntPascalString(target != null ? target.Name : ""); obj.SendPacketToArea(packet, true, false, Locale.Any, new float?()); } }
// Client doesn't seem to be sending this //[ClientPacketHandler(RealmServerOpCode.CMSG_EMOTE)] //public static void HandleEmote(IRealmClient client, RealmPacketIn packet) //{ // var emote = (EmoteType)packet.ReadUInt32(); // if (emote != EmoteType.None) // { // var chr = client.ActiveCharacter; // if (chr.CanMove && chr.CanInteract) // { // SendEmote(chr, emote); // } // } //} public static void SendTextEmote(WorldObject obj, TextEmote emote, INamed target) { var len = (target == null) ? 20 : target.Name.Length + 21; using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_TEXT_EMOTE, len)) { packet.Write(obj.EntityId); packet.WriteUInt((uint)emote); packet.WriteInt(-1); packet.WriteUIntPascalString(target != null ? target.Name : ""); obj.SendPacketToArea(packet, true); } }
// Client doesn't seem to be sending this //[ClientPacketHandler(RealmServerOpCode.CMSG_EMOTE)] //public static void HandleEmote(IRealmClient client, RealmPacketIn packet) //{ // var emote = (EmoteType)packet.ReadUInt32(); // if (emote != EmoteType.None) // { // var chr = client.ActiveCharacter; // if (chr.CanMove && chr.CanInteract) // { // SendEmote(chr, emote); // } // } //} public static void SendTextEmote(WorldObject obj, TextEmote emote, INamed target) { var len = (target == null) ? 20 : target.Name.Length + 21; using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_TEXT_EMOTE, len)) { packet.Write(obj.EntityId); packet.WriteUInt((uint)emote); packet.WriteInt(-1); packet.WriteUIntPascalString(target != null ? target.Name : ""); obj.SendPacketToArea(packet, true); } }
/// <summary> /// Makes this Unit do a text emote /// </summary> /// <param name="emote">Anything that has a name (to do something with) or null</param> public void TextEmote(TextEmote emote, INamed target) { EmoteHandler.SendTextEmote(this, emote, target); }
public void DoTextEmote(TextEmote emote) { var packet = new OutPacket(WorldCommand.CMSG_TEXT_EMOTE); packet.Write((uint)emote); packet.Write((uint)0); packet.Write((ulong)0); SendPacket(packet); }