Ejemplo n.º 1
0
            public override void OnResponse(Mobile from, string text)
            {
                if (!m_Vendor.CanInteractWith(from, false) || !m_Vendor.IsLandlord(from))
                {
                    return;
                }

                text = text.Trim();

                int price;

                if (!int.TryParse(text, out price))
                {
                    price = -1;
                }

                if (price < 0)
                {
                    from.SendLocalizedMessage(1062485); // Invalid entry.  Rental fee set to 0.
                    m_Vendor.RenewalPrice = 0;
                }
                else if (price > 5000000)
                {
                    m_Vendor.RenewalPrice = 5000000;
                }
                else
                {
                    m_Vendor.RenewalPrice = price;
                }

                m_Vendor.RenterRenew = false;

                from.SendGump(new LandlordVendorRentalGump(m_Vendor));
            }
Ejemplo n.º 2
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            var from = sender.Mobile;

            if (!m_Vendor.CanInteractWith(from, true) || !m_Vendor.CanInteractWith(m_Landlord, false) ||
                !m_Vendor.IsLandlord(m_Landlord))
            {
                return;
            }

            if (info.ButtonID == 1)
            {
                if (Banker.Withdraw(m_Landlord, m_RefundAmount))
                {
                    m_Landlord.SendLocalizedMessage(
                        1060398,
                        m_RefundAmount.ToString()
                        ); // ~1_AMOUNT~ gold has been withdrawn from your bank box.

                    var depositedGold = Banker.DepositUpTo(from, m_RefundAmount);

                    if (depositedGold > 0)
                    {
                        from.SendLocalizedMessage(
                            1060397,
                            depositedGold.ToString()
                            ); // ~1_AMOUNT~ gold has been deposited into your bank box.
                    }

                    m_Vendor.HoldGold += m_RefundAmount - depositedGold;

                    m_Vendor.Destroy(false);

                    from.SendLocalizedMessage(1071990); // Remember to claim your vendor's belongings from the house sign!
                }
                else
                {
                    m_Landlord.SendLocalizedMessage(1062507); // You do not have that much money in your bank account.
                }
            }
            else
            {
                m_Landlord.SendLocalizedMessage(1062513); // The renter declined your offer.
            }
        }
Ejemplo n.º 3
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            if (!m_Vendor.CanInteractWith(from, true) || !m_Vendor.CanInteractWith(m_Landlord, false) ||
                !m_Vendor.IsLandlord(m_Landlord))
            {
                return;
            }

            if (info.ButtonID == 1)
            {
                if (Banker.Withdraw(m_Landlord, m_Vendor.TypeOfCurrency, m_RefundAmount))
                {
                    m_Landlord.SendMessage(
                        "{0:#,0} {1} has been withdrawn from your bank box.", m_RefundAmount, m_Vendor.TypeOfCurrency.Name);

                    int depositedCurrency = Banker.DepositUpTo(from, m_Vendor.TypeOfCurrency, m_RefundAmount);

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

                    m_Vendor.HoldCurrency += m_RefundAmount - depositedCurrency;

                    m_Vendor.Destroy(true);

                    from.SendMessage("Your vendor's belongings have been placed in your bank!");
                }
                else
                {
                    m_Landlord.SendLocalizedMessage(1062507);                     // You do not have that much money in your bank account.
                }
            }
            else
            {
                m_Landlord.SendLocalizedMessage(1062513);                 // The renter declined your offer.
            }
        }
Ejemplo n.º 4
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            if (!m_Vendor.CanInteractWith(from, true) || !m_Vendor.CanInteractWith(m_Landlord, false) || !m_Vendor.IsLandlord(m_Landlord))
            {
                return;
            }

            if (info.ButtonID == 1)
            {
                if (Banker.Withdraw(m_Landlord, m_RefundAmount))
                {
                    m_Landlord.SendLocalizedMessage(1060398, m_RefundAmount.ToString());                       // ~1_AMOUNT~ gold has been withdrawn from your bank box.

                    int depositedGold = Banker.DepositUpTo(from, m_RefundAmount);

                    if (depositedGold > 0)
                    {
                        from.SendLocalizedMessage(1060397, depositedGold.ToString());                           // ~1_AMOUNT~ gold has been deposited into your bank box.
                    }
                    m_Vendor.HoldGold += m_RefundAmount - depositedGold;

                    //deposit any held gold for vendor owner to bank before destroying
                    Banker.Deposit(from, m_Vendor.HoldGold);

                    m_Vendor.HoldGold = 0;

                    m_Vendor.Destroy(true);
                }
                else
                {
                    m_Landlord.SendLocalizedMessage(1062507);                       // You do not have that much money in your bank account.
                }
            }
            else
            {
                m_Landlord.SendLocalizedMessage(1062513);                   // The renter declined your offer.
            }
        }
Ejemplo n.º 5
0
 protected override bool IsValidResponse(Mobile from)
 {
     return(m_Vendor.CanInteractWith(from, true));
 }