Exemplo n.º 1
0
        public static RealmPacketOut CreatePrivateShopChatResResponse(Character sender, string message, Locale locale)
        {
            RealmPacketOut realmPacketOut = new RealmPacketOut(RealmServerOpCode.PrivateShopChatRes);

            realmPacketOut.WriteInt32(1);
            realmPacketOut.WriteFixedAsciiString(sender.Name, 20, locale);
            realmPacketOut.WriteAsciiString(message, locale);
            realmPacketOut.WriteByte(0);
            return(realmPacketOut);
        }
Exemplo n.º 2
0
 public static void SendRoomChatMsgResponse(IRealmClient client, uint senderAccId, int color, string msg, Locale locale)
 {
     using (var packet = new RealmPacketOut(RealmServerOpCode.RoomChatMsg)) //6247
     {
         packet.WriteInt32(senderAccId);                                    //{accId}default value : 361343 Len : 4
         packet.WriteInt32(color);                                          //{color}default value : -10240 Len : 4
         packet.WriteInt32(0);                                              //value name : unk7 default value : 0Len : 4
         packet.WriteAsciiString(msg, locale);                              //{msg}default value :  Len : 0
         client.ActiveCharacter.ChatRoom.Send(packet, true, locale);
     }
 }
Exemplo n.º 3
0
        public static RealmPacketOut CreateNormalChatMessagePacket(string sender, string message, Locale locale)
        {
            var packet = new RealmPacketOut(RealmServerOpCode.NormalChatResponse); //5085

            packet.WriteInt16(0);                                                  //sender sessIddefault value : 37
            packet.WriteInt32(0);                                                  //sender accId
            packet.WriteFixedAsciiString(sender, 20, locale);                      //{sender}default value :
            packet.WriteAsciiString(message, locale);                              //{msg}default value :

            return(packet);
        }
Exemplo n.º 4
0
        public static void SendPartyChatResponse(Character sender, string msg)
        {
            using (var packet = new RealmPacketOut(RealmServerOpCode.PartyChatResponse)) //5106
            {
                packet.WriteInt16(sender.SessionId);                                     //{sessId}default value : 37 Len : 2
                packet.WriteFixedAsciiString(CreateSenderName(sender), 20);              //{sender}default value :  Len : 20
                packet.WriteInt16(sender.SessionId);                                     //{sessId}default value : 37 Len : 2
                packet.WriteByte(0);
                packet.WriteAsciiString(msg, sender.Client.Locale);                      //{msg}default value :  Len : 0

                sender.Group.Send(packet, addEnd: false);
            }
        }
Exemplo n.º 5
0
        public static RealmPacketOut CreateGlobalChatMessage(string sender, string message, Color color, Locale locale)
        {
            var packet = new RealmPacketOut(RealmServerOpCode.GlobalChatWithItemResponse); //6561

            packet.WriteInt32(1);                                                          //{mustBeOne}default value : 1 Len : 4

            /*packet.WriteByte(blue);//{blue}default value : 0 Len : 1
             * packet.WriteByte(green);//{green}default value : 0 Len : 1
             * packet.WriteByte(red);//{red}default value : 255 Len : 1
             * packet.WriteByte(alfa);//{alfa}default value : 255 Len : 1*/
            packet.WriteInt32(color.ARGBValue);
            packet.WriteInt32(0);                             //value name : unk4 default value : 0Len : 4
            packet.WriteFixedAsciiString(sender, 20, locale); //{sender}default value :
            packet.WriteAsciiString(message, locale);         //{msg}default value :

            return(packet);
        }
Exemplo n.º 6
0
        public static void SendWishperChatResponse(IRealmClient recieverClient, byte soulmate, int senderAccId,
                                                   short rcvSessId, string sender, string msg,
                                                   IRealmClient senderClient = null)
        {
            var isPrueEnglish = Asda2EncodingHelper.IsPrueEnglish(msg);
            var locale        = Locale.En;

            if (!isPrueEnglish)
            {
                if (senderClient != null)
                {
                    locale = senderClient.Locale;
                    if (senderClient.Locale != recieverClient.Locale)
                    {
                        senderClient.Send(CreateGlobalChatMessage("Chat manager",
                                                                  "You can send only english text to this character", Color.Red, Locale.En));
                        return;
                    }
                }
            }
            using (var packet = new RealmPacketOut(RealmServerOpCode.WishperChat)) //5089
            {
                packet.WriteByte(soulmate);                                        //{soulmate}default value : 0 Len : 1
                packet.WriteByte(1);                                               //value name : unk0 default value : 1Len : 1
                packet.WriteInt32(senderAccId);                                    //{senderAccId}default value : 340701 Len : 4
                packet.WriteInt16(rcvSessId);                                      //{rcvSessId}default value : 37 Len : 2
                packet.WriteFixedAsciiString(sender, 21);
                //{sender}default value :  Len : 21
                packet.WriteAsciiString(msg, recieverClient.Locale); //{msg}default value :  Len : 0
                if (senderClient != null)
                {
                    senderClient.Send(packet, addEnd: false);
                }
                recieverClient.Send(packet, addEnd: false);
            }
        }