OnPlacement() public méthode

public OnPlacement ( Server.Mobile from, Server.Point3D p ) : void
from Server.Mobile
p Server.Point3D
Résultat void
Exemple #1
0
        protected override void OnTarget(Mobile from, object o)
        {
            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_Deed.OnPlacement(from, p);
                }
                else if (reg.IsPartOf(typeof(TempNoHousingRegion)))
                {
                    from.SendLocalizedMessage(501270);                       // Lord British has decreed a 'no build' period, thus you cannot build this house at this time.
                }
                else if (reg.IsPartOf(typeof(TreasureRegion)) || reg.IsPartOf(typeof(HouseRegion)))
                {
                    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
                {
                    from.SendLocalizedMessage(501265);                       // Housing can not be created in this area.
                }
            }
        }
Exemple #2
0
        protected override void OnTarget(Mobile from, object o)
        {
            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_Deed.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.
                }
            }
        }
Exemple #3
0
        protected override void OnTarget(Mobile from, object o)
        {
            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_Deed.OnPlacement(from, p);
                }
                else
                {
                    from.SendLocalizedMessage(501265);                       // Housing can not be created in this area.
                }
            }
        }
Exemple #4
0
        protected override void OnTarget(Mobile from, object o)
        {
            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_Deed.OnPlacement(from, p);
                }
                else if (reg is TreasureRegion)
                {
                    from.SendAsciiMessage("The house could not be created here. Either something is blocking the house, or the house would not be on valid terrain.");
                }
                else
                {
                    from.SendAsciiMessage("Housing can not be created in this area.");
                }
            }
        }
Exemple #5
0
        protected override void OnTarget(Mobile from, object o)
        {
            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_Deed.OnPlacement(from, p);
                }
                else if (reg.IsPartOf(typeof(TempNoHousingRegion)))
                {
                    from.SendLocalizedMessage(501270);                       // Lord British has decreed a 'no build' period, thus you cannot build this house at this time.
                }
                else if (reg.IsPartOf(typeof(TreasureRegion)) || reg.IsPartOf(typeof(HouseRegion)))
                {
                    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
                {
                    from.SendLocalizedMessage(501265);                       // Housing can not be created in this area.
                }
                if (HouseSystemController._MaxPlaceDelay > 0)
                {
                    from.BeginAction(typeof(HouseDeed));
                    Timer.DelayCall <Mobile>(TimeSpan.FromSeconds(Utility.RandomMinMax(HouseSystemController._MinPlaceDelay, HouseSystemController._MaxPlaceDelay)), new TimerStateCallback <Mobile>(ReleasePlacementLock), from);
                }
                from.RevealingAction();
            }
        }