Exemplo n.º 1
0
            public RentalExpireTimer(RentedVendor vendor, TimeSpan delay)
                : base(delay, vendor.RentalDuration.Duration)
            {
                m_Vendor = vendor;

                Priority = TimerPriority.OneMinute;
            }
            public CollectRentEntry(RentedVendor vendor) : base(6212)
            {
                m_Vendor = vendor;

                if (m_Vendor.RentalGold <= 0)
                {
                    Flags |= Network.CMEFlags.Disabled;
                }
            }
Exemplo n.º 3
0
        public static void ClearMallVendors()
        {
            ArrayList list  = new ArrayList(World.Mobiles.Values);
            int       count = 0;

            foreach (Mobile mob in list)
            {
                if (mob is RentedVendor)
                {
                    RentedVendor vendor   = (RentedVendor)mob;
                    Mobile       landlord = vendor.Landlord;
                    if (landlord is BaseLandLord)
                    {
                        vendor.RentalGold = 0;
                        count            += 1;
                    }
                }
            }
            Console.WriteLine("{0} mall vendors cleared", count);
        }
Exemplo n.º 4
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!" );
			}
		}
Exemplo n.º 5
0
 public ContractOptionsEntry( RentedVendor vendor )
     : base(6209)
 {
     m_Vendor = vendor;
 }
Exemplo n.º 6
0
 public CollectRentEntry( RentedVendor vendor )
     : base(6212)
 {
     m_Vendor = vendor;
 }
        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>
        }
Exemplo n.º 8
0
 public RentalExpireTimer( RentedVendor vendor, TimeSpan delay )
     : base(delay, vendor.RentalDuration.Duration)
 {
     m_Vendor = vendor;
 }
Exemplo n.º 9
0
 public TerminateContractEntry(RentedVendor vendor) : base(6218)
 {
     m_Vendor = vendor;
 }
Exemplo n.º 10
0
 public ContractOptionsEntry(RentedVendor vendor) : base(6209)
 {
     m_Vendor = vendor;
 }
Exemplo n.º 11
0
 public TerminateContractEntry( RentedVendor vendor )
     : base(6218)
 {
     m_Vendor = vendor;
 }
Exemplo n.º 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);
		}
Exemplo n.º 13
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>
		}
Exemplo n.º 14
0
 public ContractRenewalPricePrompt( RentedVendor vendor )
     : base(vendor)
 {
     m_Vendor = vendor;
 }
Exemplo n.º 15
0
 public RefundOfferPrompt( RentedVendor vendor )
 {
     m_Vendor = vendor;
 }
Exemplo n.º 16
0
            public RentalExpireTimer( RentedVendor vendor, TimeSpan delay )
                : base(delay, vendor.RentalDuration.Duration)
            {
                m_Vendor = vendor;

                Priority = TimerPriority.OneMinute;
            }
Exemplo n.º 17
0
 public RentalExpireTimer(RentedVendor vendor, TimeSpan delay)
     : base(delay, vendor.RentalDuration.Duration)
 {
     m_Vendor = vendor;
 }
        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.
        }
 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;
 }
Exemplo n.º 20
0
 public CollectRentEntry(RentedVendor vendor) : base(6212)
 {
     m_Vendor = vendor;
 }
 public ContractRenewalPricePrompt(RentedVendor vendor)
 {
     this.m_Vendor = vendor;
 }
Exemplo n.º 22
0
 public RefundOfferPrompt(RentedVendor vendor)
 {
     m_Vendor = vendor;
 }
Exemplo n.º 23
0
            public CollectRentEntry( RentedVendor vendor )
                : base(6212)
            {
                m_Vendor = vendor;

                if ( m_Vendor.RentalGold <= 0 )
                    Flags |= Network.CMEFlags.Disabled;
            }