public override void OnDoubleClick(Mobile from) { from.RevealingAction(); BaseBoat boat = BaseBoat.FindBoatAt(from, from.Map); Item mount = from.FindItemOnLayer(Layer.Mount); if (boat == null || Galleon == null || boat != Galleon) { from.SendLocalizedMessage(1116724); // You cannot pilot a ship unless you are aboard it! } else if (Galleon.GetSecurityLevel(from) < SecurityLevel.Crewman) { from.SendLocalizedMessage(1116726); // This is not your ship! } else if (Pilot != null && Pilot != from && (Galleon.GetSecurityLevel(from) < Galleon.GetSecurityLevel(Pilot) || Pilot == Galleon.Owner)) { from.SendLocalizedMessage(502221); // Someone else is already using this item. } else if (from.Flying) { from.SendLocalizedMessage(1116615); // You cannot pilot a ship while flying! } else if (from.Mounted && !(mount is BoatMountItem)) { from.SendLocalizedMessage(1010097); // You cannot use this while mounted or flying. } else if (Pilot == null && Galleon.Scuttled) { from.SendLocalizedMessage(1116725); // This ship is too damaged to sail! } else if (Pilot != null) { if (from != Pilot) // High authorized player takes control of the ship { boat.RemovePilot(from); boat.LockPilot(from); } else { boat.RemovePilot(from); } } else { boat.LockPilot(from); } }
public override void OnDoubleClick(Mobile from) { from.RevealingAction(); BaseBoat boat = BaseBoat.FindBoatAt(from, from.Map); Item mount = from.FindItemOnLayer(Layer.Mount); if (boat != null && Pilot == from) { boat.RemovePilot(from); } else if (!from.InRange(this.Location, 3)) { from.SendLocalizedMessage(500295); //You are too far away to do that. } else if (boat == null && boat != m_Galleon) { from.SendLocalizedMessage(1116724); //You cannot pilot a ship unless you are aboard it! } else if (m_Galleon.GetSecurityLevel(from) < SecurityLevel.Crewman) { from.SendLocalizedMessage(1116726); //This is not your ship! } else if (Pilot != null && Pilot != from) { from.SendLocalizedMessage(502221); // Someone else is already using this item. } else if (from.Flying) { from.SendLocalizedMessage(1116615); // You cannot pilot a ship while flying! } else if (from.Mounted && !(mount is BoatMountItem)) { from.SendLocalizedMessage(1010097); //You cannot use this while mounted or flying. } else if (Pilot == null && m_Galleon.Scuttled) { from.SendLocalizedMessage(1116725); //This ship is too damaged to sail! } else { boat.LockPilot(from); } }
public override void OnDoubleClick(Mobile from) { BaseBoat boat = BaseBoat.FindBoatAt(from, from.Map); Item mount = from.FindItemOnLayer(Layer.Mount); if (!from.InRange(Location, 3)) { from.SendLocalizedMessage(500295); //You are too far away to do that. } else if (boat == null || Boat != boat || Boat == null) { from.SendLocalizedMessage(1116724); //You cannot pilot a ship unless you are aboard it! } else if (boat.Owner != from) { from.SendLocalizedMessage(1116726); //This is not your ship! } else if (from.Flying) { from.SendLocalizedMessage(1116615); // You cannot pilot a ship while flying! } else if (from.Mounted && !(mount is BoatMountItem)) { from.SendLocalizedMessage(1010097); //You cannot use this while mounted or flying. } else if (from != Pilot && Pilot != null && Pilot == Boat.Owner) { from.SendMessage("Someone is already piloting this vessle!"); } else if (Pilot == null && Boat.Scuttled) { from.SendLocalizedMessage(1116725); //This ship is too damaged to sail! } else if (Pilot != null) { boat.RemovePilot(from); } else { boat.LockPilot(from); } }