Пример #1
0
        public override void OnDoubleClick(Mobile from)
        {
            if (Galleon.IsDriven)
            {
                Galleon.LeaveCommand(from);
                from.SendLocalizedMessage(1149592); //You are no longer piloting this vessel. -Dian
            }
            else if (Galleon != null && from != null)
            {
                if (!Galleon.Contains(from))                 // -Dian
                {
                    from.SendLocalizedMessage(1116724);      //You cannot pilot a ship unless you are aboard it! -Dian
                    return;
                }

                if (from.Mounted)
                {
                    from.SendLocalizedMessage(1042146);                     //You cannot use this while mounted. -Dian
                    return;
                }

                if (from.Flying)                        // -Dian
                {
                    from.SendLocalizedMessage(1116615); //You cannot pilot a ship while flying! -Dian
                    return;
                }

                if (from == Galleon.Owner)
                {
                    from.SendLocalizedMessage(1116727);                     //You are now piloting this vessel. -Dian
                    Galleon.TakeCommand(from);
                }
                else if (Galleon.PlayerAccess != null)
                {
                    if (Galleon.PlayerAccess.ContainsKey((PlayerMobile)from))
                    {
                        if (2 <= Galleon.PlayerAccess[(PlayerMobile)from] && Galleon.PlayerAccess[(PlayerMobile)from] <= 4)
                        {
                            from.SendLocalizedMessage(1116727);                             //You are now piloting this vessel. -Dian
                            Galleon.TakeCommand(from);
                        }
                        else if ((from.Guild != null) && (from.Guild == Galleon.Owner.Guild))
                        {
                            if (2 <= Galleon.Guild && Galleon.Guild <= 4)
                            {
                                from.SendLocalizedMessage(1116727);                                 //You are now piloting this vessel. -Dian
                                Galleon.TakeCommand(from);
                            }
                            else
                            {
                                from.SendLocalizedMessage(1061637);                                 //You are not allowed to access this. -Dian
                            }
                        }
                        else if ((from.Party != null) && (from.Party == Galleon.Owner.Party))
                        {
                            if (2 <= Galleon.Party && Galleon.Party <= 4)
                            {
                                from.SendLocalizedMessage(1116727);                                 //You are now piloting this vessel. -Dian
                                Galleon.TakeCommand(from);
                            }
                            else
                            {
                                from.SendLocalizedMessage(1061637);                                 //You are not allowed to access this. -Dian
                            }
                        }
                        else if (2 <= Galleon.Public && Galleon.Public <= 4)
                        {
                            from.SendLocalizedMessage(1116727);                             //You are now piloting this vessel. -Dian
                            Galleon.TakeCommand(from);
                        }
                        else
                        {
                            from.SendLocalizedMessage(1061637);                             //You are not allowed to access this. -Dian
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(1061637);                         //You are not allowed to access this. -Dian
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1061637);                     //You are not allowed to access this. -Dian
                }
            }
        }