Beispiel #1
0
        public override void OnLocationChanged(Mobile m, Point3D oldLocation)
        {
            if (m_Recursion)
            {
                return;
            }

            m_Recursion = true;

            if ((m_House.Public || !Core.AOS) && m_House.IsBanned(m) && m_House.IsInside(m))
            {
                m.Location = m_House.BanLocation;
                m.SendLocalizedMessage(501284);                   // You may not enter.
            }
            else if (Core.AOS && !m_House.Public && !m_House.HasAccess(m) && m_House.IsInside(m))
            {
                m.Location = m_House.BanLocation;
                m.SendLocalizedMessage(501284);                   // You may not enter.
            }

            m_Recursion = false;
        }
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted == m_Decorator)
                {
                    m_Decorator.Command = DecorateCommand.None;
                    from.SendGump(new InternalGump(m_Decorator));
                }
                else if (targeted is Item && InteriorDecorator.CheckUse(m_Decorator, from))
                {
                    BaseHouse       house       = BaseHouse.FindHouseAt(from);
                    StaticHouseSign staticHouse = StaticHouseSign.StaticFindHouseAt(from);
                    Item            item        = (Item)targeted;

                    if (house == null && staticHouse == null)
                    {
                        from.SendLocalizedMessage(502092);                           // You must be in your house to do this.
                    }
                    else if (staticHouse == null)
                    {
                        if (!house.IsCoOwner(from))
                        {
                            from.SendLocalizedMessage(502092);                               // You must be in your house to do this.
                        }
                        else if (item.Parent != null || !house.IsInside(item))
                        {
                            from.SendLocalizedMessage(1042270);                               // That is not in your house.
                        }
                        else if (!house.IsLockedDown(item) && !house.IsSecure(item))
                        {
                            from.SendLocalizedMessage(1042271);                               // That is not locked down.
                        }
                        else if (item is VendorRentalContract)
                        {
                            from.SendLocalizedMessage(1062491);                               // You cannot use the house decorator on that object.
                        }
                        else if (item.TotalWeight + item.PileWeight > 100)
                        {
                            from.SendLocalizedMessage(1042272);                               // That is too heavy.
                        }
                        else
                        {
                            switch (m_Decorator.Command)
                            {
                            case DecorateCommand.Up:        Up(item, from);       break;

                            case DecorateCommand.Down:      Down(item, from);     break;

                            case DecorateCommand.Turn:      Turn(item, from);     break;
                            }
                        }
                    }
                    else
                    {
                        if (!staticHouse.IsCoOwner(from))
                        {
                            from.SendLocalizedMessage(502092);                               // You must be in your house to do this.
                        }
                        else if (item.Parent != null || !staticHouse.IsInside(item))
                        {
                            from.SendLocalizedMessage(1042270);                               // That is not in your house.
                        }
                        else if (!staticHouse.checkLockedDown(item) && !staticHouse.CheckSecure(item))
                        {
                            from.SendLocalizedMessage(1042271);                               // That is not locked down.
                        }
                        else if (item.TotalWeight + item.PileWeight > 100)
                        {
                            from.SendLocalizedMessage(1042272);                               // That is too heavy.
                        }
                        else
                        {
                            switch (m_Decorator.Command)
                            {
                            case DecorateCommand.Up:        Up(item, from);       break;

                            case DecorateCommand.Down:      Down(item, from);     break;

                            case DecorateCommand.Turn:      Turn(item, from);     break;
                            }
                        }
                    }
                }
            }