Server.Items.NewHousePlacementTarget.OnTarget C# (CSharp) Méthode

OnTarget() protected méthode

protected OnTarget ( Mobile from, object o ) : void
from Mobile
o object
Résultat void
        protected override void OnTarget( Mobile from, object o )
        {
            if ( !from.CheckAlive() || from.Backpack == null || from.Backpack.FindItemByType( typeof( HousePlacementTool ) ) == null  )
                return;

            IPoint3D ip = o as IPoint3D;

            if ( ip != null )
            {
                if ( ip is Item )
                    ip = ((Item)ip).GetWorldTop();

                Point3D p = new Point3D( ip );

                Region reg = Region.Find( new Point3D( p ), from.Map );

                if ( from.AccessLevel >= AccessLevel.GameMaster || reg.AllowHousing( from, p ) )
                    m_Placed = m_Entry.OnPlacement( from, p );
                else if ( reg.IsPartOf( typeof( TreasureRegion ) ) )
                    from.SendLocalizedMessage( 1043287 ); // The house could not be created here.  Either something is blocking the house, or the house would not be on valid terrain.
                else if ( reg.IsPartOf( typeof( HouseRaffleRegion ) ) )
                    from.SendLocalizedMessage( 1150493 ); // You must have a deed for this plot of land in order to build here.
                else
                    from.SendLocalizedMessage( 501265 ); // Housing can not be created in this area.
            }
        }