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. } }
protected override void OnTick() { var renewalPrice = m_Vendor.RenewalPrice; if (m_Vendor.Renew && m_Vendor.HoldGold >= renewalPrice) { m_Vendor.HoldGold -= renewalPrice; m_Vendor.RentalGold += renewalPrice; m_Vendor.RentalPrice = renewalPrice; m_Vendor.RentalExpireTime = Core.Now + m_Vendor.RentalDuration.Duration; } else { m_Vendor.Destroy(false); } }
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. } }
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. } }