Exemple #1
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is BulkOrderBook)
                {
                    Item book = (Item)targeted;

                    if (book.Hue == m_Cover.Hue)
                    {
                        from.SendLocalizedMessage(1071122);                           // You cannot cover it with same color.
                    }
                    else
                    {
                        book.Hue = m_Cover.Hue;

                        from.SendLocalizedMessage(1071119);                           // You have successfully given the bulk order book a new cover.
                        m_Cover.UsesRemaining -= 1;
                        m_Cover.InvalidateProperties();

                        if (m_Cover.UsesRemaining <= 0)
                        {
                            from.SendLocalizedMessage(1071120);                               // You have used up all the bulk order book covers.
                            m_Cover.Delete();
                        }
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1071118);                       // You can only cover a bulk order book with this item.
                }
            }