Example #1
0
        public static MaginciaBazaarPlot GetBiddingPlot(Mobile from)
        {
            Account acct = from.Account as Account;

            if (acct == null)
            {
                return(null);
            }

            for (int i = 0; i < acct.Length; i++)
            {
                Mobile m = acct[i];

                if (m == null)
                {
                    continue;
                }

                MaginciaBazaarPlot plot = GetBiddingPlotForAccount(m);

                if (plot != null)
                {
                    return(plot);
                }
            }

            return(null);
        }
Example #2
0
        public static bool TryRetractBid(Mobile from)
        {
            MaginciaBazaarPlot plot = GetBiddingPlot(from);

            if (plot != null)
            {
                return(plot.Auction.RetractBid(from));
            }

            return(RetractBid(from));
        }
        public BaseBazaarBroker(MaginciaBazaarPlot plot) : base(AIType.AI_Vendor, FightMode.None, 2, 1, 0.5, 2)
        {
            m_Plot        = plot;
            m_BankBalance = 0;
            m_NextFee     = DateTime.UtcNow + TimeSpan.FromHours(23);
            InitBody();
            InitOutfit();

            Blessed   = true;
            CantWalk  = true;
            Direction = Direction.East;
        }
Example #4
0
		public StallLeasingGump(Mobile from, MaginciaBazaarPlot plot) 
		{
			m_Plot = plot;
			
			AddHtmlLocalized(195, 5, 150, 18, 1150385, RedColor16, false, false);     // New Magincia Bazaar
			AddHtmlLocalized(217, 40, 150, 18, 1150386, RedColor16, false, false);    // Stall Leasing
			
			AddButton(225, 90, 4005, 4007, 1, GumpButtonType.Reply, 0);
			AddHtmlLocalized(265, 90, 150, 18, 1150392, OrangeColor16, false, false); // INFORMATION
			
			AddHtmlLocalized(192, 135, 150, 18, 1150534, RedColor16, false, false); // This Stall:
			AddHtmlLocalized(265, 135, 150, 18, 1150530, m_Plot.PlotDef.ID, BlueColor16, false, false); // Stall ~1_NAME 
			
			AddHtmlLocalized(158, 160, 150, 18, 1150536, RedColor16, false, false); // Current Tenant:
			
			if(m_Plot.Owner == null)
				AddHtmlLocalized(265, 160, 150, 18, 1150542, BlueColor16, false, false); // Stall is Not Occupied
			else if(from == m_Plot.Owner)
				AddHtmlLocalized(265, 160, 200, 18, 1150539, BlueColor16, false, false); // You are leasing this stall
			else
				AddHtmlLocalized(265, 160, 150, 18, 1150541, m_Plot.Owner.Name, BlueColor16, false, false); // ~1_TOKEN~
			
			AddHtmlLocalized(184, 189, 150, 18, 1150332, RedColor16, false, false); // Shop Name:
			
			if(m_Plot.ShopName != null && m_Plot.ShopName.Length > 0)
				AddHtmlLocalized(265, 185, 200, 18, 1150312, m_Plot.ShopName, BlueColor16, false, false); // "~1_NAME~"
			else
				AddHtmlLocalized(265, 185, 200, 18, 1150314, BlueColor16, false, false); // This Shop Has No Name
				
			AddHtmlLocalized(160, 210, 150, 18, 1150388, RedColor16, false, false); // Lease Duration:
			AddHtmlLocalized(265, 210, 150, 18, 1150543, ((int)MaginciaBazaar.GetLongAuctionTime.TotalDays).ToString(), BlueColor16, false, false); // ~1_DAYS~ Days

            AddButton(225, 250, 4005, 4007, 2, GumpButtonType.Reply, 0);
			AddHtmlLocalized(265, 250, 200, 18, 1150555, OrangeColor16, false, false); // SEE TOP BIDS
			
			bool isOwner = m_Plot.IsOwner(from);
			
            AddButton(225, 274, 4005, 4007, 3, GumpButtonType.Reply, 0);
			AddHtmlLocalized(265, 274, 200, 18, 1150557, isOwner ? OrangeColor16 : GrayColor16, false, false); // MY STALL LEASE

            AddButton(225, 298, 4005, 4007, 4, GumpButtonType.Reply, 0);
			AddHtmlLocalized(265, 298, 200, 18, 1150556, OrangeColor16, false, false); // MY STALL BID
			
            AddButton(225, 322, 4005, 4007, 5, GumpButtonType.Reply, 0);
			AddHtmlLocalized(265, 322, 200, 18, 1150540, isOwner ? OrangeColor16 : GrayColor16, false, false); // MY BID MATCHING
		}
Example #5
0
        public MaginciaPlotAuction(GenericReader reader, MaginciaBazaarPlot plot)
        {
            int version = reader.ReadInt();

            m_Plot       = plot;
            m_AuctionEnd = reader.ReadDateTime();

            int c = reader.ReadInt();

            for (int i = 0; i < c; i++)
            {
                Mobile   m     = reader.ReadMobile();
                BidEntry entry = new BidEntry(reader);

                if (m != null)
                {
                    m_Auctioners[m] = entry;
                }
            }
        }
Example #6
0
        public static bool IsActivePlot(MaginciaBazaarPlot plot)
        {
            if (m_Instance != null)
            {
                int index = m_Plots.IndexOf(plot);

                if (index == -1)
                {
                    return(false);
                }

                switch ((int)m_Instance.m_Phase)
                {
                case 1: return(index < 40);

                case 2: return(index < 70);

                case 3: return(index < 100);
                }
            }

            return(false);
        }
Example #7
0
        public void ActivatePlots()
        {
            for (int i = 0; i < m_Plots.Count; i++)
            {
                MaginciaBazaarPlot plot = m_Plots[i];

                switch ((int)m_Phase)
                {
                case 1:
                    if (i < 40 && plot.Auction == null)
                    {
                        plot.NewAuction(GetShortAuctionTime);
                    }
                    break;

                case 2:
                    if (i < 70 && plot.Auction == null)
                    {
                        plot.NewAuction(GetShortAuctionTime);
                    }
                    break;

                case 3:
                    if (i < 100 && plot.Auction == null)
                    {
                        plot.NewAuction(GetShortAuctionTime);
                    }
                    break;
                }

                if (plot.Sign != null)
                {
                    plot.Sign.InvalidateProperties();
                }
            }
        }
Example #8
0
		public MatchBidGump(Mobile from, MaginciaBazaarPlot plot)
		{
			m_Plot = plot;
			
			int amount = MaginciaBazaar.GetBidMatching(from);

            AddHtmlLocalized(195, 5, 150, 18, 1150385, RedColor16, false, false);     // New Magincia Bazaar
            AddHtmlLocalized(217, 40, 150, 18, 1150386, RedColor16, false, false);    // Stall Leasing
			
			AddHtmlLocalized(12, 100, 150, 18, 1150387, RedColor16, false, false); // Your Stall:
			AddHtmlLocalized(12, 120, 150, 18, 1150393, RedColor16, false, false); // Bid Match Limit:

            if (m_Plot != null)
                AddHtml(260, 100, 150, 18, Color(m_Plot.PlotDef.ID, BlueColor), false, false);
            else
                AddHtml(260, 100, 250, 18, Color("You are not leasing stall.", BlueColor), false, false);

			AddHtml(260, 120, 150, 18, Color(FormatAmt(amount), BlueColor), false, false);
			
			AddButton(175, 175, 4005, 4007, 1, GumpButtonType.Reply, 0);
			AddHtmlLocalized(215, 175, 150, 18, 1150392, OrangeColor16, false, false); // INFORMATION
			
			AddHtmlLocalized(10, 230, 200, 18, 1150587, RedColor16, false, false); // CHANGE MATCH BID
			AddBackground(215, 280, 295, 22, 9350);
			AddTextEntry(216, 281, 295, 20, 0, 0, "");
			AddButton(175, 280, 4005, 4007, 2, GumpButtonType.Reply, 0);

            AddButton(10, 490, 4014, 4016, 3, GumpButtonType.Reply, 0);
            AddHtmlLocalized(50, 490, 200, 18, 1149777, BlueColor16, false, false); // MAIN MENU
		}
Example #9
0
		public MyStallLeaseGump(Mobile from, MaginciaBazaarPlot plot)
		{
			m_Plot = plot;

            AddHtmlLocalized(195, 5, 150, 18, 1150385, RedColor16, false, false);     // New Magincia Bazaar
            AddHtmlLocalized(217, 40, 150, 18, 1150386, RedColor16, false, false);    // Stall Leasing
			
			AddHtmlLocalized(138, 135, 150, 18, 1150387, RedColor16, false, false); // Your Stall:
			AddHtmlLocalized(210, 135, 150, 18, 1150530, m_Plot.PlotDef.ID, BlueColor16, false, false); // Stall ~1_NAME 
			
			AddHtmlLocalized(101, 160, 150, 18, 1150388, RedColor16, false, false); // Lease Duration:
			AddHtmlLocalized(210, 160, 150, 18, 1150543, ((int)MaginciaBazaar.GetLongAuctionTime.TotalDays).ToString(), BlueColor16, false, false); // ~1_DAYS~ Days
			
			if(m_Plot.Merchant == null)
				AddButton(175, 220, 4005, 4007, 1, GumpButtonType.Reply, 0);
			AddHtmlLocalized(210, 220, 200, 18, 1150686, m_Plot.Merchant == null ? OrangeColor16 : GrayColor16, false, false); // HIRE ANIMAL BROKER
			
			if(m_Plot.Merchant == null)
                AddButton(175, 244, 4005, 4007, 2, GumpButtonType.Reply, 0);
			AddHtmlLocalized(210, 244, 200, 18, 1150687, m_Plot.Merchant == null ? OrangeColor16 : GrayColor16, false, false); // HIRE COMMODITY BROKER
			
			if(m_Plot.Merchant != null)
                AddButton(175, 268, 4005, 4007, 3, GumpButtonType.Reply, 0);
			AddHtmlLocalized(210, 268, 200, 18, 1150688, m_Plot.Merchant != null ? OrangeColor16 : GrayColor16, false, false); // FIRE BROKER

            AddButton(175, 292, 4005, 4007, 4, GumpButtonType.Reply, 0);
			AddHtmlLocalized(210, 292, 200, 18, 1150689, OrangeColor16, false, false); // ABANDON LEASE

            AddButton(10, 490, 4014, 4016, 5, GumpButtonType.Reply, 0);
            AddHtmlLocalized(50, 490, 200, 18, 1149777, BlueColor16, false, false); // MAIN MENU
		}
Example #10
0
 public InternalTimer(MaginciaBazaarPlot plot) : base(TimeSpan.FromMinutes(1), TimeSpan.FromMinutes(1))
 {
     m_Plot = plot;
 }
Example #11
0
		public PetBroker(MaginciaBazaarPlot plot) : base(plot)
		{
            FollowersMax = 500;
		}
Example #12
0
		public StallBidGump(Mobile from, MaginciaBazaarPlot plot)
		{
			m_Plot = plot;
			
			MaginciaBazaarPlot biddingPlot = MaginciaBazaar.GetBiddingPlot(from);
            int bidAmount = biddingPlot != null ? biddingPlot.GetBid(from) : MaginciaBazaar.GetNextAvailableBid(from);

            AddHtmlLocalized(195, 5, 150, 18, 1150385, RedColor16, false, false);     // New Magincia Bazaar
            AddHtmlLocalized(217, 40, 150, 18, 1150386, RedColor16, false, false);    // Stall Leasing
			
			AddHtmlLocalized(86, 135, 200, 18, 1150389, RedColor16, false, false); // You are bidding on:
			
			if(biddingPlot != null)
				AddHtmlLocalized(215, 135, 100, 18, 1150541, biddingPlot.PlotDef.ID, BlueColor16, false, false); // ~1_TOKEN~
			else if(MaginciaBazaar.IsBiddingNextAvailable(from))
                AddHtmlLocalized(215, 135, 100, 18, 1150538, BlueColor16, false, false); // Next Available Stall
            else
				AddHtmlLocalized(215, 135, 100, 18, 1150396, BlueColor16, false, false); // NONE

            AddHtmlLocalized(135, 160, 150, 18, 1150407, RedColor16, false, false); // Bid Amount:
            AddHtml(215, 160, 100, 18, Color(FormatAmt(bidAmount), BlueColor), false, false);

            AddButton(260, 220, 4005, 4007, 1, GumpButtonType.Reply, 0);
            AddHtmlLocalized(300, 220, 150, 18, 1150566, OrangeColor16, false, false); // INSTRUCTIONS

			AddHtmlLocalized(125, 265, 200, 18, 1150560, RedColor16, false, false); // BID AMOUNT
			AddBackground(215, 265, 295, 22, 9350);
			AddTextEntry(216, 267, 295, 20, 0, 0, "");
			
			bool isOwner = m_Plot.IsOwner(from);
			
			AddHtmlLocalized(215, 304, 250, 18, 1150568, m_Plot.PlotDef.ID, isOwner ? GrayColor16 : BlueColor16, false, false); // BID ON THIS STALL (Stall ~1_STALLID~)
			if(!isOwner)
				AddButton(175, 304, 4005, 4007, 2, GumpButtonType.Reply, 0);
			
			AddHtmlLocalized(215, 328, 250, 18, 1150569, BlueColor16, false, false); // BID ON FIRST AVAILABLE
			AddButton(175, 328, 4005, 4007, 3, GumpButtonType.Reply, 0);
			
			AddHtmlLocalized(10, 360, 500, 40, 1150792, RedColor16, false, false); // Minimum bid 1,000gp. Bids are rounded down to nearest 1,000gp (1,999gp becomes 1,000gp).

            AddButton(10, 490, 4014, 4016, 4, GumpButtonType.Reply, 0);
            AddHtmlLocalized(50, 490, 200, 18, 1149777, BlueColor16, false, false); // MAIN MENU
		}
Example #13
0
		public HireBrokerGump(Mobile from, MaginciaBazaarPlot plot, bool commodity)
		{
			m_Plot = plot;
			m_Commodity = commodity;

            AddHtmlLocalized(195, 5, 150, 18, 1150385, RedColor16, false, false);     // New Magincia Bazaar
            AddHtmlLocalized(217, 40, 150, 18, 1150386, RedColor16, false, false);    // Stall Leasing
			
			AddHtmlLocalized(191, 100, 150, 18, m_Commodity ? 1150687 : 1150686, RedColor16, false, false); // HIRE ANIMAL BROKER
			AddHtmlLocalized(10, 130, 500, 100, 1150690, RedColor16, false, false); // Choose a stall style...
			
			AddButton(175, 244, 4005, 4007, 1, GumpButtonType.Reply, 0);
            AddHtmlLocalized(210, 244, 150, 18, 1150701, RedColor16, false, false); // STYLE 1

            AddButton(175, 268, 4005, 4007, 2, GumpButtonType.Reply, 0);
			AddHtmlLocalized(210, 268, 150, 18, 1150702, RedColor16, false, false);	// STYLE 2

            AddButton(175, 292, 4005, 4007, 3, GumpButtonType.Reply, 0);
			AddHtmlLocalized(210, 292, 150, 18, 1150703, RedColor16, false, false); // STYLE 3

            AddButton(10, 490, 4014, 4016, 4, GumpButtonType.Reply, 0);
            AddHtmlLocalized(50, 490, 200, 18, 1149777, BlueColor16, false, false); // MAIN MENU
		}
Example #14
0
		public ConfirmAbandonLeaseGump(Mobile from, MaginciaBazaarPlot plot)
		{
			m_Plot = plot;
			
			AddHtmlLocalized(195, 5, 150, 18, 1150385, RedColor16, false, false);     // New Magincia Bazaar
			AddHtmlLocalized(217, 40, 150, 18, 1150386, RedColor16, false, false);    // Stall Leasing
			
			/*In order to abandon your lease, your stall must be empty. To clear out 
			 *your stall, you must first retrieve all inventory, funds, and personal 
			 *items from your broker and the stall area, then choose the Fire Broker 
			 *option to release the broker. Once the stall is cleared, return to this 
			 *menu to confirm the abandonment of your lease.*/
			 
			 /*By clicking the CONFIRM button below, you will abandon your lease on 
			  *this stall and receive no refund of your lease payment. A new lease 
			  *on this stall will be auctioned within 12 hours.*/
			
			AddHtmlLocalized(10, 100, 500, 100, m_Plot.Merchant != null ? 1150693 : 1150694, RedColor16, false, false);
			
			if(m_Plot.Merchant == null)
			{
                AddHtmlLocalized(215, 350, 150, 18, 1150695, OrangeColor16, false, false); // CONFIRM
				AddButton(175, 350, 4005, 4007, 1, GumpButtonType.Reply, 0);
			}
		}
Example #15
0
        public static bool IsActivePlot(MaginciaBazaarPlot plot)
        {
            if (m_Instance != null)
            {
                int index = m_Plots.IndexOf(plot);

                if (index == -1)
                    return false;

                switch ((int)m_Instance.m_Phase)
                {
                    case 1: return index < 40;
                    case 2: return index < 70;
                    case 3: return index < 100;
                }
            }

            return false;
        }
Example #16
0
 public PlotSign(MaginciaBazaarPlot plot)
     : base(3025)
 {
     Movable = false;
     m_Plot  = plot;
 }
Example #17
0
			public InternalTimer(MaginciaBazaarPlot plot) : base(TimeSpan.FromMinutes(1), TimeSpan.FromMinutes(1))
			{
				m_Plot = plot;
			}
Example #18
0
 public CommodityBroker(MaginciaBazaarPlot plot) : base(plot)
 {
 }
Example #19
0
		public ConfirmMatchBidGump(Mobile from, int amount, MaginciaBazaarPlot plot)
		{
			m_Plot = plot;
			
			if(amount < 0)
				amount = 0;

            AddHtmlLocalized(195, 5, 150, 18, 1150385, RedColor16, false, false);     // New Magincia Bazaar
            AddHtmlLocalized(217, 40, 150, 18, 1150386, RedColor16, false, false);    // Stall Leasing
			
			int cliloc1;
			string args1;
			
			int current = MaginciaBazaar.GetBidMatching(from);
			int bankBal = Banker.GetBalance(from);
			
			if(amount > current)
			{
				int dif = amount - current;
				
				if(dif > bankBal)
				{
					/*Your attempt to increase your Match Bid from ~1_OLDBID~gp to ~2_NEWBID~gp 
					 *failed. The difference of ~3_CHANGE~gp could not be withdrawn from your bank 
					 *account balance. Your current bank balance is ~5_NEWBAL~gp.*/
					cliloc1 = 1150588;
					args1 = String.Format("{0}\t{1}\t{2}\t{3}", FormatAmt(current), FormatAmt(amount), FormatAmt(dif), FormatAmt(bankBal));
				}
				else
				{
					Banker.Withdraw(from, amount);
					MaginciaBazaar.AddToReserve(from, dif);
					/*You have increased your Match Bid from ~1_OLDBID~gp to ~2_NEWBID~gp. The 
					 *difference of ~3_CHANGE~gp has been withdrawn from your bank account balance. 
					 *Your previous bank balance was ~4_OLDBAL~gp and your current bank balance is 
					 ~5_NEWBAL~gp.*/
					cliloc1 = 1150589;
					args1 = String.Format("{0}\t{1}\t{2}\t{3}\t{4}", FormatAmt(current), FormatAmt(amount), FormatAmt(dif), FormatAmt(bankBal), FormatAmt(bankBal - dif));
				}
			}
			else if (amount < current)
			{
				int dif = current - amount;

				if(!Banker.Deposit(from, dif))	
				{
					/*Your attempt to decrease your Match Bid from ~1_OLDBID~gp to ~2_NEWBID~gp 
					 *failed. The difference of ~3_CHANGE~gp could not be deposited into your bank 
					 box. Your current bank balance is ~5_NEWBAL~gp.*/
					cliloc1 = 1150590;
					args1 = String.Format("{0}\t{1}\t{2}\t{3}", FormatAmt(current), FormatAmt(amount), FormatAmt(dif), FormatAmt(bankBal));
				}
				else
				{
					MaginciaBazaar.DeductReserve(from, dif);
					/*You have decreased your Match Bid from ~1_OLDBID~gp to ~2_NEWBID~gp. The 
					 *difference of ~3_CHANGE~gp has been deposited into your bank box. Your 
					 *previous bank balance was ~4_OLDBAL~gp and your current bank balance is 
					 ~5_NEWBAL~gp.*/
					cliloc1 = 1150591;
					args1 = String.Format("{0}\t{1}\t{2}\t{3}\t{4}", FormatAmt(current), FormatAmt(amount), FormatAmt(dif), FormatAmt(bankBal), FormatAmt(bankBal + dif));
				}
			}
			else
			{
				//You have not changed your match bid.
				cliloc1 = 1150592;
				args1 = null;
			}

			if(args1 != null)
				AddHtmlLocalized(10, 100, 500, 120, cliloc1, args1, GreenColor16, false, false);
			else
				AddHtmlLocalized(10, 100, 500, 120, cliloc1, GreenColor16, false, false);
			
			AddHtmlLocalized(50, 490, 150, 18, 1150540, BlueColor16, false, false); // MY BID MATCHING
			AddButton(10, 490, 4014, 4016, 1, GumpButtonType.Reply, 0);
		}
Example #20
0
        public static void AwardPlot(MaginciaPlotAuction auction, Mobile winner, int highest)
        {
            MaginciaBazaarPlot plot = auction.Plot;

            if (m_NextAvailable.ContainsKey(winner))
            {
                m_NextAvailable.Remove(winner);
            }

            if (plot != null && plot.Owner != winner)
            {
                MaginciaBazaarPlot current = GetPlot(winner);

                //new owner
                if (current == null && winner != plot.Owner)
                {
                    /*You won a lease on Stall ~1_STALLNAME~ at the ~2_FACET~ New Magincia Bazaar.
                     * Your bid amount of ~3_BIDAMT~gp won the auction and has been remitted. Your
                     * lease begins immediately and will continue for 7 days.*/
                    MaginciaLottoSystem.SendMessageTo(winner, new NewMaginciaMessage(null, new TextDefinition(1150426), String.Format("{0}\t{1}\t{2}", plot.PlotDef.ID, plot.PlotDef.Map.ToString(), highest.ToString("###,###,###"))));
                }

                plot.Reset();

                //Transfer to new plot
                if (current != null)
                {
                    /*You won a lease and moved to Stall ~1_STALLNAME~ at the ~2_FACET~ New Magincia
                     * Bazaar. The lease on your previous stall has been terminated. Your hired
                     * merchant, if any, has relocated your stall and goods to the new lot. Your
                     * bid amount of ~3_BIDAMT~gp has been remitted.*/
                    MaginciaLottoSystem.SendMessageTo(winner, new NewMaginciaMessage(null, new TextDefinition(1150428), String.Format("{0}\t{1}\t{2}", plot.PlotDef.ID, plot.PlotDef.Map, highest.ToString("###,###,###"))));

                    plot.PlotMulti = current.PlotMulti;
                    plot.Merchant  = current.Merchant;
                    plot.ShopName  = current.ShopName;

                    current.PlotMulti = null;
                    current.Merchant  = null;
                    current.Owner     = null;

                    if (current.Auction != null)
                    {
                        current.Auction.EndAuction();
                    }
                }

                plot.Owner = winner;
                plot.NewAuction(GetLongAuctionTime);
            }
            else if (plot != null)
            {
                if (plot.Owner != null)
                {
                    plot.NewAuction(GetLongAuctionTime);
                }
                else
                {
                    plot.Reset();
                    plot.NewAuction(GetShortAuctionTime);
                }
            }
        }
Example #21
0
		public MaginciaPlotAuction(GenericReader reader, MaginciaBazaarPlot plot)
		{
			int version = reader.ReadInt();
			
			m_Plot = plot;
			m_AuctionEnd = reader.ReadDateTime();
			
			int c = reader.ReadInt();
			for(int i = 0; i < c; i++)
			{
				Mobile m = reader.ReadMobile();
				BidEntry entry = new BidEntry(reader);
				
				if(m != null)
					m_Auctioners[m] = entry;
			}
		}
Example #22
0
		public ConfirmBidGump(Mobile from, MaginciaBazaarPlot actualPlot, MaginciaBazaarPlot newPlot, int newBid, bool retract)
		{
			m_Plot = actualPlot;
			
			AddHtmlLocalized(195, 5, 150, 18, 1150385, RedColor16, false, false);     // New Magincia Bazaar
			AddHtmlLocalized(217, 40, 150, 18, 1150386, RedColor16, false, false);    // Stall Leasing
			
			MaginciaBazaarPlot oldPlot = MaginciaBazaar.GetBiddingPlot(from);
			
			bool hasbidnextavailable = MaginciaBazaar.NextAvailable.ContainsKey(from);
			bool hasbidspecific = oldPlot != null;
			bool specific = newPlot != null;

            int cliloc1 = 0; 
            int cliloc2 = 0;
            string args1 = null;
            string args2 = null;
			
			int bankBal = Banker.GetBalance(from);
            int newBankBal = bankBal;
			int oldBid = 0;
            //int dif = 0;
			
			if(hasbidspecific)
				oldBid = oldPlot.Auction.GetBidAmount(from);
			else if (hasbidnextavailable)
				oldBid = MaginciaBazaar.NextAvailable[from].Amount;
				
			if(newBid < 1000)
				newBid = 1000;
				
			bool increase = newBid > oldBid;
			
			if(retract) // Retract all bids
			{
				if(MaginciaBazaar.TryRetractBid(from))
				{
					/*You have canceled your stall bid of ~1_OLDBID~gp. The funds have been deposited 
					 *into your bank box. Your previous bank balance was ~4_OLDBAL~gp and your current
					  *bank balance is now ~5_NEWBAL~gp. */
					  
					cliloc1 = 1150576;
					args1 = String.Format("{0}\t{1}\t{2}\t{3}\t{4}", FormatAmt(oldBid), "", "", FormatAmt(bankBal), FormatAmt(bankBal + oldBid));
				}
				else
				{
					/*You are attempting to cancel your stall bid of ~1_OLDBID~gp. The bid cannot be 
					 *refunded to your bank account, because your bank box cannot hold the additional 
					 *funds. Your current bank balance is ~4_OLDVAL~gp.<br><br>Your bid status has not changed.*/
					cliloc1 = 1150575;
					args1 = String.Format("{0}\t{1}\t{2}\t{3}", FormatAmt(oldBid), "", "", FormatAmt(bankBal));
				}
			}
			else if (oldBid == newBid)
			{
				// Your bid amount of ~1_BID~gp has not changed.
				cliloc1 = 1150570;
				args1 = FormatAmt(newBid);
				
				if(hasbidspecific)
				{
                    if (specific)
                    {
                        if (oldPlot != newPlot)
                        {
                            oldPlot.Auction.RemoveBid(from);
                            newPlot.Auction.MakeBid(from, newBid);

                            //You were previously bidding on Stall ~1_OLDSTALL~ and now you are bidding on Stall ~2_NEWSTALL~.
                            cliloc1 = 1150582;
                            args1 = String.Format("{0}\t{1}", oldPlot.PlotDef.ID, newPlot.PlotDef.ID);

                            // You are now bidding on Stall ~1_NEWSTALL~
                            cliloc2 = 1150585;
                            args2 = newPlot.PlotDef.ID;
                        }
                        else
                        {
                            // Your bid amount of ~1_BID~gp has not changed.
                            cliloc1 = 1150570;
                            args1 = FormatAmt(newBid);

                            // You are still bidding on Stall ~2_NEWSTALL~.
                            cliloc2 = 1150583;
                            args2 = String.Format("{0}\t{1}", "", oldPlot.PlotDef.ID);
                        }
                    }
                    else
                    {
                        oldPlot.Auction.RemoveBid(from);
                        MaginciaBazaar.MakeBidNextAvailable(from, newBid);

                        // You were previously bidding on Stall ~1_OLDSTALL~, and now you are bidding on the first available stall.
                        cliloc1 = 1150580;
                        args1 = oldPlot.PlotDef.ID;

                        // You are now bidding on the next available stall.
                        cliloc2 = 1150584;
                        args2 = null;
                    }
				}
				else if(hasbidnextavailable)
				{
                    if (specific)
                    {
                        newPlot.Auction.MakeBid(from, newBid);
                        MaginciaBazaar.RemoveBidNextAvailable(from);

                        //You were previously bidding on the first available stall, and now you are bidding specifically for Stall ~2_NEWSTALL~.
                        cliloc1 = 1150579;
                        args1 = String.Format("{0}\t{1}", "", newPlot.PlotDef.ID);

                        // You are now bidding on the next available stall.
                        cliloc2 = 1150584;
                        args2 = null;
                    }
                    else
                    {
                        // Your bid amount of ~1_BID~gp has not changed.
                        cliloc1 = 1150570;
                        args1 = FormatAmt(newBid);

                        // You are still bidding on the next available stall.
                        cliloc2 = 1150581;
                        args2 = null;
                    }
				}
			}
			else if(specific)
			{
				if(increase)
				{
					int dif = newBid - oldBid;
					
					if(bankBal < dif)
					{
						/*You are attempting to increase your stall bid from ~1_OLDBID~gp to 
						 *~2_NEWBID~gp. The difference of ~3_BIDCHANGE~gp cannot be withdrawn from 
						 *your bank account. Your current bank balance is ~4_CURBAL~gp.<br><br>The 
						 *status of your bid has not changed.*/
						cliloc1 = 1150571;
						args2 = String.Format("{0}\t{1}\t{2}\t{3}", FormatAmt(oldBid), FormatAmt(newBid), FormatAmt(dif), FormatAmt(bankBal));
						
						if(hasbidspecific)
						{
							// You are still bidding on Stall ~2_NEWSTALL~.
							cliloc2 = 1150583;
							args2 = String.Format("{0}\t{1}", "", oldPlot.PlotDef.ID);
						}
						else if(hasbidnextavailable)
						{
							// You are still bidding on the next available stall.
							cliloc2 = 1150581;
							args2 = null;
						}
						else
						{
							cliloc2 = 1150541;
							args2 = "You have no active bids.";
						}
					}
					else if((hasbidnextavailable || hasbidspecific) && !MaginciaBazaar.TryRetractBid(from))
					{
						/*You are attempting to cancel your stall bid of ~1_OLDBID~gp. The bid cannot 
						 *be refunded to your bank account, because your bank box cannot hold the additional 
						 *funds. Your current bank balance is ~4_OLDVAL~gp.<br><br>Your bid status has not 
						 changed.*/
						cliloc1 = 1150575;
						args1 = String.Format("{0}\t{1}\t{2}\t{3}", FormatAmt(oldBid), "", "", FormatAmt(bankBal));
						
						if(hasbidspecific)
						{
							// You are still bidding on Stall ~2_NEWSTALL~.
							cliloc2 = 1150583;
							args2 = String.Format("{0}\t{1}", "", oldPlot.PlotDef.ID);
						}
						else if(hasbidnextavailable)
						{
							// You are still bidding on the next available stall.
							cliloc2 = 1150581;
							args2 = null;
						}
						else
						{
							cliloc2 = 1150541;
							args2 = "You have no active bids.";
						}
					}
					else
					{
						Banker.Withdraw(from, dif);
						newPlot.Auction.MakeBid(from, newBid);
						/*You have posted a new bid of ~2_NEWBID~gp. The funds have been 
						*withdrawn from your bank box. Your previous bank balance was 
						~4_OLDBAL~gp and your new bank balance is ~5_NEWBAL~gp.*/
						cliloc1 = 1150578;
						args1 = String.Format("{0}\t{1}\t{2}\t{3}\t{4}", "", FormatAmt(newBid), "", FormatAmt(bankBal), FormatAmt(bankBal - dif));
						
						if(hasbidspecific && oldPlot == newPlot) 		// same plot
						{
							/*You are increasing your stall bid from ~1_OLDBID~gp to ~2_NEWBID~gp. 
							 *The difference of ~3_BIDCHANGE~gp has been withdrawn from your bank 
							  *account. Your previous bank balance was ~4_CURBAL~gp, and your new 
							  bank balance is ~5_NEWBAL~gp.*/
							cliloc1 = 1150572;
							//You are still bidding on Stall ~2_NEWSTALL~.
							cliloc2 = 1150583;
							args1 = String.Format("{0}\t{1}\t{2}\t{3}\t{4}", FormatAmt(oldBid), FormatAmt(newBid), FormatAmt(dif), FormatAmt(bankBal), FormatAmt(bankBal - dif));
							args2 = String.Format("{0}\t{1}", "", newPlot.PlotDef.ID);
						}
						else if(hasbidspecific &&  oldPlot != newPlot)	// switching plots
						{
							//You were previously bidding on Stall ~1_OLDSTALL~ and now you are bidding on Stall ~2_NEWSTALL~.
							cliloc2 = 1150582;
							args2 = String.Format("{0}\t{1}", oldPlot.PlotDef.ID, newPlot.PlotDef.ID);
						}
						else if (hasbidnextavailable)					// had next available
						{
							//You were previously bidding on the first available stall, and now you are bidding specifically for Stall ~2_NEWSTALL~.
							cliloc2 = 1150579;
							args2 = String.Format("{0}\t{1}", "", newPlot.PlotDef.ID);
						}
						else											// no bids before
						{
							// You are now bidding on Stall ~1_NEWSTALL~
							cliloc2 = 1150585;
							args2 = newPlot.PlotDef.ID;
						}
					}
				}
				else
				{
					int dif = oldBid - newBid;
					
					if((hasbidnextavailable || hasbidspecific) && !MaginciaBazaar.TryRetractBid(from))
					{
						/*You are attempting to cancel your stall bid of ~1_OLDBID~gp. The bid cannot 
						 *be refunded to your bank account, because your bank box cannot hold the additional 
						 *funds. Your current bank balance is ~4_OLDVAL~gp.<br><br>Your bid status has not 
						 changed.*/
						cliloc1 = 1150575;
						args1 = String.Format("{0}\t{1}\t{2}\t{3}", FormatAmt(oldBid), "", "", FormatAmt(bankBal));
						
						if(hasbidspecific)
						{
							// You are still bidding on Stall ~2_NEWSTALL~.
							cliloc2 = 1150583;
							args2 = String.Format("{0}\t{1}", "", oldPlot.PlotDef.ID);
						}
						else if(hasbidnextavailable)
						{
							// You are still bidding on the next available stall.
							cliloc2 = 1150581;
							args2 = null;
						}
						else
						{
							cliloc2 = 1150541;
							args2 = "You have no active bids.";
						}
					}
					else
					{
						/*You have posted a new bid of ~2_NEWBID~gp. The funds have been 
						*withdrawn from your bank box. Your previous bank balance was 
						~4_OLDBAL~gp and your new bank balance is ~5_NEWBAL~gp.*/
						cliloc1 = 1150578;
						args1 = String.Format("{0}\t{1}\t{2}\t{3}\t{4}", "", FormatAmt(newBid), "", FormatAmt(bankBal), FormatAmt(bankBal - dif));

                        Banker.Withdraw(from, newBid);
						newPlot.Auction.MakeBid(from, newBid);
						
						if(hasbidspecific &&  oldPlot == newPlot) 		// winner, same plot
						{
							/*You are decreasing your stall bid from ~1_OLDBID~gp to ~2_NEWBID~gp. 
							 *The difference of ~3_BIDCHANGE~gp has been deposited into your bank 
							 *account. Your previous bank balance was ~4_CURBAL~gp, and your new 
							 *bank balance is ~5_NEWBAL~gp.*/
							cliloc1 = 1150574;
							//You are still bidding on Stall ~2_NEWSTALL~.
							cliloc2 = 1150583;
							args1 = String.Format("{0}\t{1}\t{2}\t{3}\t{4}", FormatAmt(oldBid), FormatAmt(newBid), FormatAmt(dif), FormatAmt(bankBal), FormatAmt(bankBal + dif));
							args2 = String.Format("{0}\t{1}", "", oldPlot.PlotDef.ID);
						}
						else if(hasbidspecific &&  oldPlot != newPlot) 	// switch plots
						{
							//You were previously bidding on Stall ~1_OLDSTALL~ and now you are bidding on Stall ~2_NEWSTALL~.
							cliloc2 = 1150582;
							args2 = String.Format("{0}\t{1}", oldPlot.PlotDef.ID, newPlot.PlotDef.ID);
						}
						else if (hasbidnextavailable)					// new plot
						{
							//You were previously bidding on the first available stall, and now you are bidding specifically for Stall ~2_NEWSTALL~.
							cliloc2 = 1150579;
							args2 = String.Format("{0}\t{1}", "", newPlot.PlotDef.ID);
						}
						else											
						{
							// You are now bidding on Stall ~1_NEWSTALL~
							cliloc2 = 1150585;
							args2 = String.Format(newPlot.PlotDef.ID);
						}
					}
				}
			}
			else
			{
				if(increase)
				{
					int dif = newBid - oldBid; 
					
					if(bankBal < dif)
					{
						 /*You are attempting to place a new bid of ~2_NEWBID~gp. This amount exceeds 
						  *your current bank balance of ~4_OLDBAL~gp.<br><br>Your bid status has not 
						  changed.*/
						cliloc1 = 1150577;
						args1 = String.Format("{0}\t{1}\t{2}\t{3}", "", FormatAmt(newBid), "", FormatAmt(bankBal));
						
						if(hasbidspecific)
						{
							// You are still bidding on Stall ~2_NEWSTALL~.
							cliloc2 = 1150583;
							args2 = String.Format("{0}\t{1}", "", oldPlot.PlotDef.ID);
						}
						else if(hasbidnextavailable)
						{
							// You are still bidding on the next available stall.
							cliloc2 = 1150581;
							args2 = null;
						}
						else
						{
							cliloc2 = 1150541;
							args2 = "You have no active bids.";
						}
					}
					else if((hasbidnextavailable || hasbidspecific) && !MaginciaBazaar.TryRetractBid(from))
					{
						/*You are attempting to cancel your stall bid of ~1_OLDBID~gp. The bid cannot 
						 *be refunded to your bank account, because your bank box cannot hold the additional 
						 *funds. Your current bank balance is ~4_OLDVAL~gp.<br><br>Your bid status has not 
						 changed.*/
						cliloc1 = 1150575;
						args1 = String.Format("{0}\t{1}\t{2}\t{3}", FormatAmt(oldBid), "", "", FormatAmt(bankBal));
						
						if(hasbidspecific)
						{
							// You are still bidding on Stall ~2_NEWSTALL~.
							cliloc2 = 1150583;
							args2 = String.Format("{0}\t{1}", "", oldPlot.PlotDef.ID);
						}
						else if(hasbidnextavailable)
						{
							// You are still bidding on the next available stall.
							cliloc2 = 1150581;
							args2 = null;
						}
						else
						{
							cliloc2 = 1150541;
							args2 = "You have no active bids.";
						}
					}
					else
					{
						Banker.Withdraw(from, dif);
                        MaginciaBazaar.MakeBidNextAvailable(from, newBid);
						
						/*You have posted a new bid of ~2_NEWBID~gp. The funds have been 
						*withdrawn from your bank box. Your previous bank balance was 
						*~4_OLDBAL~gp and your new bank balance is ~5_NEWBAL~gp.*/
						cliloc1 = 1150578;
						args1 = String.Format("{0}\t{1}\t{2}\t{3}\t{4}", "", FormatAmt(newBid), "", FormatAmt(bankBal), FormatAmt(bankBal - newBid));
						
						if(hasbidspecific)				// Change from specific to next available
						{
							// You were previously bidding on Stall ~1_OLDSTALL~, and now you are bidding on the first available stall.
							cliloc2 = 1150580;
							args2 = oldPlot.PlotDef.ID;
						}
						else if(hasbidnextavailable)	// stays as next available
						{
							// You are still bidding on the next available stall.
							cliloc2 = 1150581;
							args2 = null;
						}
						else							// First time bid
						{
							// You are now bidding on the next available stall.
							cliloc2 = 1150584;
							args2 = null;
						}
					}
				}
				else
				{
					int dif = oldBid - newBid;
					
					if((hasbidnextavailable || hasbidspecific) && !MaginciaBazaar.TryRetractBid(from))
					{
						/*You are attempting to cancel your stall bid of ~1_OLDBID~gp. The bid cannot 
						 *be refunded to your bank account, because your bank box cannot hold the additional 
						 *funds. Your current bank balance is ~4_OLDVAL~gp.<br><br>Your bid status has not 
						 changed.*/
						cliloc1 = 1150575;
						args1 = String.Format("{0}\t{1}\t{2}\t{3}", FormatAmt(oldBid), "", "", FormatAmt(bankBal));
						
						if(hasbidspecific)
						{
							// You are still bidding on Stall ~2_NEWSTALL~.
							cliloc2 = 1150583;
							args2 = String.Format("{0}\t{1}", "", oldPlot.PlotDef.ID);
						}
						else if(hasbidnextavailable)
						{
							// You are still bidding on the next available stall.
							cliloc2 = 1150581;
							args2 = null;
						}
						else
						{
							cliloc2 = 1150541;
							args2 = "You have no active bids.";
						}
					}
					else
					{
						/*You have posted a new bid of ~2_NEWBID~gp. The funds have been 
						*withdrawn from your bank box. Your previous bank balance was 
						*~4_OLDBAL~gp and your new bank balance is ~5_NEWBAL~gp.*/
						cliloc1 = 1150578;
						args1 = String.Format("{0}\t{1}\t{2}\t{3}\t{4}", "", FormatAmt(newBid), "", FormatAmt(bankBal), FormatAmt(bankBal - newBid));

                        Banker.Withdraw(from, newBid);
						MaginciaBazaar.MakeBidNextAvailable(from, newBid);
						
						if(hasbidspecific)				// Change from specific to next available
						{
							// You were previously bidding on Stall ~1_OLDSTALL~, and now you are bidding on the first available stall.
							cliloc2 = 1150580;
							args2 = oldPlot.PlotDef.ID;
						}
						else if(hasbidnextavailable)	// stays as next available
						{
							// You are still bidding on the next available stall.
							cliloc2 = 1150581;
							args2 = null;
						}
						else							// First time bid
						{
							// You are now bidding on the next available stall.
							cliloc2 = 1150584;
							args2 = null;
						}
					}
				}
			}

            //string args1 = String.Format("{0}\t{1}\t{2}\t{3}\t{4}\t{5}", );

            if(cliloc1 > 0)
			    AddHtmlLocalized(10, 100, 500, 120, cliloc1, args1, GreenColor16, false, false);

            if (cliloc2 > 0)
            {
                if (args2 != null)
                    AddHtmlLocalized(10, 240, 500, 100, cliloc2, args2, GreenColor16, false, false);
                else
                    AddHtmlLocalized(10, 240, 500, 100, cliloc2, GreenColor16, false, false);
            }
			
			AddHtmlLocalized(50, 490, 150, 18, 1150556, BlueColor16, false, false); // MY STALL BID
			AddButton(10, 490, 4005, 4007, 1, GumpButtonType.Reply, 0);
			
		}
Example #23
0
		public ConfirmFireBrokerGump(Mobile from, MaginciaBazaarPlot plot) 
		{
			m_Plot = plot;
			m_HasInventory = false;
			
			if(plot.Merchant is PetBroker)
			{
				PetBroker broker = (PetBroker)plot.Merchant;

                if (broker.BrokerEntries.Count > 0 || broker.BankBalance > 0)
					m_HasInventory = true;
			}
			else if (plot.Merchant is CommodityBroker)
			{
				CommodityBroker broker = (CommodityBroker)plot.Merchant;
				
				if(broker.CommodityEntries.Count > 0 || broker.BankBalance > 0)
					m_HasInventory = true;
			}
			
			AddHtmlLocalized(195, 5, 150, 18, 1150385, RedColor16, false, false);     // New Magincia Bazaar
			AddHtmlLocalized(217, 40, 150, 18, 1150386, RedColor16, false, false);    // Stall Leasing
			
			/*In order to fire your broker, you must empty its inventory, withdraw all 
			 *funds, and remove any of your personal items from the broker and stall. 
			 *When ready, return to this menu selection to confirm.*/
			 
			 /*This option will release your hired broker from service and vacate your 
			  *stall. You will then be able to hire a different broker. Click the 
			  *CONFIRM button below if you wish to clear out your stall.*/
			
			AddHtmlLocalized(10, 100, 500, 100, m_HasInventory ? 1150691 : 1150692, RedColor16, false, false);
			
			if(!m_HasInventory)
			{
				AddHtmlLocalized(215, 350, 150, 18, 1150695, OrangeColor16, false, false); // CONFIRM
				AddButton(175, 350, 4005, 4007, 1, GumpButtonType.Reply, 0);
			}
		}
Example #24
0
 public PlotSign(MaginciaBazaarPlot plot)
     : base(3025)
 {
     Movable = false;
     m_Plot = plot;
 }
Example #25
0
		public ConfirmAddMultiGump(Mobile from, MaginciaBazaarPlot plot, bool commodity)
		{
			m_Plot = plot;
			m_Commodity = commodity;

            AddHtmlLocalized(195, 5, 150, 18, 1150385, RedColor16, false, false);     // New Magincia Bazaar
            AddHtmlLocalized(217, 40, 150, 18, 1150386, RedColor16, false, false);    // Stall Leasing
			
			AddHtmlLocalized(200, 100, 150, 18, m_Commodity ? 1150687 : 1150686, RedColor16, false, false); // HIRE ANIMAL BROKER
			
			AddHtmlLocalized(10, 150, 500, 200, 1150696, RedColor16, false, false); // The selected style is now being...
			
			AddHtmlLocalized(210, 370, 150, 18, 1150697, OrangeColor16, false, false); // CHOOSE OTHER STYLE
			AddButton(175, 370, 4005, 4007, 1, GumpButtonType.Reply, 0);
			
			AddHtmlLocalized(210, 394, 150, 18, 1150695, OrangeColor16, false, false); // CONFIRM
            AddButton(175, 394, 4005, 4007, 2, GumpButtonType.Reply, 0);

            AddButton(10, 490, 4014, 4016, 3, GumpButtonType.Reply, 0);
            AddHtmlLocalized(50, 490, 200, 18, 1149777, BlueColor16, false, false); // MAIN MENU
		}
Example #26
0
        public MaginciaPlotAuction(MaginciaBazaarPlot plot, TimeSpan auctionDuration)
		{
			m_Plot = plot;
			m_AuctionEnd = DateTime.UtcNow + auctionDuration;
		}
Example #27
0
		public TopBidsGump(Mobile from, MaginciaBazaarPlot plot)
		{
			m_Plot = plot;

            AddHtmlLocalized(195, 5, 150, 18, 1150385, RedColor16, false, false);     // New Magincia Bazaar
            AddHtmlLocalized(217, 40, 150, 18, 1150386, RedColor16, false, false);    // Stall Leasing
			
			AddHtmlLocalized(173, 100, 173, 18, 1150562, plot.PlotDef.ID, RedColor16, false, false); // <DIV ALIGN=CENTER>Viewing top bids for stall <b>~1_STALLNAME~</b>
			
			if(m_Plot.Auction == null || m_Plot.Auction.Auctioners.Count == 0)
				AddHtmlLocalized(60, 150, 300, 18, 1150563, BlueColor16, false, false); // There are currently no bids to lease this stall.
			else
			{
				List<BidEntry> list = new List<BidEntry>(m_Plot.Auction.Auctioners.Values);
				list.Sort();
				int y = 150;
				
				for(int i = 0; i < list.Count; i++)
				{
					AddHtml(60, y + (i * 20), 200, 18, Color(FormatAmt(list[i].Amount), OrangeColor), false, false);
					
					if(i >= 10)
						break;
				}
			}

            AddButton(10, 490, 4014, 4016, 1, GumpButtonType.Reply, 0);
            AddHtmlLocalized(50, 490, 200, 18, 1149777, BlueColor16, false, false); // MAIN MENU
		}
Example #28
0
		public CommodityBroker(MaginciaBazaarPlot plot) : base(plot)
		{
		}
Example #29
0
 public MaginciaPlotAuction(MaginciaBazaarPlot plot) : this(plot, MaginciaBazaar.GetShortAuctionTime)
 {
 }
Example #30
0
 public MaginciaPlotAuction(MaginciaBazaarPlot plot, TimeSpan auctionDuration)
 {
     m_Plot       = plot;
     m_AuctionEnd = DateTime.UtcNow + auctionDuration;
 }
Example #31
0
 public PetBroker(MaginciaBazaarPlot plot) : base(plot)
 {
     FollowersMax = 500;
 }
Example #32
0
		public MaginciaPlotAuction(MaginciaBazaarPlot plot) : this(plot, MaginciaBazaar.GetShortAuctionTime)
		{
		}