SendPublicMessage() public method

public SendPublicMessage ( Server.Mobile from, string text ) : void
from Server.Mobile
text string
return void
Example #1
0
        public override void OnPublicMessage(Mobile from, string text)
        {
            if (text.Length > 128 || (text = text.Trim()).Length == 0)
            {
                return;
            }

            Party p = Party.Get(from);

            if (p != null)
            {
                p.SendPublicMessage(from, text);

                foreach (Data data in Data.Datas.Values)
                {
                    if (data.GlobalW && !p.Contains(data.Mobile))
                    {
                        data.Mobile.SendMessage(data.GlobalWC, "(Global) <World->Party> {0}: {1}", from.Name, text);
                    }
                }
            }
            else
            {
                from.SendLocalizedMessage(3000211); // You are not in a party.
            }
        }
Example #2
0
        public static void EventSink_PlayerDeath(Mobile from)
        {
            Party p = Get(from);

            if (p != null)
            {
                Mobile m = from.LastKiller;

                if (m == from)
                {
                    p.SendPublicMessage(from, "I killed myself !!");
                }
                else if (m == null)
                {
                    p.SendPublicMessage(from, "I was killed !!");
                }
                else
                {
                    p.SendPublicMessage(from, $"I was killed by {m.Name} !!");
                }
            }
        }
Example #3
0
        public static void EventSink_PlayerDeath(Mobile from, Mobile killer, Container cont)
        {
            Party p = Party.Get(from);

            if (p != null)
            {
                Mobile m = killer;

                if (m == from)
                {
                    p.SendPublicMessage(from, "I killed myself !!");
                }
                else if (m == null)
                {
                    p.SendPublicMessage(from, "I was killed !!");
                }
                else
                {
                    p.SendPublicMessage(from, string.Format("I was killed by {0} !!", m.Name));
                }
            }
        }
Example #4
0
        public static void EventSink_PlayerDeath(PlayerDeathEventArgs e)
        {
            Mobile from = e.Mobile;
            Party  p    = Party.Get(from);

            if (p != null)
            {
                Mobile m = from.LastKiller;

                if (m == from)
                {
                    p.SendPublicMessage(from, "I killed myself !!");
                }
                else if (m == null)
                {
                    p.SendPublicMessage(from, "I was killed !!");
                }
                else
                {
                    p.SendPublicMessage(from, String.Format("I was killed by {0} !!", m.Name));
                }
            }
        }
Example #5
0
        public override void OnPublicMessage(Mobile from, string text)
        {
            if (text.Length > 128 || (text = text.Trim()).Length == 0)
            {
                return;
            }

            Party p = Party.Get(from);

            if (p != null)
            {
                p.SendPublicMessage(from, text);
            }
            else
            {
                from.SendLocalizedMessage(3000211);                 // You are not in a party.
            }
        }