Пример #1
0
        public virtual void UseGate(Mobile m)
        {
            ClientFlags flags = m.NetState == null ? ClientFlags.None : m.NetState.Flags;

            if (Server.Engines.VvV.VvVSigil.ExistsOn(m))
            {
                m.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
            }
            else if (CityTradeSystem.HasTrade(m))
            {
                m.SendLocalizedMessage(1151733); // You cannot do that while carrying a Trade Order.
            }
            else if (TargetMap == Map.Felucca && m is PlayerMobile && ((PlayerMobile)m).Young)
            {
                m.SendLocalizedMessage(1049543); // You decide against traveling to Felucca while you are still young.
            }
            else if ((SpellHelper.RestrictRedTravel && m.Murderer && TargetMap != Map.Felucca && !Siege.SiegeShard) ||
                     (TargetMap == Map.Tokuno && (flags & ClientFlags.Tokuno) == 0) ||
                     (TargetMap == Map.Malas && (flags & ClientFlags.Malas) == 0) ||
                     (TargetMap == Map.Ilshenar && (flags & ClientFlags.Ilshenar) == 0))
            {
                m.SendLocalizedMessage(1019004); // You are not allowed to travel there.
            }
            else if (m.Spell != null || BaseBoat.IsDriving(m))
            {
                m.SendLocalizedMessage(1049616); // You are too busy to do that at the moment.
            }
            else if (m.Holding != null)
            {
                m.SendLocalizedMessage(1071955); // You cannot teleport while dragging an object.
            }
            else if (TargetMap != null && TargetMap != Map.Internal)
            {
                OnGateUsed(m);
            }
            else
            {
                m.SendLocalizedMessage(1113744); // This moongate is not yet bonded to the magics of Sosaria.
            }
        }
Пример #2
0
        public virtual void UseGate(Mobile m)
        {
            var flags = m.NetState == null ? ClientFlags.None : m.NetState.Flags;

            if (Sigil.ExistsOn(m))
            {
                m.SendLocalizedMessage(1061632);                 // You can't do that while carrying the sigil.
            }
            else if (TargetMap == Map.Felucca && m is PlayerMobile && ((PlayerMobile)m).Young)
            {
                m.SendLocalizedMessage(1049543);                 // You decide against traveling to Felucca while you are still young.
            }
            else if ((m.Murderer && TargetMap != Map.Felucca && !Siege.SiegeShard) ||
                     (TargetMap == Map.Tokuno && (flags & ClientFlags.Tokuno) == 0) ||
                     (TargetMap == Map.Malas && (flags & ClientFlags.Malas) == 0) ||
                     (TargetMap == Map.Ilshenar && (flags & ClientFlags.Ilshenar) == 0))
            {
                m.SendLocalizedMessage(1019004);                 // You are not allowed to travel there.
            }
            else if (m.Spell != null || BaseBoat.IsDriving(m))
            {
                m.SendLocalizedMessage(1049616);                 // You are too busy to do that at the moment.
            }
            else if (m.Holding != null)
            {
                m.SendLocalizedMessage(1071955);                 // You cannot teleport while dragging an object.
            }
            else if (TargetMap != null && TargetMap != Map.Internal)
            {
                OnGateUsed(m);
            }
            else
            {
                m.SendMessage("This moongate does not seem to go anywhere.");
            }
        }
Пример #3
0
        public override void OnDoubleClick(Mobile from)
        {
            if (Boat == null || from == null)
            {
                return;
            }

            BaseBoat boat = BaseBoat.FindBoatAt(from, from.Map);

            int  range   = boat != null && boat == Boat ? 3 : 8;
            bool canMove = false;

            if (!Boat.IsRowBoat)
            {
                Boat.Refresh(from);
            }

            if (!from.InRange(Location, range))
            {
                from.SendLocalizedMessage(500295); //You are too far away to do that.
            }
            else if (!from.InLOS(Location))
            {
                from.SendLocalizedMessage(500950); //You cannot see that.
            }
            else if (Boat.IsMoving || Boat.IsTurning)
            {
                from.SendLocalizedMessage(1116611); //You can't use that while the ship is moving!
            }
            else if (BaseBoat.IsDriving(from))
            {
                from.SendLocalizedMessage(1116610); //You can't do that while piloting a ship!
            }
            else if (BaseHouse.FindHouseAt(from) != null)
            {
                from.SendLocalizedMessage(1149795); //You may not dock a ship while on another ship or inside a house.
            }
            else if (Boat == boat && !MoveToNearestDockOrLand(from))
            {
                from.SendLocalizedMessage(1149796); //You can not dock a ship this far out to sea. You must be near land or shallow water.
            }
            else if (boat == null || boat != null && Boat != boat)
            {
                if (Boat.HasAccess(from))
                {
                    canMove = true;
                }
                else
                {
                    from.SendLocalizedMessage(1116617); //You do not have permission to board this ship.
                }
            }

            if (canMove)
            {
                BaseCreature.TeleportPets(from, Location, Map);
                from.MoveToWorld(Location, Map);

                Boat.SendContainerPacket();
            }
        }
Пример #4
0
        public override void OnDoubleClick(Mobile from)
        {
            if (Boat == null)
            {
                return;
            }

            Boat.Refresh(from);

            if (BaseBoat.IsDriving(from))
            {
                from.SendLocalizedMessage(1116610); // You can't do that while piloting a ship!
                return;
            }

            if (from.InRange(GetWorldLocation(), 8))
            {
                if (Boat.Contains(from))
                {
                    if (IsOpen)
                    {
                        Close();
                    }
                    else
                    {
                        Open();
                    }
                }
                else
                {
                    if (!IsOpen)
                    {
                        if (!Locked)
                        {
                            Open();
                        }
                        else if (from.AccessLevel >= AccessLevel.GameMaster)
                        {
                            from.LocalOverheadMessage(Network.MessageType.Regular, 0x00, 502502); // That is locked but your godly powers allow access
                            Open();
                        }
                        else
                        {
                            from.LocalOverheadMessage(Network.MessageType.Regular, 0x00, 502503); // That is locked.
                        }
                    }
                    else if (!Locked)
                    {
                        Point3D p = new Point3D(X, Y, Z + 3);

                        BaseCreature.TeleportPets(from, p, Map);
                        from.Location = p;
                    }
                    else if (from.AccessLevel >= AccessLevel.GameMaster)
                    {
                        from.LocalOverheadMessage(Network.MessageType.Regular, 0x00, 502502); // That is locked but your godly powers allow access

                        Point3D p = new Point3D(X, Y, Z + 3);

                        BaseCreature.TeleportPets(from, p, Map);
                        from.Location = p;
                    }
                    else
                    {
                        from.LocalOverheadMessage(Network.MessageType.Regular, 0x00, 502503); // That is locked.
                    }
                }
            }
        }
Пример #5
0
        public override void OnDoubleClick(Mobile from)
        {
            if (m_Boat == null || from == null)
            {
                return;
            }

            BaseBoat boat = BaseBoat.FindBoatAt(from, from.Map);

            int  range   = boat != null && boat == this.Boat ? 3 : 8;
            bool canMove = false;

            if (m_Boat != null)
            {
                if (m_Boat.Owner == from && m_Boat.Status > 1043010)
                {
                    from.SendLocalizedMessage(1043294); // Your ship's age and contents have been refreshed.
                }

                m_Boat.Refresh();
            }

            if (boat != null && m_Boat != boat)
            {
                if (boat.Owner == from && boat.Status > 1043010)
                {
                    from.SendLocalizedMessage(1043294); // Your ship's age and contents have been refreshed.
                }

                boat.Refresh();
            }

            if (!from.InRange(this.Location, range))
            {
                from.SendLocalizedMessage(500295); //You are too far away to do that.
            }
            else if (!from.InLOS(this.Location))
            {
                from.SendLocalizedMessage(500950); //You cannot see that.
            }
            else if (m_Boat.IsMoving || m_Boat.IsTurning)
            {
                from.SendLocalizedMessage(1116611); //You can't use that while the ship is moving!
            }
            else if (BaseBoat.IsDriving(from))
            {
                from.SendLocalizedMessage(1116610); //You can't do that while piloting a ship!
            }
            else if (BaseHouse.FindHouseAt(from) != null)
            {
                from.SendLocalizedMessage(1149795); //You may not dock a ship while on another ship or inside a house.
            }
            else if (!m_Boat.IsClassicBoat)
            {
                if (boat == m_Boat && !MoveToNearestDockOrLand(from))
                {
                    from.SendLocalizedMessage(1149796); //You can not dock a ship this far out to sea. You must be near land or shallow water.
                }
                else if (boat == null)
                {
                    if (!from.Alive)
                    {
                        from.SendLocalizedMessage(1060190); //You cannot do that while dead!
                    }
                    else if ((m_Boat is BaseGalleon && ((BaseGalleon)m_Boat).HasAccess(from)) || (m_Boat is RowBoat && ((RowBoat)m_Boat).HasAccess(from)))
                    {
                        canMove = true;
                    }
                    else
                    {
                        from.SendLocalizedMessage(1116617); //You do not have permission to board this ship.
                    }
                }
                else if (boat != null && m_Boat != boat)
                {
                    if (!from.Alive)
                    {
                        from.SendLocalizedMessage(1060190); //You cannot do that while dead!
                    }
                    else if (m_Boat is RowBoat && ((RowBoat)m_Boat).HasAccess(from))
                    {
                        canMove = true;
                    }
                    else if (boat is RowBoat && m_Boat is BaseGalleon && ((BaseGalleon)m_Boat).HasAccess(from))
                    {
                        canMove = true;
                    }
                    else if (boat is BaseGalleon && m_Boat is BaseGalleon && ((BaseGalleon)m_Boat).HasAccess(from))
                    {
                        canMove = true;
                    }
                    else
                    {
                        from.SendLocalizedMessage(1149795); //You may not dock a ship while on another ship or inside a house.
                    }
                }
            }

            if (canMove)
            {
                BaseCreature.TeleportPets(from, this.Location, this.Map);
                from.MoveToWorld(this.Location, this.Map);

                m_Boat.SendContainerPacket();
            }
        }
Пример #6
0
 public static bool IsDriving(Mobile from)
 {
     return(BaseBoat.IsDriving(from));
 }