Ejemplo n.º 1
0
        public override void OnDoubleClick(Mobile from)
        {
            int number;

            BankBox          box = from.FindBankNoCreate();
            CommodityDeedBox cox = CommodityDeedBox.Find(this);

            // 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.
                        m_Commodity.InstanceID = cox.InstanceID;
                        cox.DropItem(m_Commodity);

                        m_Commodity = null;
                        Delete();
                    }
                    else
                    {
                        number = 1080525;                         // The commodity deed box must be secured before you can use it.
                    }
                }
                else
                {
                    number = 1080526;                     // That must be in your bank box or commodity deed box to use it.
                }
            }
            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)
            {
                number = 1080526;                 // That must be in your bank box or commodity deed box to use it.
            }
            else
            {
                number = 1047029;                 // Target the commodity to fill this deed with.

                from.Target = new InternalTarget(this);
            }

            from.SendLocalizedMessage(number);
        }
Ejemplo n.º 2
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Deed.Deleted)
                {
                    return;
                }

                int number;

                if (m_Deed.Commodity != null)
                {
                    number = 1047028;                     // The commodity deed has already been filled.
                }
                else if (targeted is Item)
                {
                    Item targetedItem = (Item)targeted;
                    if (targetedItem.Association > 0)
                    {
                        from.SendLocalizedMessage(1047027);  // That is not a commodity the bankers will fill a commodity deed with.
                        return;
                    }
                    BankBox          box = from.FindBankNoCreate();
                    CommodityDeedBox cox = CommodityDeedBox.Find(m_Deed);

                    // Veteran Rewards mods
                    if (box != null && m_Deed.IsChildOf(box) && ((Item)targeted).IsChildOf(box) ||
                        cox != null && cox.IsSecure && ((Item)targeted).IsChildOf(cox))
                    {
                        if (m_Deed.SetCommodity((Item)targeted))
                        {
                            m_Deed.Hue = 0x47;
                            number     = 1047030;                         // The commodity deed has been filled.
                        }
                        else
                        {
                            number = 1047027;                             // That is not a commodity the bankers will fill a commodity deed with.
                        }
                    }
                    else
                    {
                        if (m_Deed.EraML)
                        {
                            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 = 1047027;                     // That is not a commodity the bankers will fill a commodity deed with.
                }

                from.SendLocalizedMessage(number);
            }
Ejemplo n.º 3
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (this.m_Deed.Deleted)
                {
                    return;
                }

                int number;

                if (this.m_Deed.Commodity != null)
                {
                    number = 1047028; // The commodity deed has already been filled.
                }
                else if (targeted is Item)
                {
                    BankBox          box  = from.FindBankNoCreate();
                    CommodityDeedBox cox  = CommodityDeedBox.Find(this.m_Deed);
                    GalleonHold      hold = ((Item)targeted).RootParent as GalleonHold;

                    // Veteran Rewards mods
                    if (box != null && this.m_Deed.IsChildOf(box) && ((Item)targeted).IsChildOf(box) ||
                        (cox != null && cox.IsSecure && ((Item)targeted).IsChildOf(cox)) ||
                        hold != null)
                    {
                        if (this.m_Deed.SetCommodity((Item)targeted))
                        {
                            this.m_Deed.Hue = 0x592;
                            number          = 1047030; // The commodity deed has been filled.
                        }
                        else
                        {
                            number = 1047027; // That is not a commodity the bankers will fill a commodity deed with.
                        }
                    }
                    else
                    {
                        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 = 1047027; // That is not a commodity the bankers will fill a commodity deed with.
                }

                from.SendLocalizedMessage(number);
            }
Ejemplo n.º 4
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Deed.Deleted)
                {
                    return;
                }

                int number;

                if (m_Deed.Commodity != null)
                {
                    number = 1047028; // The commodity deed has already been filled.
                }
                else if (targeted is Item item)
                {
                    var box = from.FindBankNoCreate();
                    var cox = CommodityDeedBox.Find(m_Deed);

                    // Veteran Rewards mods
                    if (box != null && m_Deed.IsChildOf(box) && item.IsChildOf(box) ||
                        cox?.IsSecure != true && item.IsChildOf(cox))
                    {
                        if (m_Deed.SetCommodity(item))
                        {
                            m_Deed.Hue = 0x592;
                            number     = 1047030; // The commodity deed has been filled.
                        }
                        else
                        {
                            number = 1047027; // That is not a commodity the bankers will fill a commodity deed with.
                        }
                    }
                    else 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 = 1047027; // That is not a commodity the bankers will fill a commodity deed with.
                }

                from.SendLocalizedMessage(number);
            }
Ejemplo n.º 5
0
        public override void OnDoubleClick(Mobile from)
        {
            int number;

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

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

                    box.DropItem(this.m_Commodity);

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

                        cox.DropItem(this.m_Commodity);

                        this.m_Commodity = null;
                        this.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 || !this.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);
        }