Example #1
0
 public void Effect(BaseGalleon galleon)
 {
     if (galleon == null)
     {
         Caster.SendLocalizedMessage(1116767); // The ship could not be located.
     }
     else if (galleon.Map == Map.Internal)
     {
         Caster.SendLocalizedMessage(1149569); // That ship is in dry dock.
     }
     else if (!galleon.HasAccess(Caster))
     {
         Caster.SendLocalizedMessage(1116617); // You do not have permission to board this ship.
     }
     else
     {
         Effect(galleon.GetMarkedLocation(), galleon.Map, false, true);
     }
 }
Example #2
0
            protected override void OnTarget(Mobile from, object o)
            {
                if (o is RecallRune)
                {
                    RecallRune rune = (RecallRune)o;

                    if (rune.Marked)
                    {
                        m_Owner.Effect(rune.Target, rune.TargetMap, true);
                    }
                    else
                    {
                        from.SendLocalizedMessage(501805); // That rune is not yet marked.
                    }
                }
                else if (o is Runebook)
                {
                    RunebookEntry e = ((Runebook)o).Default;

                    if (e != null)
                    {
                        m_Owner.Effect(e.Location, e.Map, true);
                    }
                    else
                    {
                        from.SendLocalizedMessage(502354); // Target is not marked.
                    }
                }
                else if (o is Key && ((Key)o).KeyValue != 0 && ((Key)o).Link is BaseBoat)
                {
                    BaseBoat boat = ((Key)o).Link as BaseBoat;

                    if (!boat.Deleted && boat.CheckKey(((Key)o).KeyValue))
                    {
                        m_Owner.Effect(boat.GetMarkedLocation(), boat.Map, false, true);
                    }
                    else
                    {
                        from.Send(new MessageLocalized(from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 502357, from.Name, "")); // I can not recall from that object.
                    }
                }

                #region High Seas
                else if (o is ShipRune && ((ShipRune)o).Galleon != null)
                {
                    BaseGalleon galleon = ((ShipRune)o).Galleon;

                    if (!galleon.Deleted && galleon.Map != null && galleon.Map != Map.Internal && galleon.HasAccess(from))
                    {
                        m_Owner.Effect(galleon.GetMarkedLocation(), galleon.Map, false, true);
                    }
                    else
                    {
                        from.Send(new MessageLocalized(from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 502357, from.Name, "")); // I can not recall from that object.
                    }
                }
                #endregion

                #region New Magincia
                else if (o is Server.Engines.NewMagincia.WritOfLease)
                {
                    Server.Engines.NewMagincia.WritOfLease lease = (Server.Engines.NewMagincia.WritOfLease)o;

                    if (lease.RecallLoc != Point3D.Zero && lease.Facet != null && lease.Facet != Map.Internal)
                    {
                        m_Owner.Effect(lease.RecallLoc, lease.Facet, false);
                    }
                    else
                    {
                        from.Send(new MessageLocalized(from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 502357, from.Name, "")); // I can not recall from that object.
                    }
                }
                #endregion

                else
                {
                    from.Send(new MessageLocalized(from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 502357, from.Name, "")); // I can not recall from that object.
                }
            }