Пример #1
0
        public static void On_PM(CommandEventArgs e)
        {
            Mobile Sender = e.Mobile;

            if (e.ArgString == null || e.ArgString == "")
            {
                Sender.SendGump(new WriteMessageGump("Write your message here", ""));
                return;
            }

            string Recipient = e.GetString(0);
            string Message   = "";

            if (e.Arguments.Length < 2)
            {
                Sender.SendGump(new WriteMessageGump("Write your message here", Recipient));
                return;
            }

            if (e.Arguments.Length > 1)
            {
                Message = e.ArgString.Substring(Recipient.Length + 1, e.ArgString.Length - Recipient.Length - 1);
            }

            List <Mobile> MC = MessCandis(Recipient);

            if (MC.Count > SETTINGS.Max_Name_Canididates)
            {
                Sender.SendMessage(SETTINGS.Error_Message_Hue, SETTINGS.Too_Many_Matches);
                return;
            }

            if (MC.Count < 1)
            {
                Sender.SendMessage(SETTINGS.Error_Message_Hue, SETTINGS.No_Matches);
                return;
            }

            PersonalMessage PM = new PersonalMessage(Sender, MC[0], DateTime.Now, Message);

            MC[0].SendGump(new MessageGump(PM, true));
            Sender.SendMessage(SETTINGS.Regular_Hue, SETTINGS.Message_Sent);
        }
Пример #2
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int v = reader.ReadInt();

            if (v >= 0)
            {
                Mobile   s, r;
                string   m;
                DateTime d;

                s  = reader.ReadMobile();
                r  = reader.ReadMobile();
                m  = reader.ReadString();
                d  = reader.ReadDateTime();
                PM = new PersonalMessage(s, r, d, m);
            }
        }
Пример #3
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            switch (info.ButtonID)
            {
            case 0: { break; }

                #region Buttons
            case 1000:
            {
                string who     = info.TextEntries[0].Text;
                string message = info.TextEntries[1].Text;

                Mobile Sender = from;

                List <Mobile> MC = PMCommand.MessCandis(who);

                if (MC.Count > SETTINGS.Max_Name_Canididates)
                {
                    Sender.SendMessage(SETTINGS.Error_Message_Hue, SETTINGS.Too_Many_Matches);
                    CloseMG(Sender);
                    Sender.SendGump(new WriteMessageGump(message, who));
                    return;
                }

                if (MC.Count < 1)
                {
                    Sender.SendMessage(SETTINGS.Error_Message_Hue, SETTINGS.No_Matches);
                    CloseMG(Sender);
                    Sender.SendGump(new WriteMessageGump(message, who));
                    return;
                }

                if (MC[0].AccessLevel > SETTINGS.Top_Access && !(Sender.AccessLevel > AccessLevel.Player))
                {
                    Sender.SendMessage(SETTINGS.Error_Message_Hue, SETTINGS.Above_Top_Access);
                    CloseMG(Sender);
                    Sender.SendGump(new WriteMessageGump(message, who));
                    return;
                }

                PersonalMessage PM = new PersonalMessage(Sender, MC[0], DateTime.Now, message);
                MC[0].SendGump(new MessageGump(PM, true));
                Sender.SendMessage(SETTINGS.Regular_Hue, SETTINGS.Message_Sent);
                break;
            }

            case 1001:
            {
                string who     = info.TextEntries[0].Text;
                string message = info.TextEntries[1].Text;

                Mobile Sender = from;

                List <Mobile> MC = PMCommand.MessCandis(who);

                if (MC.Count > SETTINGS.Max_Name_Canididates)
                {
                    Sender.SendMessage(SETTINGS.Error_Message_Hue, SETTINGS.Too_Many_Matches);
                    CloseMG(Sender);
                    Sender.SendGump(new WriteMessageGump(message, who));
                    return;
                }

                if (MC.Count < 1)
                {
                    Sender.SendMessage(SETTINGS.Error_Message_Hue, SETTINGS.No_Matches);
                    CloseMG(Sender);
                    Sender.SendGump(new WriteMessageGump(message, who));
                    return;
                }

                PersonalMessage PM  = new PersonalMessage(from, MC[0], DateTime.Now, message);
                PMSaveDeed      PSD = new PMSaveDeed(PM);
                from.AddToBackpack(PSD);
                break;
            }
                #endregion
            }
        }
Пример #4
0
 public PersonalMessageDeed(PersonalMessage Message)
     : base(0x14F0)
 {
     PM   = Message;
     Name = "A Personal Message";
 }
Пример #5
0
 public PMSaveDeed(PersonalMessage Message)
     : base(0x14F0)
 {
     PM   = Message;
     Name = "A Saved Message";
 }