Exemplo n.º 1
0
        public void SendCurrentStage(Player Plr)
        {
            PacketOut Out = new PacketOut((byte)Opcodes.F_OBJECTIVE_INFO);

            Out.WriteUInt32(Info.Entry);
            Out.WriteByte(0);         // Type
            Out.WriteByte(Info.Type);
            Out.WriteByte(Info.Type); // Forteresse, rien du tout ,etc
            Out.WriteUInt16(0);
            Out.WritePascalString(Info.Name);
            Out.WriteByte(1);
            Out.WriteUInt16(0); // Time in second
            Out.WriteUInt32(0x034B0201);
            Out.WriteByte(1);
            Out.WriteByte(0);
            Out.WriteByte(1);
            Out.WriteUInt16(0);
            Out.WriteByte(0);
            Out.WritePascalString("Un Nom");
            Out.WriteByte(0);
            Out.WriteByte(0);
            Out.WriteStringToZero("Stage III");
            Out.WritePascalString("Test d'un message quelque soit");
            Out.WriteUInt16(0);
            Out.WriteUInt16(0x012C);
            Out.WriteUInt32(0x9E);
            Out.WriteUInt32(0);
            Out.WriteByte(0x48);
            Out.WriteUInt32(0);
            //Out.WriteHexStringBytes(Str.Replace(" ", string.Empty));
            Plr.SendPacket(Out);
        }
Exemplo n.º 2
0
        public void BuildPreMail(PacketOut Out, Character_mail Mail)
        {
            if (Mail == null)
            {
                return;
            }

            Out.WriteUInt32(0);
            Out.WriteUInt32((UInt32)Mail.Guid);
            Out.WriteUInt16((UInt16)(Mail.Opened ? 1 : 0));
            Out.WriteByte((byte)(Mail.AuctionType == 0 ? 100 : 0)); // Icon ID

            Out.WriteUInt32(Mail.SendDate);                         // Time
            Out.WriteUInt32(Mail.SendDate);                         // Sent time

            Out.WriteUInt32((UInt32)Mail.CharacterIdSender);        // Sender ID

            Out.WriteByte(0);                                       // 1 = localized name

            Out.WriteByte(0);
            Out.WriteStringToZero(Mail.SenderName);

            Out.WriteByte(0);
            Out.WriteStringToZero(Mail.ReceiverName);

            Out.WriteByte(0);
            Out.WriteStringToZero(Mail.Title);
            Out.WriteUInt32(0);

            Out.WriteUInt32(Mail.Money);
            Out.WriteUInt16((ushort)Mail.Items.Count);
            if (Mail.Items.Count > 0)
            {
                Out.WriteByte(0);
            }
            if (Mail.Items.Count > 8)
            {
                Out.WriteByte(0);
            }

            foreach (KeyValuePair <uint, ushort> item in Mail.Items)
            {
                Out.WriteUInt32(WorldMgr.GetItem_Info(item.Key).ModelId);
            }
        }
Exemplo n.º 3
0
        public void BuildPreMail(PacketOut Out, Character_mail Mail)
        {
            if (Mail == null)
            {
                return;
            }

            Out.WriteUInt32(0);
            Out.WriteUInt32((UInt32)Mail.Guid);
            Out.WriteUInt16((UInt16)(Mail.Opened ? 1 : 0));
            Out.WriteByte(0x64);                             // Icon ID

            Out.WriteUInt32(0xFFE4D486);                     // Time
            Out.WriteUInt32(0xFFE4D486);                     // Sent time

            Out.WriteUInt32((UInt32)Mail.CharacterIdSender); // Sender ID
            Out.WriteByte(0);                                // 1 = localized name

            Out.WriteByte(0);
            Out.WriteStringToZero(Mail.SenderName);

            Out.WriteByte(0);
            Out.WriteStringToZero(Mail.ReceiverName);

            Out.WriteByte(0);
            Out.WriteStringToZero(Mail.Title);

            Out.WriteUInt32(0);

            Out.WriteUInt32(Mail.Money);
            Out.WriteUInt16((ushort)Mail.ItemsReqInfo.Count);
            if (Mail.ItemsReqInfo.Count > 0)
            {
                Out.WriteByte(0);
            }
            if (Mail.ItemsReqInfo.Count > 8)
            {
                Out.WriteByte(0);
            }

            foreach (Character_item item in Mail.ItemsReqInfo)
            {
                Out.WriteUInt32(item.ModelId);
            }
        }
Exemplo n.º 4
0
Arquivo: Player.cs Projeto: uvbs/DoR
        public void SendObjectiveText(string Text)
        {
            PacketOut Out = new PacketOut((byte)Opcodes.F_OBJECTIVE_INFO);

            Out.WriteUInt32(0); // Entry
            Out.WriteByte(0);   // 1
            Out.WriteByte(1);   // 2
            Out.WriteByte(0);   // 1
            Out.WriteUInt16(0);
            Out.WriteStringToZero(Text);
            Out.WriteUInt16(0);
            Out.WriteUInt16(0); // Time
            Out.WriteUInt16(0);
            Out.WriteByte(0);
            SendPacket(Out);
        }
Exemplo n.º 5
0
Arquivo: Player.cs Projeto: uvbs/DoR
        public void SendHelpMessage(Player Plr, string Text)
        {
            /*|00 3D 06 00 00 23 00 00 00 00 0D 57 68 69 69 74 |.=...#.....Whiit|
             |65 63 68 65 72 72 79 00 00 25 4C 46 20 74 61 6E |echerry..%LF tan|
             |6B 20 61 6E 64 20 68 65 61 6C 65 72 20 66 6F 72 |k and healer for|
             |20 73 63 2F 6F 72 76 72 20 67 72 6F 75 70 00 00 | sc/orvr group..|      */

            PacketOut Out = new PacketOut((byte)Opcodes.F_CHAT);

            Out.WriteUInt16(Plr.Oid);
            Out.WriteByte(0x23);
            Out.WriteUInt32(0);
            Out.WriteStringToZero(Plr.Name);
            Out.WriteUInt16((ushort)(Text.Length + 1));
            Out.WriteStringBytes(Text);
            Out.WriteByte(0);
            Out.WriteByte(0);
            SendPacket(Out);
        }
Exemplo n.º 6
0
        public void BuildPreMail(PacketOut Out, Character_mail mail)
        {
            if (mail == null)
            {
                return;
            }

            Out.WriteUInt32(0);
            Out.WriteUInt32((uint)mail.Guid);
            Out.WriteUInt16((ushort)(mail.Opened ? 1 : 0));
            Out.WriteByte((byte)(mail.AuctionType == 0 ? 100 : 0)); // Icon ID

            uint sentTime = (uint)(TCPManager.GetTimeStamp() - mail.SendDate);
            uint readTime = (uint)(TCPManager.GetTimeStamp() - mail.ReadDate);

            Out.WriteUInt32(0xFFFFFFFF - sentTime);    // LastUpdatedTime Sent
            Out.WriteUInt32(0xFFFFFFFF - readTime);    // LastUpdatedTime Read (not displayed afaik)
            Out.WriteUInt32((uint)TimeToExpire(mail)); // Seconds left (expire after 28/3 days)

            if (mail.AuctionType == 0)
            {
                Out.WriteByte(0); // 1 = localized name

                Out.WriteByte(0);
                Out.WriteStringToZero(mail.SenderName);

                Out.WriteByte(0);
                Out.WriteStringToZero(mail.ReceiverName);

                Out.WriteByte(0);
                Out.WriteStringToZero(mail.Title);
            }
            else
            {
                ushort titleLocal = 0;
                if (mail.AuctionType == 1) // Refund (outbid)
                {
                    titleLocal = (ushort)Localized_text.TEXT_AUCTION_MAIL_SUBJECT_REFUND;
                }
                else if (mail.AuctionType == 2) // Complete
                {
                    titleLocal = (ushort)Localized_text.TEXT_AUCTION_MAIL_SUBJECT_COMPLETE;
                }
                else if (mail.AuctionType == 3) // Cancelled
                {
                    titleLocal = (ushort)Localized_text.TEXT_AUCTION_MAIL_SUBJECT_CANCELLED;
                }
                else if (mail.AuctionType == 4) // Expired
                {
                    titleLocal = (ushort)Localized_text.TEXT_AUCTION_MAIL_SUBJECT_EXPIRED;
                }
                else if (mail.AuctionType == 5) // Won
                {
                    titleLocal = (ushort)Localized_text.TEXT_AUCTION_MAIL_SUBJECT_WON;
                }
                else
                {
                    titleLocal = (ushort)Localized_text.TEXT_AUCTION_MAIL_SUBJECT_OTHER;
                }

                Out.WriteByte(0x0D);
                Out.WriteUInt16(0);
                Out.WriteUInt16((ushort)Localized_text.TEXT_AUCTION_MAIL_SENDER_NAME);
                Out.Fill(0, 5);
                Out.WriteByte(1);
                Out.Fill(0, 3);
                Out.WriteUInt16(titleLocal);
                Out.WriteUInt32(0);
            }

            if (mail.Cr && mail.Money > 0)
            {
                Out.WriteUInt32(0xFFFFFFFF);
                Out.WriteUInt32(uint.MaxValue - mail.Money + 1);
            }
            else
            {
                Out.WriteUInt32(0);
                Out.WriteUInt32(mail.Money);
            }

            Out.WriteUInt16((ushort)mail.Items.Count);
            if (mail.Items.Count > 0)
            {
                Out.WriteByte(0);
            }
            if (mail.Items.Count > 8)
            {
                Out.WriteByte(0);
            }

            foreach (MailItem item in mail.Items)
            {
                if (ItemService.GetItem_Info(item.id) != null)
                {
                    Out.WriteUInt32(ItemService.GetItem_Info(item.id).ModelId);
                }
            }
        }