Exemple #1
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                ObsidianStatue targ = targeted as ObsidianStatue;

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

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

                        if (targObsidian.Quantity >= ObsidianStatue.Completed)
                        {
                            targObsidian.StatueName = Utility.Random(m_Names.Length);
                        }

                        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.
            }
Exemple #2
0
            public override void OnClick()
            {
                Mobile from = Owner.From;

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

                    m_Obsidian.Quantity = 1;
                }
            }