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;
BaseBoat boat = Boat;
if ( boat == null )
return;
p = new Point3D( p.X - m_Offset.X, p.Y - m_Offset.Y, p.Z - m_Offset.Z );
if ( BaseBoat.IsValidLocation( p ) && boat.CanFit( p, map, boat.ItemID ) )
{
Delete();
boat.Owner = from;
boat.Anchored = true;
boat.ShipName = m_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 );
}
else
{
boat.Delete();
from.SendLocalizedMessage( 1043284 ); // A ship can not be created here.
}
}
}