OnAccept() public method

public OnAccept ( Server.Mobile from ) : void
from Server.Mobile
return void
Example #1
0
        public override void OnAccept(Mobile from, Mobile sentLeader)
        {
            Mobile leader = from.Party as Mobile;

            from.Party = null;

            Party p = Party.Get(leader);

            if (leader == null || p == null || !p.Candidates.Contains(from))
            {
                from.SendLocalizedMessage(3000222);                 // No one has invited you to be in a party.
            }
            else if ((p.Members.Count + p.Candidates.Count) <= Party.Capacity)
            {
                p.OnAccept(from);
            }
        }
Example #2
0
        public override void OnAccept(Mobile from, Mobile sentLeader)
        {
            Mobile leader = from.Party as Mobile;

            from.Party = null;

            var pm = from as PlayerMobile;

            Party p = Party.Get(leader);

            if (leader == null || p == null || !p.Candidates.Contains(from))
            {
                from.SendLocalizedMessage(3000222);                   // No one has invited you to be in a party.
            }
            else if (pm != null && pm.PokerGame != null)
            {
                pm.SendMessage(61, "You may not join a party while participating in a poker game.");
            }
            else if ((p.Members.Count + p.Candidates.Count) <= Party.Capacity)
            {
                p.OnAccept(from);
            }
        }