コード例 #1
0
        public VendorRentalRefundGump(RentedVendor vendor, Mobile landlord, int refundAmount) : base(50, 50)
        {
            m_Vendor       = vendor;
            m_Landlord     = landlord;
            m_RefundAmount = refundAmount;

            AddBackground(0, 0, 420, 320, 0x13BE);

            AddImageTiled(10, 10, 400, 300, 0xA40);
            AddAlphaRegion(10, 10, 400, 300);

            /* The landlord for this vendor is offering you a partial refund of your rental fee
             * in exchange for immediate termination of your rental contract.<BR><BR>
             *
             * If you accept this offer, the vendor will be immediately dismissed.  You will then
             * be able to claim the inventory and any funds the vendor may be holding for you via
             * a context menu on the house sign for this house.
             */
            AddHtmlLocalized(10, 10, 400, 150, 1062501, 0x7FFF, false, true);

            AddHtmlLocalized(10, 180, 150, 20, 1062508, 0x7FFF, false, false);               // Vendor Name:
            AddLabel(160, 180, 0x480, vendor.Name);

            AddHtmlLocalized(10, 200, 150, 20, 1062509, 0x7FFF, false, false);               // Shop Name:
            AddLabel(160, 200, 0x480, vendor.ShopName);

            AddHtmlLocalized(10, 220, 150, 20, 1062510, 0x7FFF, false, false);               // Refund Amount:
            AddLabel(160, 220, 0x480, refundAmount.ToString());

            AddButton(10, 268, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0);
            AddHtmlLocalized(45, 268, 350, 20, 1062511, 0x7FFF, false, false);               // Agree, and <strong>dismiss vendor</strong>

            AddButton(10, 288, 0xFA5, 0xFA7, 0, GumpButtonType.Reply, 0);
            AddHtmlLocalized(45, 288, 350, 20, 1062512, 0x7FFF, false, false);               // No, I want to <strong>keep my vendor</strong>
        }
コード例 #2
0
 public LandlordVendorRentalGump(RentedVendor vendor)
     : base(
         GumpType.VendorLandlord, vendor.RentalDuration, vendor.RentalPrice, vendor.RenewalPrice,
         vendor.Landlord, vendor.Owner, vendor.LandlordRenew, vendor.RenterRenew, vendor.Renew)
 {
     m_Vendor = vendor;
 }
コード例 #3
0
        public VendorRentalRefundGump(RentedVendor vendor, Mobile landlord, int refundAmount) : base(50, 50)
        {
            m_Vendor       = vendor;
            m_Landlord     = landlord;
            m_RefundAmount = refundAmount;

            AddBackground(0, 0, 420, 320, 0x13BE);

            AddImageTiled(10, 10, 400, 300, 0xA40);
            AddAlphaRegion(10, 10, 400, 300);

            /* The landlord for this vendor is offering you a partial refund of your rental fee
             * in exchange for immediate termination of your rental contract.<BR><BR>
             *
             * If you accept this offer, the vendor will be immediately dismissed.  Any items still on the vendor
             * will drop to the ground, any funds the vendor is holding for you shall be deposited into your bank account.
             */

            AddHtml(10, 10, 400, 150, "The landlord for this vendor is offering you a partial refund of your rental fee in exchange for immediate termination of your rental contract. If you accept this offer, the vendor will be immediately dismissed. Any items still on the vendor will drop to the ground, any funds the vendor is holding for you shall be deposited into your bank account.", false, true);

            AddHtmlLocalized(10, 180, 150, 20, 1062508, 0x7FFF, false, false);               // Vendor Name:
            AddLabel(160, 180, 0x480, vendor.Name);

            AddHtmlLocalized(10, 220, 150, 20, 1062510, 0x7FFF, false, false);               // Refund Amount:
            AddLabel(160, 220, 0x480, refundAmount.ToString());

            AddButton(10, 268, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0);
            AddHtmlLocalized(45, 268, 350, 20, 1062511, 0x7FFF, false, false);               // Agree, and <strong>dismiss vendor</strong>

            AddButton(10, 288, 0xFA5, 0xFA7, 0, GumpButtonType.Reply, 0);
            AddHtmlLocalized(45, 288, 350, 20, 1062512, 0x7FFF, false, false);               // No, I want to <strong>keep my vendor</strong>
        }
コード例 #4
0
        protected override void AcceptOffer(Mobile from)
        {
            m_Contract.Offeree = null;

            if (!m_Contract.Map.CanFit(m_Contract.Location, 16, false, false))
            {
                m_Landlord.SendLocalizedMessage(1062486);                   // A vendor cannot exist at that location.  Please try again.
                return;
            }

            BaseHouse house = BaseHouse.FindHouseAt(m_Contract);

            if (house == null)
            {
                return;
            }

            int price = m_Contract.Price;
            int goldToGive;

            if (price > 0)
            {
                if (Banker.Withdraw(from, price))
                {
                    from.SendLocalizedMessage(1060398, price.ToString());                       // ~1_AMOUNT~ gold has been withdrawn from your bank box.

                    int depositedGold = Banker.DepositUpTo(m_Landlord, price);
                    goldToGive = price - depositedGold;

                    if (depositedGold > 0)
                    {
                        m_Landlord.SendLocalizedMessage(1060397, price.ToString());                           // ~1_AMOUNT~ gold has been deposited into your bank box.
                    }
                    if (goldToGive > 0)
                    {
                        m_Landlord.SendLocalizedMessage(500390);                           // Your bank box is full.
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1062378);                       // You do not have enough gold in your bank account to cover the cost of the contract.
                    m_Landlord.SendLocalizedMessage(1062374, from.Name);      // ~1_NAME~ has declined your vendor rental offer.

                    return;
                }
            }
            else
            {
                goldToGive = 0;
            }

            PlayerVendor vendor = new RentedVendor(from, house, m_Contract.Duration, price, m_Contract.LandlordRenew, goldToGive);

            vendor.MoveToWorld(m_Contract.Location, m_Contract.Map);

            m_Contract.Delete();

            from.SendLocalizedMessage(1062377);                  // You have accepted the offer and now own a vendor in this house.  Rental contract options and details may be viewed on this vendor via the 'Contract Options' context menu.
            m_Landlord.SendLocalizedMessage(1062376, from.Name); // ~1_NAME~ has accepted your vendor rental offer.  Rental contract details and options may be viewed on this vendor via the 'Contract Options' context menu.
        }
コード例 #5
0
 public override void OnDoubleClick(Mobile from)
 {
     if (!IsChildOf(from.Backpack))
     {
         from.SendLocalizedMessage(1042001);                   // That must be in your pack for you to use it.
     }
     else
     {
         BaseHouse building = BaseHouse.FindHouseAt(from);
         if (building == m_house && this.Owner == from)
         {
             VendorRentalDuration m_Expire;
             m_Expire = VendorRentalDuration.Instances[(int)m_duration];
             PlayerVendor vendor = new RentedVendor(m_owner, m_house, m_Expire, m_rent, true, m_rent);
             vendor.MoveToWorld(from.Location, from.Map);
             this.Delete();
         }
         else
         {
             from.SendMessage("You may only use this in a vendor mall you have paid for a slot in!");
         }
     }
 }
コード例 #6
0
 public ContractRenewalPricePrompt(RentedVendor vendor)
 {
     m_Vendor = vendor;
 }
コード例 #7
0
 public RentalExpireTimer(RentedVendor vendor, TimeSpan delay) : base(delay, vendor.RentalDuration.Duration)
 {
     m_Vendor = vendor;
 }
コード例 #8
0
 public RefundOfferPrompt(RentedVendor vendor) => m_Vendor = vendor;
コード例 #9
0
 public TerminateContractEntry(RentedVendor vendor) : base(6218) => m_Vendor = vendor;
コード例 #10
0
 public CollectRentEntry(RentedVendor vendor) : base(6212) => m_Vendor = vendor;
コード例 #11
0
 public ContractOptionsEntry(RentedVendor vendor) : base(6209) => m_Vendor = vendor;
コード例 #12
0
        protected override void AcceptOffer(Mobile from)
        {
            m_Contract.Offeree = null;

            if (!m_Contract.Map.CanFit(m_Contract.Location, 16, false, false))
            {
                m_Landlord.SendLocalizedMessage(1062486);                 // A vendor cannot exist at that location.  Please try again.
                return;
            }

            BaseHouse house = BaseHouse.FindHouseAt(m_Contract);

            if (house == null)
            {
                return;
            }

            int price = m_Contract.Price;
            int currencyToGive;

            if (price > 0)
            {
                Type cType = m_Contract.Expansion == Expansion.T2A ? typeof(Silver) : typeof(Gold);

                if (Banker.Withdraw(from, cType, price))
                {
                    from.SendMessage("{0:#,0} {1} has been withdrawn from your bank box.", price, cType.Name);

                    int depositedCurrency = Banker.DepositUpTo(m_Landlord, cType, price);
                    currencyToGive = price - depositedCurrency;

                    if (depositedCurrency > 0)
                    {
                        m_Landlord.SendMessage("{0:#,0} {1} has been deposited into your bank box.", price, cType.Name);
                    }

                    if (currencyToGive > 0)
                    {
                        m_Landlord.SendLocalizedMessage(500390);                         // Your bank box is full.
                    }
                }
                else
                {
                    from.SendMessage("You do not have enough {0} in your bank account to cover the cost of the contract.", cType.Name);

                    m_Landlord.SendLocalizedMessage(1062374, from.Name);                     // ~1_NAME~ has declined your vendor rental offer.

                    return;
                }
            }
            else
            {
                currencyToGive = 0;
            }

            PlayerVendor vendor = new RentedVendor(
                from, house, m_Contract.Duration, price, m_Contract.LandlordRenew, currencyToGive);

            vendor.MoveToWorld(m_Contract.Location, m_Contract.Map);

            m_Contract.Delete();

            // You have accepted the offer and now own a vendor in this house.  Rental contract options and details may be viewed on this vendor via the 'Contract Options' context menu.
            from.SendLocalizedMessage(1062377);

            // ~1_NAME~ has accepted your vendor rental offer.  Rental contract details and options may be viewed on this vendor via the 'Contract Options' context menu.
            m_Landlord.SendLocalizedMessage(1062376, from.Name);
        }