Ejemplo n.º 1
0
        public void OnPlacement(Mobile from, Point3D p)
        {
            if (Deleted)
            {
                return;
            }
            else if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042001);                 // That must be in your pack for you to use it.
            }
            else
            {
                Map map = from.Map;

                if (map == null)
                {
                    return;
                }

                NewBaseBoat boat = Boat;

                if (boat == null)
                {
                    return;
                }

                p = new Point3D(p.X - Offset.X, p.Y - Offset.Y, p.Z - Offset.Z);

                if (boat.CanFit(p, map, boat.ItemID) && map != Map.Ilshenar && map != Map.Malas)
                {
                    Delete();

                    boat.Owner    = from;
                    boat.Anchored = false;
                    boat.ShipName = ShipName;

                    uint keyValue = boat.CreateKeys(from);

                    if (boat.PPlank != null)
                    {
                        boat.PPlank.KeyValue = keyValue;
                    }
                    if (boat.SPlank != null)
                    {
                        boat.SPlank.KeyValue = keyValue;
                    }

                    boat.MoveToWorld(p, map);

                    boat.SetFacing(_chosenDirection);
                }
                else
                {
                    boat.Delete();
                    from.SendLocalizedMessage(1043284);                     // A ship can not be created here.
                }
            }
        }
Ejemplo n.º 2
0
            protected override void OnTick()
            {
                if (_count == 5)
                {
                    _boat.Delete();
                    Stop();
                }
                else
                {
                    _boat.Location = new Point3D(_boat.X, _boat.Y, _boat.Z - 1);

                    if (_boat.TillerMan != null)
                    {
                        _boat.TillerMan.Say(1007168 + _count);
                    }

                    ++_count;
                }
            }