本文整理汇总了C#中Server.Mobiles.RentedVendor类的典型用法代码示例。如果您正苦于以下问题:C# RentedVendor类的具体用法?C# RentedVendor怎么用?C# RentedVendor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RentedVendor类属于Server.Mobiles命名空间,在下文中一共展示了RentedVendor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnDoubleClick
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!" );
}
}
示例2: TerminateContractEntry
public TerminateContractEntry( RentedVendor vendor )
: base(6218)
{
m_Vendor = vendor;
}
示例3: RentalExpireTimer
public RentalExpireTimer( RentedVendor vendor, TimeSpan delay )
: base(delay, vendor.RentalDuration.Duration)
{
m_Vendor = vendor;
Priority = TimerPriority.OneMinute;
}
示例4: RefundOfferPrompt
public RefundOfferPrompt( RentedVendor vendor )
{
m_Vendor = vendor;
}
示例5: ContractOptionsEntry
public ContractOptionsEntry( RentedVendor vendor )
: base(6209)
{
m_Vendor = vendor;
}
示例6: CollectRentEntry
public CollectRentEntry( RentedVendor vendor )
: base(6212)
{
m_Vendor = vendor;
}
示例7: VendorRentalRefundGump
public VendorRentalRefundGump(RentedVendor vendor, Mobile landlord, int refundAmount)
: base(50, 50)
{
this.m_Vendor = vendor;
this.m_Landlord = landlord;
this.m_RefundAmount = refundAmount;
this.AddBackground(0, 0, 420, 320, 0x13BE);
this.AddImageTiled(10, 10, 400, 300, 0xA40);
this.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.
*/
this.AddHtmlLocalized(10, 10, 400, 150, 1062501, 0x7FFF, false, true);
this.AddHtmlLocalized(10, 180, 150, 20, 1062508, 0x7FFF, false, false); // Vendor Name:
this.AddLabel(160, 180, 0x480, vendor.Name);
this.AddHtmlLocalized(10, 200, 150, 20, 1062509, 0x7FFF, false, false); // Shop Name:
this.AddLabel(160, 200, 0x480, vendor.ShopName);
this.AddHtmlLocalized(10, 220, 150, 20, 1062510, 0x7FFF, false, false); // Refund Amount:
this.AddLabel(160, 220, 0x480, refundAmount.ToString());
this.AddButton(10, 268, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0);
this.AddHtmlLocalized(45, 268, 350, 20, 1062511, 0x7FFF, false, false); // Agree, and <strong>dismiss vendor</strong>
this.AddButton(10, 288, 0xFA5, 0xFA7, 0, GumpButtonType.Reply, 0);
this.AddHtmlLocalized(45, 288, 350, 20, 1062512, 0x7FFF, false, false); // No, I want to <strong>keep my vendor</strong>
}
示例8: ContractRenewalPricePrompt
public ContractRenewalPricePrompt(RentedVendor vendor)
{
this.m_Vendor = vendor;
}
示例9: LandlordVendorRentalGump
public LandlordVendorRentalGump(RentedVendor vendor)
: base(
GumpType.VendorLandlord, vendor.RentalDuration, vendor.RentalPrice, vendor.RenewalPrice,
vendor.Landlord, vendor.Owner, vendor.LandlordRenew, vendor.RenterRenew, vendor.Renew)
{
this.m_Vendor = vendor;
}
示例10: AcceptOffer
protected override void AcceptOffer(Mobile from)
{
this.m_Contract.Offeree = null;
if (!this.m_Contract.Map.CanFit(this.m_Contract.Location, 16, false, false))
{
this.m_Landlord.SendLocalizedMessage(1062486); // A vendor cannot exist at that location. Please try again.
return;
}
BaseHouse house = BaseHouse.FindHouseAt(this.m_Contract);
if (house == null)
return;
int price = this.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(this.m_Landlord, price);
goldToGive = price - depositedGold;
if (depositedGold > 0)
this.m_Landlord.SendLocalizedMessage(1060397, price.ToString()); // ~1_AMOUNT~ gold has been deposited into your bank box.
if (goldToGive > 0)
this.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.
this.m_Landlord.SendLocalizedMessage(1062374, from.Name); // ~1_NAME~ has declined your vendor rental offer.
return;
}
}
else
{
goldToGive = 0;
}
PlayerVendor vendor = new RentedVendor(from, house, this.m_Contract.Duration, price, this.m_Contract.LandlordRenew, goldToGive);
vendor.MoveToWorld(this.m_Contract.Location, this.m_Contract.Map);
this.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.
this.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.
}
示例11: AcceptOffer
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);
}
示例12: VendorRentalRefundGump
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>
}
示例13: ContractRenewalPricePrompt
public ContractRenewalPricePrompt( RentedVendor vendor )
: base(vendor)
{
m_Vendor = vendor;
}
示例14: RentalExpireTimer
public RentalExpireTimer( RentedVendor vendor, TimeSpan delay )
: base(delay, vendor.RentalDuration.Duration)
{
m_Vendor = vendor;
}
示例15: CollectRentEntry
public CollectRentEntry( RentedVendor vendor )
: base(6212)
{
m_Vendor = vendor;
if ( m_Vendor.RentalGold <= 0 )
Flags |= Network.CMEFlags.Disabled;
}