ArrowPM :)

The only thing I have modified on this, are some translated texts to Spanish, but they are few.

And here are also the great Knives' Chat.
 

Attachments

  • ArrowPM.7z
    3 KB · Views: 13
  • Knives Chat.7z
    57.2 KB · Views: 9
Last edited:
I believe you have to have his Bittiez utilities that works hand in hand with a few of his system's. Including arrow one .
 
ArrowPM :)

The only thing I have modified on this, are some translated texts to Spanish, but they are few.

And here are also the great Knives' Chat.

I speak spanish, i translated my knives to spanish too, i really wanted Arrowpm, so thanks to everyone that posted it here!
[doublepost=1479635900][/doublepost]
I believe you have to have his Bittiez utilities that works hand in hand with a few of his system's. Including arrow one .

Yes, here:
 

Attachments

  • Bittiez_Utilities.cs
    5.5 KB · Views: 16
Does anyone knows how to sightly modify it this way:

When a player recieve a message the actual message opens, in the middle of the screen (wich can be abused to annoy someone while in pvp)

Is there a way to make it pop a smaller gump, then the player have to double click it to open the message?
Like the smalle scrol gump from knives chat3

Code:
public class PmNotifyGump20 : GumpPlus
    {
        public PmNotifyGump20( Mobile m ) : base( m, 200, 50 )
        {
            m.CloseGump( typeof( PmNotifyGump20 ) );
        }

        protected override void BuildGump()
        {
            if (Data.GetData(Owner).GetMsg() != null)
            {
                AddButton(30, 10, 0x82E, "Message", new GumpCallback(Message));
                AddImage(0, 0, 0x9CB);
                AddImageTiled(35, 7, 20, 8, 0x9DC);
                AddHtml(23, 1, 50, "<CENTER>" + HTML.Black + Data.GetData(Owner).GetMsg().From.RawName);
            }
        }

        private void Message()
        {
            Data.GetData(Owner).CheckMsg();

            if (Data.GetData(Owner).NewMsg())
                NewGump();
        }
    }

well thanks....
 
Would need to look at the full script to write the code but you could insert a new gump like the scroll with parameters From mobile, To mobile, Message

If the button on the scroll is clicked then it passes the info to the MSG gump
 
Would need to look at the full script to write the code but you could insert a new gump like the scroll with parameters From mobile, To mobile, Message

If the button on the scroll is clicked then it passes the info to the MSG gump

Arrowpm script?

Messagegump.cs

Code:
using System;
using Server;
using Server.Gumps;
using Server.Network;
using Bittiez.ArrowPM;

namespace Bittiez.ArrowPM
{
    public class MessageGump : Gump
    {
        Mobile Recipient, Sender;
        private PersonalMessage PM;

        public MessageGump(PersonalMessage Message, bool Show_Buttons)
            : base(SETTINGS.MessageGump_X, SETTINGS.MessageGump_Y)
        {
            #region Gump Stuff
            Recipient = Message.RECIPIENT;
            Sender = Message.SENDER;
            PM = Message;
            this.Closable = true;
            this.Disposable = true;
            this.Dragable = true;
            this.Resizable = false;
            #endregion

            #region Start_Gump
            AddPage(0);
            AddBackground(0, 0, SETTINGS.MessageGump_W, SETTINGS.MessageGump_H, 9350);
            AddPage(1);
            #endregion


            AddLabel(5, 3, 0, string.Format("De: {0}", Message.SENDER.RawName));
            AddLabel(5, 21, 0, string.Format("Fecha: {0}", Message.DATE.ToShortDateString()));

            AddHtml(5, 46, SETTINGS.MessageGump_W - 10, SETTINGS.MessageGump_H - 79, @Message.MESSAGE, true, true);
            if (Show_Buttons)
            {
                AddButton(5, SETTINGS.MessageGump_H - 30, 2445, 2445, 1000, GumpButtonType.Reply, 1000);
                AddLabel(45, SETTINGS.MessageGump_H - 30, 0, @"Guardar");

                AddButton(SETTINGS.MessageGump_W - 113, SETTINGS.MessageGump_H - 30, 2445, 2445, 0, GumpButtonType.Reply, 0);
                AddLabel((SETTINGS.MessageGump_W - 113) + 30, SETTINGS.MessageGump_H - 30, 0, @"Descartar");
            }
            AddLogo();
        }
        private void AddLogo()
        {
            AddLabel(SETTINGS.MessageGump_W - 60, 5, 0, @"");
            AddItem(SETTINGS.MessageGump_W - 70, 25, 0xF3F);
            AddItem(SETTINGS.MessageGump_W - 60, 25, 0xF3F);
            AddItem(SETTINGS.MessageGump_W - 50, 25, 0xF3F);
            AddItem(SETTINGS.MessageGump_W - 40, 25, 0xF3F);
        }

        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            switch (info.ButtonID)
            {
                case 0: { break; }
                #region Buttons
                case 1000:
                    {
                        PersonalMessageDeed d = new PersonalMessageDeed(PM);
                        from.AddToBackpack(d);
                        break;
                    }
                #endregion

            }
        }
    }

    public class PersonalMessage
    {
        #region Privates
        private Mobile Sender, Recipient;
        private DateTime Date;
        private string Message;
        #endregion
        #region Publics
        public Mobile SENDER { get { return Sender; } set { Sender = value; } }
        public Mobile RECIPIENT { get { return Recipient; } set { Recipient = value; } }
        public DateTime DATE { get { return Date; } set { Date = value; } }
        public string MESSAGE { get { return Message; } set { Message = value; } }
        #endregion
        public PersonalMessage(Mobile sender, Mobile recipient, DateTime date, string message)
        {
            SENDER = sender;
            RECIPIENT = recipient;
            DATE = date;
            MESSAGE = message;
        }
    }

    public class PersonalMessageDeed : Item
    {
        private PersonalMessage PM;
        public PersonalMessageDeed(PersonalMessage Message)
            : base(0x14F0)
        {
            PM = Message;
            Name = "Mensaje personal";
        }
        public PersonalMessageDeed(Serial serial) { }

        public override void GetProperties(ObjectPropertyList list)
        {
            base.GetProperties(list);
            list.Add(string.Format("De: {0}<br>Fecha: {1}", PM.SENDER.RawName, PM.DATE.ToShortDateString()));
        }

        public override void OnDoubleClick(Mobile from)
        {
            from.SendGump(new MessageGump(PM, false));
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write(0);

            //v 0
            writer.Write(PM.SENDER);
            writer.Write(PM.RECIPIENT);
            writer.Write(PM.MESSAGE);
            writer.Write(PM.DATE);
        }
        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);
            }
        }
    }
}

PmCommand.cs

Code:
using System;
using System.Collections.Generic;
using System.Text;
using Server.Commands;
using Server;

namespace Bittiez.ArrowPM
{
    public class PMCommand
    {
        public static int Version = 3;
        public static void Initialize()
        {
            Type t = ScriptCompiler.FindTypeByFullName("Bittiez.Tools");
            if (t == null)
            {
                Console.WriteLine("Bittiez Utilities is required for ArrowPM!");
                throw new Exception("Bittiez Utilities is required for ArrowPM!");
            }

            foreach (string pre in SETTINGS.COMMAND_PREFIX)
                CommandSystem.Register(pre, AccessLevel.GameMaster, new CommandEventHandler(On_PM));

                Bittiez.Tools.ConsoleWrite(ConsoleColor.Blue, "Sistema ArrowPM Version " + Bittiez.Tools.Format_Version(Version));
        }

        public static void On_PM(CommandEventArgs e)
        {
            Mobile Sender = e.Mobile;
            if (e.ArgString == null || e.ArgString == "")
            {
                Sender.SendGump(new WriteMessageGump("Escribe tu mensaje aqui...", ""));
                return;
            }

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

            if (e.Arguments.Length < 2)
            {
                Sender.SendGump(new WriteMessageGump("Escribe tu mensaje aqui...", 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);
        }

        public static List<Mobile> MessCandis(string name)
        {
            List<Mobile> MC = new List<Mobile>();
            List<Mobile> OP = Bittiez.Tools.List_Connected_Players();
            foreach (Mobile m in OP)
            {
                if (m.RawName.ToLower().Contains(name.ToLower()))
                {
                    MC.Add(m);
                }
            }
            return MC;
        }
    }
}

SETTINGS.cs

Code:
using System;
using System.Text;
using Bittiez.ArrowPM;
using Server;

namespace Bittiez.ArrowPM
{
    public class SETTINGS
    {
        #region MessageGump
        public static int MessageGump_W = 329; //Message gump width
        public static int MessageGump_H = 271;//Message gump height

        public static int MessageGump_X = 75; //Message gump X
        public static int MessageGump_Y = 75;//Message gump Y
        #endregion

        #region PMCommand
        public static string[] COMMAND_PREFIX = { "pm", "msg" };
        public static int Max_Name_Canididates = 10; //High number = less strict name matches, lower number = stricter name matching
        #endregion

        #region PM Options
        public static AccessLevel Top_Access = AccessLevel.Player; //This is the highest access level PLAYERS can send PM's to.
        #endregion

        #region Messages
        public static string Too_Many_Matches = "No hay coincidencias con lo que has escrito.";
        public static string No_Matches = "No se encontro el nombre que buscas.";
        public static string Above_Top_Access = "No puedes enviar mensajes directamente a la administracion, usa el sistema de ayuda.";
        public static string Message_Sent = "Mensaje enviado...";

        public static int Error_Message_Hue = 38;
        public static int Regular_Hue = 42;
        #endregion
    }
}


WriteMessageGump.cs


Code:
using System;
using Server;
using Server.Gumps;
using Server.Network;
using Bittiez.ArrowPM;
using System.Collections.Generic;

namespace Bittiez.ArrowPM
{
    public class WriteMessageGump : Gump
    {
        public WriteMessageGump(string Mess, string To)
            : base(SETTINGS.MessageGump_X, SETTINGS.MessageGump_Y)
        {
            #region Gump Stuff
            this.Closable = true;
            this.Disposable = true;
            this.Dragable = true;
            this.Resizable = false;
            #endregion
            #region Start_Gump
            AddPage(0);
            AddBackground(0, 0, SETTINGS.MessageGump_W, SETTINGS.MessageGump_H, 9350);
            AddPage(1);
            #endregion

            AddLabel(5, 3, 0, string.Format("A: "));
            AddTextEntry(25, 3, SETTINGS.MessageGump_W - 30, 20, 38, 0, To);

            AddTextEntry(5, 46, SETTINGS.MessageGump_W - 10, SETTINGS.MessageGump_H - 79, 38, 1, Mess);
            AddButton(5, SETTINGS.MessageGump_H - 30, 2445, 2445, 1000, GumpButtonType.Reply, 1000);
            AddLabel(42, SETTINGS.MessageGump_H - 30, 0, @"Enviar");

            AddButton(SETTINGS.MessageGump_W - 113, SETTINGS.MessageGump_H - 30, 2445, 2445, 1001, GumpButtonType.Reply, 1001);
            AddLabel((SETTINGS.MessageGump_W - 113) + 40, SETTINGS.MessageGump_H - 30, 0, @"Guardar");
            AddLogo();
        }
        private void AddLogo()
        {
            AddLabel(SETTINGS.MessageGump_W - 60, 5, 0, @"");
            AddItem(SETTINGS.MessageGump_W - 70, 25, 0xF3F);
            AddItem(SETTINGS.MessageGump_W - 60, 25, 0xF3F);
            AddItem(SETTINGS.MessageGump_W - 50, 25, 0xF3F);
            AddItem(SETTINGS.MessageGump_W - 40, 25, 0xF3F);
        }

        public static void CloseMG(Mobile Sender)
        {
            if (Sender.HasGump(typeof(WriteMessageGump)))
                Sender.CloseGump(typeof(WriteMessageGump));
        }

        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

            }
        }
    }

    public class PMSaveDeed : Item
    {
        private PersonalMessage PM;
        public PMSaveDeed(PersonalMessage Message)
            : base(0x14F0)
        {
            PM = Message;
            Name = "Mensaje guardado";
        }
        public PMSaveDeed(Serial serial) { }

        public override void GetProperties(ObjectPropertyList list)
        {
            base.GetProperties(list);
            list.Add(string.Format("Fecha: {0}", PM.DATE.ToShortDateString()));
        }

        public override void OnDoubleClick(Mobile from)
        {
            from.SendGump(new WriteMessageGump(PM.MESSAGE, PM.RECIPIENT.RawName));
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write(0);

            //v 0
            writer.Write(PM.SENDER);
            writer.Write(PM.RECIPIENT);
            writer.Write(PM.MESSAGE);
            writer.Write(PM.DATE);
        }
        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);
            }
        }
    }
}
 
If you have some time, I suggest you to edit arrowPM like me, adding a GDR behaviour.
When a player recieve a message the actual message opens, in the middle of the screen (wich can be abused to annoy someone while in pvp)
For example I added new NPCs (Messengers) so PMs can be sent or received only using Messengers (you've to pay to send or check for new messages manually).. in this way you're not spammed with PMs.
I've also added the possibility, in particular circumstances, to use special pidgeons/crows so you can send messages even without Messengers in range, but in this case I've added a timer to simulate the travel time based on players distance (even in this case, you should not have PMs spam).
 
test these two file replacements
Thank you so much im going to use it asap
[doublepost=1482067520][/doublepost]
If you have some time, I suggest you to edit arrowPM like me, adding a GDR behaviour.

For example I added new NPCs (Messengers) so PMs can be sent or received only using Messengers (you've to pay to send or check for new messages manually).. in this way you're not spammed with PMs.
I've also added the possibility, in particular circumstances, to use special pidgeons/crows so you can send messages even without Messengers in range, but in this case I've added a timer to simulate the travel time based on players distance (even in this case, you should not have PMs spam).


Thanks!! im going to check it right now, thank u again
[doublepost=1482067966][/doublepost]This is the errors im getting, using zerodrowned files:


Errors:
+ KUSTOM/27-10-2016/ArrowPM/MessageGump.cs:
CS0163: Line 81: Control cannot fall through from one case label ('case 1234
56789:') to another
CS1729: Line 132: 'Bittiez.ArrowPM.MessageGump' does not contain a construct
or that takes '2' arguments
+ KUSTOM/27-10-2016/ArrowPM/PMCommand.cs:
CS1729: Line 63: 'Bittiez.ArrowPM.MessageGump' does not contain a constructo
r that takes '2' arguments
 
Last edited:
ty for testing, these should fix the errors
no, dont say thanks to me lol

this is what im getting now:


Errors:
+ ArrowPM/WriteMessageGump.cs:
CS1729: Line 95: 'Bittiez.ArrowPM.MessageGump' does not contain a constructo
r that takes '2' arguments
 
your line 95 should look like

MC[0].SendGump(new MessageGump(PM, false, false));
i did that, server

doesnt start

Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.

it gives give me a lot of warnings, i already had them before
 
Edit! it works!!!!


Thank youuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu : )
 
Last edited:
Back