Beispiel #1
0
        public override bool OnDoubleClick(Mobile from, object o)
        {
            if (o is Container)
            {
                Container c = (Container)o;

                if (m_House.CheckSecure(c))
                {
                    m_House.ReleaseSecure(m_House.Owner, c);
                    m_House.SetLockdown(c, true);
                }

                /*SecureStaticAccessResult res = m_House.CheckSecureAccess( from, c );
                 *
                 * switch ( res )
                 * {
                 *      case SecureStaticAccessResult.Insecure: break;
                 *      case SecureStaticAccessResult.Accessible: return true;
                 *      case SecureStaticAccessResult.Inaccessible: c.SendLocalizedMessageTo( from, 1010563 ); return false;
                 * }*/
            }

            return(true);
        }
            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;
                            }
                        }
                    }
                }
            }