Example #1
0
        public override void OnDoubleClick(Mobile from)
        {
            int number;

            BankBox          box  = from.FindBankNoCreate();
            CommodityDeedBox cox  = CommodityDeedBox.Find(this);
            GalleonHold      hold = RootParent as GalleonHold;

            // Veteran Rewards mods
            if (m_Commodity != null)
            {
                if (box != null && IsChildOf(box))
                {
                    number = 1047031; // The commodity has been redeemed.

                    box.DropItem(m_Commodity);

                    m_Commodity = null;
                    Delete();
                }
                else if (cox != null)
                {
                    if (cox.IsSecure)
                    {
                        number = 1047031; // The commodity has been redeemed.

                        cox.DropItem(m_Commodity);

                        m_Commodity = null;
                        Delete();
                    }
                    else
                    {
                        number = 1080525; // The commodity deed box must be secured before you can use it.
                    }
                }
                else if (hold != null)
                {
                    number = 1047031; // The commodity has been redeemed.

                    hold.DropItem(m_Commodity);
                    m_Commodity = null;

                    Delete();
                }
                else
                {
                    if (Core.ML)
                    {
                        number = 1080526; // That must be in your bank box or commodity deed box to use it.
                    }
                    else
                    {
                        number = 1047024; // To claim the resources ....
                    }
                }
            }
            else if (cox != null && !cox.IsSecure)
            {
                number = 1080525; // The commodity deed box must be secured before you can use it.
            }
            else if ((box == null || !IsChildOf(box)) && cox == null && hold == null)
            {
                if (Core.ML)
                {
                    number = 1080526; // That must be in your bank box or commodity deed box to use it.
                }
                else
                {
                    number = 1047026; // That must be in your bank box to use it.
                }
            }
            else
            {
                number = 1047029; // Target the commodity to fill this deed with.

                from.Target = new InternalTarget(this);
            }

            from.SendLocalizedMessage(number);
        }