Example #1
0
        public MaginciaBazaarPlot(GenericReader reader)
        {
            int version = reader.ReadInt();

            m_Definition = new PlotDef(reader);

            m_Owner     = reader.ReadMobile();
            m_ShopName  = reader.ReadString();
            m_Merchant  = reader.ReadMobile() as BaseBazaarBroker;
            m_Sign      = reader.ReadItem() as PlotSign;
            m_PlotMulti = reader.ReadItem() as BaseBazaarMulti;

            if (reader.ReadBool())
            {
                m_Auction = new MaginciaPlotAuction(reader, this);
            }

            if (m_Merchant != null)
            {
                m_Merchant.Plot = this;
            }

            if (m_Sign != null)
            {
                m_Sign.Plot = this;
            }
        }
Example #2
0
        public void NewAuction(TimeSpan time)
        {
            m_Auction = new MaginciaPlotAuction(this, time);

            if (m_Sign != null)
            {
                m_Sign.InvalidateProperties();
            }
        }
Example #3
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 #4
0
		public MaginciaBazaarPlot(GenericReader reader)
		{
			int version = reader.ReadInt();

            m_Definition = new PlotDef(reader);

			m_Owner = reader.ReadMobile();
			m_ShopName = reader.ReadString();
			m_Merchant = reader.ReadMobile() as BaseBazaarBroker;
			m_Sign = reader.ReadItem() as PlotSign;
			m_PlotMulti = reader.ReadItem() as BaseBazaarMulti;
			
			if(reader.ReadBool())
				m_Auction = new MaginciaPlotAuction(reader, this);
				
			if(m_Merchant != null)
				m_Merchant.Plot = this;

            if (m_Sign != null)
                m_Sign.Plot = this;
		}
Example #5
0
        public void NewAuction(TimeSpan time)
        {
            m_Auction = new MaginciaPlotAuction(this, time);

            if (m_Sign != null)
                m_Sign.InvalidateProperties();
        }
Example #6
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);
                }
            }
		}