Пример #1
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                Item targ = targeted as Item;

                if (m_Obsidian.Deleted || m_Obsidian.Quantity >= Obsidian.m_Completed || targ == null)
                {
                    return;
                }

                if (m_Obsidian.IsChildOf(from.Backpack) && targ.IsChildOf(from.Backpack) && targ is Obsidian && targ != m_Obsidian)
                {
                    Obsidian targObsidian = (Obsidian)targ;
                    if (targObsidian.Quantity < Obsidian.m_Completed)
                    {
                        if (targObsidian.Quantity + m_Obsidian.Quantity <= Obsidian.m_Completed)
                        {
                            targObsidian.Quantity += m_Obsidian.Quantity;
                            m_Obsidian.Delete();
                        }
                        else
                        {
                            int delta = Obsidian.m_Completed - targObsidian.Quantity;
                            targObsidian.Quantity += delta;
                            m_Obsidian.Quantity   -= delta;
                        }

                        if (targObsidian.Quantity >= Obsidian.m_Completed)
                        {
                            targObsidian.StatueName = Obsidian.RandomName(from);
                        }

                        from.Send(new AsciiMessage(targObsidian.Serial, targObsidian.ItemID, MessageType.Regular, 0x59, 3, m_Obsidian.Name, "Something Happened."));

                        return;
                    }
                }

                from.Send(new MessageLocalized(m_Obsidian.Serial, m_Obsidian.ItemID, MessageType.Regular, 0x2C, 3, 500309, m_Obsidian.Name, "")); // Nothing Happens.
            }
Пример #2
0
            public override void OnClick()
            {
                Mobile from = Owner.From;

                if (!m_Obsidian.Deleted && m_Obsidian.Quantity >= Obsidian.m_Partial && m_Obsidian.Quantity < Obsidian.m_Completed && m_Obsidian.IsChildOf(from.Backpack) && from.CheckAlive())
                {
                    for (int i = 0; i < m_Obsidian.Quantity - 1; i++)
                    {
                        from.AddToBackpack(new Obsidian());
                    }

                    m_Obsidian.Quantity = 1;
                }
            }