Example #1
0
		public CommodityBrokerGump(CommodityBroker broker, Mobile from)
		{
			m_Broker = broker;
			
			AddHtmlLocalized(205, 10, 200, 18, 1150636, RedColor16, false, false); // Commodity Broker
			
			if(m_Broker.Plot.ShopName != null && m_Broker.Plot.ShopName.Length > 0)
				AddHtml(173, 40, 173, 18, Color(FormatStallName(m_Broker.Plot.ShopName), BlueColor), false, false);
			else
				AddHtmlLocalized(180, 40, 200, 18, 1150314, BlueColor16, false, false); // This Shop Has No Name

            AddHtml(173, 65, 173, 18, Color(FormatBrokerName(String.Format("Proprieter: {0}", broker.Name)), BlueColor), false, false);
			
			AddHtmlLocalized(215, 100, 200, 18, 1150328, GreenColor16, false, false); // OWNER MENU
			
			AddButton(150, 150, 4005, 4007, 1, GumpButtonType.Reply, 0);
			AddHtmlLocalized(190, 150, 200, 18, 1150392, OrangeColor16, false, false); // INFORMATION
			
			AddHtmlLocalized(38, 180, 200, 18, 1150199, RedColor16, false, false); // Broker Account Balance
			AddHtml(190, 180, 300, 18, FormatAmt(broker.BankBalance), false, false);
			
			int balance = Banker.GetBalance(from);
			AddHtmlLocalized(68, 200, 200, 18, 1150149, GreenColor16, false, false); // Your Bank Balance:
			AddHtml(190, 200, 200, 18, FormatAmt(balance), false, false);
			
			AddHtmlLocalized(32, 230, 200, 18, 1150329, OrangeColor16, false, false); // Broker Sales Comission
            AddHtmlLocalized(190, 230, 100, 18, 1150330, 0x000000, false, false); // 5%
			
			AddHtmlLocalized(109, 250, 200, 18, 1150331, OrangeColor16, false, false); // Weekly Fee:
			AddHtml(190, 250, 100, 18, FormatAmt(broker.GetWeeklyFee()), false, false);
			
			AddHtmlLocalized(113, 280, 200, 18, 1150332, OrangeColor16, false, false); // Shop Name:
            AddBackground(190, 280, 285, 22, 9350);
			AddTextEntry(191, 280, 285, 20, LabelHueBlue, 0, m_Broker.Plot.ShopName == null ? "" : m_Broker.Plot.ShopName);
			AddButton(480, 280, 4014, 4016, 2, GumpButtonType.Reply, 0);
			
			AddHtmlLocalized(85, 305, 150, 18, 1150195, OrangeColor16, false, false); // Withdraw Funds
            AddBackground(190, 305, 285, 22, 9350);
			AddTextEntry(191, 305, 285, 20, LabelHueBlue, 1, "");
            AddButton(480, 305, 4014, 4016, 3, GumpButtonType.Reply, 0);
			
			AddHtmlLocalized(97, 330, 150, 18, 1150196, OrangeColor16, false, false); // Deposit Funds
            AddBackground(190, 330, 285, 22, 9350);
			AddTextEntry(191, 330, 285, 20, LabelHueBlue, 2, "");
            AddButton(480, 330, 4014, 4016, 4, GumpButtonType.Reply, 0);

            AddButton(150, 365, 4005, 4007, 5, GumpButtonType.Reply, 0);
			AddHtmlLocalized(190, 365, 200, 18, 1150192, OrangeColor16, false, false); // ADD TO INVENTORY

            AddButton(150, 390, 4005, 4007, 6, GumpButtonType.Reply, 0);
			AddHtmlLocalized(190, 390, 300, 18, 1150193, OrangeColor16, false, false); // VIEW INVENTORY / REMOVE ITEMS

            AddButton(150, 415, 4005, 4007, 7, GumpButtonType.Reply, 0);
			AddHtmlLocalized(190, 415, 300, 18, 1150194, OrangeColor16, false, false); // SET PRICES AND LIMITS
		}
Example #2
0
		/*	SellPricePer - price per unit the broker is selling to players for
		 *	BuyPricePer - price per unit the borker is buying from players for
		 *	BuyAtLimit - Limit a commodity must go below before it will buy that particular commodity
         *	
		 *	SellAtLimit - Limit a commodty must go above before it will sell that particular commodity
		 *	BuyLimit - Limit (in units) it will buy from players
		 *	SellLimit - Limit (in units) it will sell to players
		 */
		public CommodityBrokerEntry (Item item, CommodityBroker broker, int amount)
		{
			m_CommodityType = item.GetType();
            m_ItemID = item.ItemID;
            m_Broker = broker;
            m_Stock = amount;
			
			if(item is ICommodity)
				m_Label = ((ICommodity)item).DescriptionNumber;
			else
				m_Label = item.LabelNumber;
		}
Example #3
0
        public ViewInventoryGump(CommodityBroker broker, int index, int page)
            : base(660, 520)
        {
            m_Broker = broker;
            m_Index  = index;
            m_Page   = page;

            AddHtmlLocalized(10, 10, 640, 18, 1114513, "#1150636", RedColor16, false, false); // Commodity Broker
            AddHtmlLocalized(10, 40, 640, 60, 1150641, OrangeColor16, false, false);          // Click the button next to the commodity...

            AddHtmlLocalized(235, 125, 150, 18, 1150140, OrangeColor16, false, false);        // ITEM
            AddHtmlLocalized(360, 125, 150, 18, 1150201, OrangeColor16, false, false);        // IN STOCK
            AddHtmlLocalized(440, 125, 150, 18, 1150639, OrangeColor16, false, false);        // SELECT
            AddHtmlLocalized(540, 125, 150, 18, 1150855, OrangeColor16, false, false);        // DOWN
            AddHtmlLocalized(600, 125, 150, 18, 1150856, OrangeColor16, false, false);        // UP

            int y       = 150;
            int perPage = 10;

            if (index > -1)
            {
                m_Page = index <= 0 ? 0 : index / perPage;
            }

            int start = page * perPage;
            int count = 1;

            for (int i = start; i < broker.CommodityEntries.Count && /*index <= perPage &&*/ count <= perPage; i++)
            {
                int col   = i == m_Index ? YellowColor : OrangeColor;
                int col16 = col == YellowColor ? YellowColor16 : OrangeColor16;
                CommodityBrokerEntry entry = broker.CommodityEntries[i];

                AddHtmlLocalized(1, y, 260, 18, 1114514, string.Format("#{0}", entry.Label), col16, false, false); // <DIV ALIGN=RIGHT>~1_TOKEN~</DIV>
                AddHtml(360, y, 55, 18, Color(AlignRight(FormatAmt(entry.Stock)), col), false, false);

                AddButton(440, y, 4014, 4016, 1000 + i, GumpButtonType.Reply, 0); // SELECT

                if (i > 0)
                {
                    AddButton(600, y, 250, 251, 1500 + i, GumpButtonType.Reply, 0); // UP
                }
                if (i < broker.CommodityEntries.Count - 1)
                {
                    AddButton(540, y, 252, 253, 2000 + i, GumpButtonType.Reply, 0); // DOWN
                }
                y += 20;
                count++;
            }

            if (m_Page > 0) // back
            {
                AddButton(162, 350, 4014, 4016, 400, GumpButtonType.Reply, 0);
            }

            if (broker.CommodityEntries.Count - start > perPage) // forward
            {
                AddButton(390, 350, 4005, 4007, 401, GumpButtonType.Reply, 0);
            }

            AddHtmlLocalized(160, 415, 150, 18, 1150202, OrangeColor16, false, false); // WITHDRAW
            AddBackground(250, 415, 360, 22, 9350);
            AddTextEntry(251, 415, 358, 20, LabelHueBlue, 0, "");
            AddButton(620, 415, 4014, 4016, 1, GumpButtonType.Reply, 0);

            if (index > -1)
            {
                AddHtml(50, 460, 200, 18, Color("Remove from Inventory", RedColor), false, false);
                AddButton(10, 460, 4020, 4022, 3, GumpButtonType.Reply, 0);
            }

            AddButton(10, 490, 4014, 4016, 501, GumpButtonType.Reply, 0);
            AddHtmlLocalized(50, 490, 100, 18, 1149777, BlueColor16, false, false); // MAIN MENU
        }
Example #4
0
 public ViewInventoryGump(CommodityBroker broker) : this(broker, -1)
 {
 }
Example #5
0
 public ViewInventoryGump(CommodityBroker broker, int index) : this(broker, index, 0)
 {
 }
Example #6
0
 public InternalTarget(CommodityBroker broker) : this(broker, false)
 {
 }
Example #7
0
        public SetPricesAndLimitsGump(CommodityBroker broker, int index, int page)
            : base(520, 520)
        {
            m_Broker = broker;
            m_Index  = index;
            m_Page   = page;

            AddHtmlLocalized(10, 10, 500, 18, 1114513, "#1150636", RedColor16, false, false);  // Commodity Broker

            AddButton(150, 40, 4005, 4007, 1, GumpButtonType.Reply, 0);
            AddHtmlLocalized(190, 40, 200, 18, 1150392, OrangeColor16, false, false); // INFORMATION

            AddHtmlLocalized(100, 65, 100, 18, 1150140, OrangeColor16, false, false); // ITEM
            AddHtmlLocalized(170, 65, 100, 18, 1150204, OrangeColor16, false, false); // BUY AT
            AddHtmlLocalized(230, 65, 100, 18, 1150645, OrangeColor16, false, false); // BUY LMT
            AddHtmlLocalized(315, 65, 100, 18, 1150205, OrangeColor16, false, false); // SELL AT
            AddHtmlLocalized(380, 65, 100, 18, 1150646, OrangeColor16, false, false); // SELL LMT
            AddHtmlLocalized(475, 65, 100, 18, 1150647, OrangeColor16, false, false); // EDIT

            int y       = 85;
            int perPage = 10;

            if (index > -1)
            {
                m_Page = index <= 0 ? 0 : index / perPage;
            }

            int start = page * perPage;
            int count = 1;

            for (int i = start; i < broker.CommodityEntries.Count && /*index <= perPage * (m_Page + 1) &&*/ count <= perPage; i++)
            {
                int col   = i == m_Index ? YellowColor : OrangeColor;
                int col16 = col == YellowColor ? YellowColor16 : OrangeColor16;
                CommodityBrokerEntry entry = broker.CommodityEntries[i];

                AddHtmlLocalized(1, y, 130, 18, 1114514, string.Format("#{0}", entry.Label), col16, false, false); // <DIV ALIGN=RIGHT>~1_TOKEN~</DIV>
                AddHtml(170, y, 45, 18, Color(AlignRight(FormatAmt(entry.BuyPricePer)), col), false, false);
                AddHtml(230, y, 80, 18, Color(AlignRight(FormatAmt(entry.BuyLimit)), col), false, false);
                AddHtml(315, y, 45, 18, Color(AlignRight(FormatAmt(entry.SellPricePer)), col), false, false);
                AddHtml(380, y, 80, 18, Color(AlignRight(FormatAmt(entry.SellLimit)), col), false, false);

                AddButton(475, y, 4014, 4016, 2 + i, GumpButtonType.Reply, 0);

                y += 22;
                count++;
            }

            if (m_Page > 0) // back
            {
                AddButton(162, 321, 4014, 4016, 400, GumpButtonType.Reply, 0);
            }

            if (broker.CommodityEntries.Count - start > perPage) // forward
            {
                AddButton(390, 321, 4005, 4007, 401, GumpButtonType.Reply, 0);
            }

            AddHtmlLocalized(124, 345, 100, 18, 1150204, BlueColor16, false, false); // BUY AT
            AddBackground(190, 345, 300, 18, 9350);
            AddTextEntry(191, 344, 320, 22, LabelHueBlue, 0, "");

            AddHtmlLocalized(114, 370, 100, 18, 1150645, BlueColor16, false, false); // BUY LMT
            AddBackground(190, 370, 300, 18, 9350);
            AddTextEntry(191, 369, 320, 22, LabelHueBlue, 1, "");

            AddHtmlLocalized(118, 395, 100, 18, 1150205, BlueColor16, false, false); // SELL AT
            AddBackground(190, 395, 300, 18, 9350);
            AddTextEntry(191, 394, 320, 22, LabelHueBlue, 2, "");

            AddHtmlLocalized(108, 420, 100, 18, 1150646, BlueColor16, false, false); // SELL LMT
            AddBackground(190, 420, 300, 18, 9350);
            AddTextEntry(191, 419, 320, 22, LabelHueBlue, 3, "");

            AddButton(140, 450, 4005, 4007, 500, GumpButtonType.Reply, 0);
            AddHtmlLocalized(190, 450, 200, 18, 1150232, RedColor16, false, false); // SET PRICES

            AddButton(10, 490, 4014, 4016, 501, GumpButtonType.Reply, 0);
            AddHtmlLocalized(50, 490, 100, 18, 1149777, BlueColor16, false, false); // MAIN MENU
        }
Example #8
0
		public CommodityBrokerEntry(GenericReader reader)
		{
			int version = reader.ReadInt();
			
			m_CommodityType = ScriptCompiler.FindTypeByName(reader.ReadString());
            m_Label = reader.ReadInt();
            m_Broker = reader.ReadMobile() as CommodityBroker;
            m_ItemID = reader.ReadInt();
			m_SellPricePer = reader.ReadInt();
			m_BuyPricePer = reader.ReadInt();
			m_BuyLimit = reader.ReadInt();
			m_SellLimit = reader.ReadInt();
			m_Stock = reader.ReadInt();
		}
Example #9
0
		public CommodityTargetGump(CommodityBroker broker)
		{
			m_Broker = broker;
			
			/* Target commodity items or filled commodity deeds in your backpack to add them to the 
			 * broker's inventory. These items will be retrievable, and the broker will not trade them 
			 * until you establish prices.<br><br>When done, press the [ESC] key to cancel your targeting 
			 * cursor, or click the MAIN MENU button below.*/
			 
			AddHtmlLocalized(10, 50, 500, 400, 1150209, OrangeColor16, false, false);

            AddButton(10, 490, 4014, 4016, 1, GumpButtonType.Reply, 0);
            AddHtmlLocalized(50, 490, 200, 18, 1149777, BlueColor16, false, false); // MAIN MENU
		}
Example #10
0
		public CommodityInventoryGump(CommodityBroker broker) : this(broker, -1, true, 0)
		{
		}
Example #11
0
		public CommodityInventoryGump(CommodityBroker broker, int index, bool buy, int page) : base(655, 520)
		{
			m_Broker = broker;
			m_Entries = broker.CommodityEntries;
			m_Buy = buy;
			m_Page = page;
			m_Index = index;
			
            AddHtmlLocalized(205, 10, 200, 18, 1150636, RedColor16, false, false); // Commodity Broker

            if (m_Broker.Plot.ShopName != null && m_Broker.Plot.ShopName.Length > 0)
                AddHtml(173, 40, 173, 18, Color(FormatStallName(m_Broker.Plot.ShopName), BlueColor), false, false); // "~1_NAME~"
            else
                AddHtmlLocalized(180, 40, 200, 18, 1150314, BlueColor16, false, false); // This Shop Has No Name

            AddHtml(173, 65, 173, 18, Color(FormatBrokerName(String.Format("Proprietor: {0}", broker.Name)), BlueColor), false, false);
			
			AddButton(150, 100, 4005, 4007, 1, GumpButtonType.Reply, 0);
			AddHtmlLocalized(190, 100, 150, 18, 1150392, OrangeColor16, false, false); // INFORMATION

            AddHtmlLocalized(10, 125, 75, 18, 1150656, OrangeColor16, false, false); // BUY
            AddHtmlLocalized(60, 125, 75, 18, 1150659, OrangeColor16, false, false); // PRICE
            AddHtmlLocalized(120, 125, 75, 18, 1150658, OrangeColor16, false, false); // LIMIT
            AddHtmlLocalized(330, 125, 75, 18, 1150655, OrangeColor16, false, false); // COMMODITY
            AddHtmlLocalized(490, 125, 75, 18, 1150659, OrangeColor16, false, false); // PRICE
            AddHtmlLocalized(550, 125, 75, 18, 1150658, OrangeColor16, false, false); // LIMIT
            AddHtmlLocalized(610, 125, 75, 18, 1150657, OrangeColor16, false, false); // SELL
			
			int y = 150;
			int perPage = 10;
			
			if(index > -1)
				m_Page = index <= 0 ? 0 : index / perPage;
				
			int start = page * perPage;
			int count = 0;
			
			for(int i = start; i < m_Entries.Count && /*index < perPage*/ count <= perPage; i++)
			{
				CommodityBrokerEntry entry = m_Entries[i];
				
				int buyCol = index == i && buy ? YellowColor : OrangeColor;
				int sellCol = index == i && !buy ? YellowColor : OrangeColor;
				int stock = entry.Stock;
				
				int buyLimit = entry.ActualSellLimit;
				int sellLimit = entry.ActualBuyLimit;
				string buyAmount = entry.SellPricePer > 0 ? FormatAmt(entry.SellPricePer) : "N/A";
				string sellAmount = entry.BuyPricePer > 0 ? FormatAmt(entry.BuyPricePer) : "N/A";
				
				// Sell to player
				AddHtml(60, y, 60, 18, Color(buyAmount, buyCol), false, false);
				if(entry.SellPricePer > 0 && entry.SellLimit > 0)
					AddHtml(120, y, 150, 18, Color(FormatAmt(buyLimit), buyCol), false, false);
				
				// what we're selling/buying
                AddHtmlLocalized(200, y, 215, 18, 1114514, String.Format("#{0}", entry.Label), OrangeColor16, false, false); // <DIV ALIGN=RIGHT>~1_TOKEN~</DIV>
				
				// buy from player
				AddHtml(490, y, 75, 18, AlignRight(Color(sellAmount, sellCol)), false, false);
				if(entry.BuyPricePer > 0 && entry.BuyLimit > 0)
					AddHtml(550, y, 150, 18, AlignRight(Color(FormatAmt(sellLimit), sellCol)), false, false);
				
				//Buttons
				if(entry.PlayerCanBuy(0))
					AddButton(10, y, 4005, 4007, 2 + i, GumpButtonType.Reply, 0);
					
				if(entry.PlayerCanSell(0))
					AddButton(610, y, 4014, 4016, 102 + i, GumpButtonType.Reply, 0);
					
				y += 22;
				count++;
			}

            if (m_Page > 0) // back
            {
                AddHtmlLocalized(100, 410, 150, 18, 1044044, OrangeColor16, false, false);
                AddButton(60, 410, 4014, 4016, 400, GumpButtonType.Reply, 0);
            }

            if (m_Entries.Count - start > perPage) // forward
            {
                AddHtmlLocalized(340, 410, 150, 18, 1044045, OrangeColor16, false, false);
                AddButton(425, 410, 4005, 4007, 401, GumpButtonType.Reply, 0);
            }

            AddHtmlLocalized(240, 445, 150, 18, 1150662, BlueColor16, false, false); // QUANTITY
			AddBackground(315, 445, 325, 22, 9350);
			AddTextEntry(316, 445, 300, 20, 0, 0, "");
				
			AddButton(275, 470, 4005, 4007, 500, GumpButtonType.Reply, 0);
            AddHtmlLocalized(315, 470, 100, 18, 1077761, OrangeColor16, false, false); // TRADE
		}
Example #12
0
		public ViewInventoryGump(CommodityBroker broker, int index) : this(broker, index, 0)
		{
		}
Example #13
0
		public ViewInventoryGump(CommodityBroker broker, int index, int page)
		{
			m_Broker = broker;
			m_Index = index;
			m_Page = page;
			
			AddHtmlLocalized(205, 10, 200, 18, 1150636, RedColor16, false, false); // Commodity Broker
            AddHtmlLocalized(10, 30, 500, 60, 1150867, OrangeColor16, false, false); // Click the button next to the commodity...
			
			AddHtmlLocalized(150, 100, 150, 18, 1150140, OrangeColor16, false, false); // ITEM
			AddHtmlLocalized(240, 100, 150, 18, 1150201, OrangeColor16, false, false); // IN STOCK
			AddHtmlLocalized(320, 100, 150, 18, 1150639, OrangeColor16, false, false); // SELECT
			AddHtmlLocalized(420, 100, 150, 18, 1150855, OrangeColor16, false, false); // DOWN
			AddHtmlLocalized(480, 100, 150, 18, 1150856, OrangeColor16, false, false); // UP
			
			int y = 125;
			int perPage = 10;
			
			if(index > -1)
				m_Page = index <= 0 ? 0 : index / perPage;

			int start = page * perPage;
			int count = 1;
			
			for(int i = start; i < broker.CommodityEntries.Count && /*index <= perPage &&*/ count <= perPage; i++)
			{
				int col = i == m_Index ? YellowColor : OrangeColor;
                int col16 = col == YellowColor ? YellowColor16 : OrangeColor16;
				CommodityBrokerEntry entry = broker.CommodityEntries[i];
				
                AddHtmlLocalized(1, y, 180, 18, 1114514, String.Format("#{0}", entry.Label), col16, false, false); // <DIV ALIGN=RIGHT>~1_TOKEN~</DIV>
				AddHtml(240, y, 100, 18, AlignRight(Color(FormatAmt(entry.Stock), col)), false, false);
				
				AddButton(320, y, 4014, 4016, 1000 + i, GumpButtonType.Reply, 0); // SELECT
				
				if(i > 0)
                    AddButton(480, y, 250, 251, 1500 + i, GumpButtonType.Reply, 0); // UP
					
				if(i < broker.CommodityEntries.Count - 1)
                    AddButton(420, y, 252, 253, 2000 + i, GumpButtonType.Reply, 0); // DOWN
					
				y += 22;
				count++;
			}
			
			if(m_Page > 0) // back
				AddButton(162, 350, 4014, 4016, 400, GumpButtonType.Reply, 0);
				
			if(broker.CommodityEntries.Count - start > perPage) // forward
				AddButton(390, 350, 4005, 4007, 401, GumpButtonType.Reply, 0);
			
			AddHtmlLocalized(108, 415, 150, 18, 1150202, OrangeColor16, false, false); // WITHDRAW
			AddBackground(190, 415, 285, 22, 9350);
			AddTextEntry(191, 415, 284, 20, 0, 0, "");
			AddButton(480, 415, 4014, 4016, 1, GumpButtonType.Reply, 0);

            if (index > -1)
            {
                AddHtml(50, 460, 200, 18, Color("Remove from Inventory", RedColor), false, false);
                AddButton(10, 460, 4020, 4022, 3, GumpButtonType.Reply, 0);
            }

            AddButton(10, 490, 4014, 4016, 501, GumpButtonType.Reply, 0);
            AddHtmlLocalized(50, 490, 100, 18, 1149777, BlueColor16, false, false); // MAIN MENU
		}
Example #14
0
		public ViewInventoryGump(CommodityBroker broker) : this(broker, -1)
		{
		}
Example #15
0
		public SetPricesAndLimitsGump(CommodityBroker broker, int index, int page)
		{
			m_Broker = broker;
			m_Index = index;
			m_Page = page;

            AddHtmlLocalized(205, 10, 200, 18, 1150636, RedColor16, false, false); // Commodity Broker
			
			AddButton(150, 40, 4005, 4007, 1, GumpButtonType.Reply, 0);
			AddHtmlLocalized(190, 40, 200, 18, 1150392, OrangeColor16, false, false); // INFORMATION
		
			AddHtmlLocalized(120, 65, 100, 18, 1150140, OrangeColor16, false, false); // ITEM
            AddHtmlLocalized(160, 65, 100, 18, 1150204, OrangeColor16, false, false); // BUY AT
            AddHtmlLocalized(220, 65, 100, 18, 1150645, OrangeColor16, false, false); // BUY LMT
            AddHtmlLocalized(315, 65, 100, 18, 1150205, OrangeColor16, false, false); // SELL AT
            AddHtmlLocalized(380, 65, 100, 18, 1150646, OrangeColor16, false, false); // SELL LMT
            AddHtmlLocalized(475, 65, 100, 18, 1150647, OrangeColor16, false, false); // EDIT
			
			int y = 85;
			int perPage = 10;
			
			if(index > -1)
				m_Page = index <= 0 ? 0 : index / perPage;

			int start = page * perPage;
            int count = 1;
			
			for(int i = start; i < broker.CommodityEntries.Count && /*index <= perPage * (m_Page + 1) &&*/ count <= perPage; i++)
			{	
				int col = i == m_Index ? YellowColor : OrangeColor;
                int col16 = col == YellowColor ? YellowColor16 : OrangeColor16;
				CommodityBrokerEntry entry = broker.CommodityEntries[i];

                AddHtmlLocalized(1, y, 150, 18, 1114514, String.Format("#{0}", entry.Label), col16, false, false); // <DIV ALIGN=RIGHT>~1_TOKEN~</DIV>
				AddHtml(160, y, 45, 18, AlignRight(Color(FormatAmt(entry.BuyPricePer), col)), false, false);
				AddHtml(220, y, 45, 18, AlignRight(Color(FormatAmt(entry.BuyLimit), col)), false, false);
				AddHtml(315, y, 80, 18, Color(FormatAmt(entry.SellPricePer), col), false, false);
				AddHtml(380, y, 80, 18, Color(FormatAmt(entry.SellLimit), col), false, false);
				
				AddButton(475, y, 4014, 4016, 2 + i, GumpButtonType.Reply, 0);
					
				y += 22;
                count++;
			}
			
			if(m_Page > 0) // back
				AddButton(162, 321, 4014, 4016, 400, GumpButtonType.Reply, 0);
				
			if(broker.CommodityEntries.Count - start > perPage) // forward
				AddButton(390, 321, 4005, 4007, 401, GumpButtonType.Reply, 0);
			
			AddHtmlLocalized(124, 345, 100, 18, 1150204, BlueColor16, false, false); // BUY AT
			AddBackground(190, 345, 300, 18, 9350);
            AddTextEntry(191, 344, 320, 22, LabelHueBlue, 0, "");
				
			AddHtmlLocalized(114, 370, 100, 18, 1150645, BlueColor16, false, false); // BUY LMT
			AddBackground(190, 370, 300, 18, 9350);
            AddTextEntry(191, 369, 320, 22, LabelHueBlue, 1, "");
				
			AddHtmlLocalized(118, 395, 100, 18, 1150205, BlueColor16, false, false); // SELL AT
			AddBackground(190, 395, 300, 18, 9350);
            AddTextEntry(191, 394, 320, 22, LabelHueBlue, 2, "");
				
			AddHtmlLocalized(108, 420, 100, 18, 1150646, BlueColor16, false, false); // SELL LMT
			AddBackground(190, 420, 300, 18, 9350);
            AddTextEntry(191, 419, 320, 22, LabelHueBlue, 3, "");
				
			AddButton(140, 450, 4005, 4007, 500, GumpButtonType.Reply, 0); 
			AddHtmlLocalized(190, 450, 200, 18, 1150232, RedColor16, false, false); // SET PRICES
			
			AddButton(10, 495, 4014, 4016, 501, GumpButtonType.Reply, 0); 
			AddHtmlLocalized(50, 495, 100, 18, 1149777, BlueColor16, false, false); // MAIN MENU
		}
Example #16
0
 public SetPricesAndLimitsGump(CommodityBroker broker) : this(broker, -1, 0) { }
Example #17
0
 public CommodityInventoryGump(CommodityBroker broker) : this(broker, -1, true, 0, 0)
 {
 }
Example #18
0
        public CommodityBrokerGump(CommodityBroker broker, Mobile from)
            : base(520, 520)
        {
            m_Broker = broker;

            AddHtmlLocalized(10, 10, 500, 18, 1114513, "#1150636", RedColor16, false, false);  // Commodity Broker

            if (m_Broker.Plot.ShopName != null && m_Broker.Plot.ShopName.Length > 0)
            {
                AddHtml(10, 37, 500, 18, Color(FormatStallName(m_Broker.Plot.ShopName), BlueColor), false, false);
            }
            else
            {
                AddHtmlLocalized(10, 37, 500, 18, 1114513, "#1150314", BlueColor16, false, false); // This Shop Has No Name
            }

            AddHtmlLocalized(10, 55, 260, 18, 1114514, "#1150313", BlueColor16, false, false); // Proprietor:
            AddHtml(280, 55, 260, 18, Color(String.Format("{0}", broker.Name), BlueColor), false, false);

            AddHtmlLocalized(10, 100, 500, 18, 1114513, "#1150328", GreenColor16, false, false); // OWNER MENU

            AddButton(150, 150, 4005, 4007, 1, GumpButtonType.Reply, 0);
            AddHtmlLocalized(190, 150, 200, 18, 1150392, OrangeColor16, false, false); // INFORMATION

            AddHtmlLocalized(38, 180, 200, 18, 1150199, RedColor16, false, false);     // Broker Account Balance
            AddHtml(190, 180, 300, 18, FormatAmt(broker.BankBalance), false, false);

            int balance = Banker.GetBalance(from);

            AddHtmlLocalized(68, 200, 200, 18, 1150149, GreenColor16, false, false); // Your Bank Balance:
            AddHtml(190, 200, 200, 18, FormatAmt(balance), false, false);

            AddHtmlLocalized(32, 230, 200, 18, 1150329, OrangeColor16, false, false);  // Broker Sales Comission
            AddHtmlLocalized(190, 230, 100, 18, 1150330, OrangeColor16, false, false); // 5%

            AddHtmlLocalized(109, 250, 200, 18, 1150331, OrangeColor16, false, false); // Weekly Fee:
            AddHtml(190, 250, 100, 18, FormatAmt(broker.GetWeeklyFee()), false, false);

            AddHtmlLocalized(113, 280, 200, 18, 1150332, OrangeColor16, false, false); // Shop Name:
            AddBackground(190, 280, 285, 22, 9350);
            AddTextEntry(191, 280, 285, 20, LabelHueBlue, 0, m_Broker.Plot.ShopName == null ? "" : m_Broker.Plot.ShopName);
            AddButton(480, 280, 4014, 4016, 2, GumpButtonType.Reply, 0);

            AddHtmlLocalized(85, 305, 150, 18, 1150195, OrangeColor16, false, false); // Withdraw Funds
            AddBackground(190, 305, 285, 22, 9350);
            AddTextEntry(191, 305, 285, 20, LabelHueBlue, 1, "");
            AddButton(480, 305, 4014, 4016, 3, GumpButtonType.Reply, 0);

            AddHtmlLocalized(97, 330, 150, 18, 1150196, OrangeColor16, false, false); // Deposit Funds
            AddBackground(190, 330, 285, 22, 9350);
            AddTextEntry(191, 330, 285, 20, LabelHueBlue, 2, "");
            AddButton(480, 330, 4014, 4016, 4, GumpButtonType.Reply, 0);

            AddButton(150, 365, 4005, 4007, 5, GumpButtonType.Reply, 0);
            AddHtmlLocalized(190, 365, 200, 18, 1150192, OrangeColor16, false, false); // ADD TO INVENTORY

            AddButton(150, 390, 4005, 4007, 6, GumpButtonType.Reply, 0);
            AddHtmlLocalized(190, 390, 300, 18, 1150193, OrangeColor16, false, false); // VIEW INVENTORY / REMOVE ITEMS

            AddButton(150, 415, 4005, 4007, 7, GumpButtonType.Reply, 0);
            AddHtmlLocalized(190, 415, 300, 18, 1150194, OrangeColor16, false, false); // SET PRICES AND LIMITS
        }
Example #19
0
        public CommodityInventoryGump(CommodityBroker broker, int index, bool buy, int page, int cliloc)
            : base(655, 520)
        {
            m_Broker  = broker;
            m_Entries = broker.CommodityEntries;
            m_Buy     = buy;
            m_Page    = page;
            m_Index   = index;

            AddHtmlLocalized(10, 10, 640, 18, 1114513, "#1150636", RedColor16, false, false);  // Commodity Broker

            if (m_Broker.Plot.ShopName != null && m_Broker.Plot.ShopName.Length > 0)
            {
                AddHtml(10, 37, 640, 18, Color(FormatStallName(m_Broker.Plot.ShopName), BlueColor), false, false);
            }
            else
            {
                AddHtmlLocalized(10, 37, 640, 18, 1114513, "#1150314", BlueColor16, false, false); // This Shop Has No Name
            }

            AddHtmlLocalized(10, 55, 310, 18, 1114514, "#1150313", BlueColor16, false, false); // Proprietor:
            AddHtml(330, 55, 320, 18, Color(string.Format("{0}", broker.Name), BlueColor), false, false);

            if (cliloc != 0)
            {
                if (cliloc == 1150654)
                {
                    /* This broker trades in commodities. Commodity brokers can buy and sell most commodities, either in item or deed form.
                     * The menu shows all commodities this broker will deal in.<BR><BR>The center column lists the commodities by name.
                     * The columns on the left indicate how much of the commodity the broker has available for purchase, and the price per unit.
                     * The right-hand columns indicate how much of the commodity the broker is willing to buy from you and the price it will pay per unit.
                     * <BR><BR>If you wish to buy that commodity, click the button to the left of it to select it, then enter the quantity you wish to buy in the QUANTITY field below.
                     * If you wish to sell a commodity to the broker, click the button to the right of it and enter the quantity you wish to sell below. Finally, click the "TRADE" button.
                     * You will be presented with a confirmation window that will show the item being traded, the quantity, and how much gold will change hands.<BR><BR>If a broker lists a price but shows 0 quantity available,
                     * the broker may be out of stock (unable to sell to you) or may have reached its purchasing limit (unable to buy from you). All gold transactions are between your bank box and the commodity broker.
                     * Gold or bank checks in your backpack cannot be used for these trades. Commodities are traded between your backpack and the broker, and commodity items/deeds in your bank box cannot be used for these trades.
                     */
                    AddHtmlLocalized(10, 127, 640, 354, 1150654, OrangeColor16, true, true);
                }
                else
                {
                    AddHtmlLocalized(10, 127, 640, 354, 1114513, string.Format("#{0}", cliloc), OrangeColor16, false, false);
                }

                AddButton(10, 490, 0xFAE, 0xFAF, 999, GumpButtonType.Reply, 0);
                AddHtmlLocalized(50, 490, 210, 20, 1149777, BlueColor16, false, false); // MAIN MENU
            }
            else
            {
                AddButton(190, 91, 4005, 4007, 1, GumpButtonType.Reply, 0);
                AddHtmlLocalized(230, 91, 420, 22, 1150392, OrangeColor16, false, false);              // INFORMATION

                AddHtmlLocalized(10, 124, 54, 20, 1150656, OrangeColor16, false, false);               // BUY
                AddHtmlLocalized(70, 124, 54, 20, 1150659, OrangeColor16, false, false);               // PRICE
                AddHtmlLocalized(130, 124, 109, 20, 1150658, OrangeColor16, false, false);             // LIMIT
                AddHtmlLocalized(245, 124, 164, 20, 1114513, "#1150655", OrangeColor16, false, false); // COMMODITY
                AddHtmlLocalized(415, 124, 54, 20, 1114514, "#1150659", OrangeColor16, false, false);  // PRICE
                AddHtmlLocalized(475, 124, 109, 20, 1114514, "#1150658", OrangeColor16, false, false); // LIMIT
                AddHtmlLocalized(590, 124, 54, 20, 1114514, "#1150657", OrangeColor16, false, false);  // SELL

                if (m_Entries.Count != 0)
                {
                    int y       = 153;
                    int perPage = 10;

                    if (index > -1)
                    {
                        m_Page = index <= 0 ? 0 : index / perPage;
                    }

                    int start = page * perPage;
                    int count = 0;

                    for (int i = start; i < m_Entries.Count && /*index < perPage*/ count <= perPage; i++)
                    {
                        CommodityBrokerEntry entry = m_Entries[i];

                        int stock     = entry.Stock;
                        int buyLimit  = entry.ActualSellLimit;
                        int sellLimit = entry.ActualBuyLimit;

                        // Sell to player
                        if (entry.SellPricePer > 0)
                        {
                            AddHtml(70, y, 54, 20, Color(FormatAmt(entry.SellPricePer), OrangeColor), false, false);
                        }
                        else
                        {
                            AddHtmlLocalized(70, y, 54, 20, 1150397, OrangeColor16, false, false); // N/A
                        }

                        if (entry.SellPricePer > 0 && entry.SellLimit > 0)
                        {
                            AddHtml(130, y, 109, 20, Color(FormatAmt(buyLimit), OrangeColor), false, false);
                        }

                        // what we're selling/buying
                        AddHtmlLocalized(200, y, 164, 20, 1114514, string.Format("#{0}", entry.Label), OrangeColor16, false, false); // <DIV ALIGN=RIGHT>~1_TOKEN~</DIV>
                        AddTooltip(entry.Label);

                        // buy from player

                        if (entry.BuyPricePer > 0)
                        {
                            AddHtml(415, y, 54, 20, Color(AlignRight(FormatAmt(entry.BuyPricePer)), OrangeColor), false, false);
                        }
                        else
                        {
                            AddHtmlLocalized(415, y, 54, 20, 1150397, OrangeColor16, false, false); // N/A
                        }

                        if (entry.BuyPricePer > 0 && entry.BuyLimit > 0)
                        {
                            AddHtml(475, y, 109, 20, (Color(AlignRight(FormatAmt(sellLimit)), OrangeColor)), false, false);
                        }

                        //Buttons
                        if (entry.PlayerCanBuy(0))
                        {
                            AddRadio(10, y, 0xFA5, 0xFA6, false, 2 + i);
                        }

                        if (entry.PlayerCanSell(0))
                        {
                            AddRadio(590, y, 0xFAE, 0xFAF, false, 102 + i);
                        }

                        y += 20;
                        count++;
                    }

                    if (m_Page > 0) // back
                    {
                        AddButton(60, 362, 0xFAE, 0xFAF, 400, GumpButtonType.Reply, 0);
                        AddHtmlLocalized(100, 362, 230, 40, 1044044, OrangeColor16, false, false); // PREV PAGE
                    }

                    if (m_Entries.Count - start > perPage) // forward
                    {
                        AddButton(570, 362, 0xFA5, 0xFA6, 401, GumpButtonType.Reply, 0);
                        AddHtmlLocalized(330, 362, 230, 40, 1114514, "#1044045", OrangeColor16, false, false); // NEXT PAGE
                    }

                    AddHtmlLocalized(10, 421, 210, 22, 1114514, "#1150662", BlueColor16, false, false); // QUANTITY
                    AddBackground(230, 421, 420, 22, 0x2486);
                    AddTextEntry(232, 423, 416, 18, LabelHueBlue, 0, "");

                    AddButton(190, 445, 4005, 4007, 500, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(230, 445, 420, 22, 1077761, OrangeColor16, false, false); // TRADE
                }
                else
                {
                    AddHtmlLocalized(10, 153, 640, 20, 1114513, "#1150638", OrangeColor16, false, false); // There are no commodities in this broker's inventory.
                }
            }
        }
Example #20
0
 public InternalTarget(CommodityBroker broker, bool haspicked) : base(-1, false, TargetFlags.None)
 {
     m_Broker             = broker;
     m_HasPickedCommodity = haspicked;
 }
Example #21
0
		public ConfirmRemoveEntryGump(CommodityBroker broker, int index)
		{
			m_Broker = broker;
			m_Index = index;

            if (index >= 0 && index < m_Broker.CommodityEntries.Count)
                m_Entry = m_Broker.CommodityEntries[index];
		}
Example #22
0
			public InternalTarget(CommodityBroker broker, bool haspicked) : base(-1, false, TargetFlags.None)
			{
				m_Broker = broker;
                m_HasPickedCommodity = haspicked;
			}
Example #23
0
 public InternalTarget(CommodityBroker broker) : this(broker, false)
 {
 }
Example #24
0
		public ConfirmBuyCommodityGump(CommodityBroker broker, int amount, CommodityBrokerEntry entry, bool buy)
		{
			m_Broker = broker;
			m_Amount = amount;
			m_Entry = entry;

            AddHtmlLocalized(205, 10, 200, 18, 1150636, RedColor16, false, false); // Commodity Broker

            if (m_Broker.Plot.ShopName != null && m_Broker.Plot.ShopName.Length > 0)
                AddHtml(173, 40, 173, 18, Color(FormatStallName(m_Broker.Plot.ShopName), BlueColor), false, false); // "~1_NAME~"
            else
                AddHtmlLocalized(180, 40, 200, 18, 1150314, BlueColor16, false, false); // This Shop Has No Name

            AddHtml(173, 65, 173, 18, Color(FormatBrokerName(String.Format("Proprietor: {0}", broker.Name)), BlueColor), false, false);
			
			AddHtmlLocalized(10, 100, 500, 40, 1150666, RedColor16, false, false); // Please review the details of this transaction. If you wish to make this trade, click the TRADE button below. Otherwise, click the MAIN MENU button to return to the price list.
			
			if(buy)
			{
				int cost = entry.SellPricePer * amount;

				AddHtmlLocalized(10, 150, 260, 18, 1150245, OrangeColor16, false, false); // <DIV ALIGN=RIGHT>You are purchasing:</DIV>
                AddItem(230, 210, m_Broker.GetItemID(entry));
                
                AddHtmlLocalized(110, 350, 150, 18, 1150246, OrangeColor16, false, false); // Total Cost:
				AddHtml(180, 350, 150, 18, Color(FormatAmt(cost), OrangeColor), false, false);
				
				AddHtmlLocalized(170, 380, 120, 18, 1150247, OrangeColor16, false, false); // <DIV ALIGN=RIGHT>PURCHASE</DIV>
				AddButton(180, 380, 4005, 4007, 1, GumpButtonType.Reply, 0);
			}
			else
			{
				int cost = entry.BuyPricePer * amount;

                AddHtmlLocalized(10, 150, 260, 18, 1150250, OrangeColor16, false, false); // <DIV ALIGN=RIGHT>You are selling:</DIV>
                AddItem(230, 210, m_Broker.GetItemID(entry));

                AddHtmlLocalized(50, 350, 160, 18, 1150251, OrangeColor16, false, false); // Gold you will recieve:
				AddHtml(190, 350, 150, 18, Color(FormatAmt(cost), OrangeColor), false, false);
				
				AddHtmlLocalized(200, 380, 60, 18, 1150249, OrangeColor16, false, false); // <DIV ALIGN=RIGHT>SELL</DIV>
				AddButton(190, 380, 4005, 4007, 2, GumpButtonType.Reply, 0);
			}
			
			//AddHtmlLocalized(x, y, 120, 18, 1150248, OrangeColor, false, false); // <DIV ALIGN=RIGHT>CONFIRM</DIV>
		}
Example #25
0
		public void ConfirmMulti(bool commodity)
		{
			EndTempMultiTimer();
			
			if(commodity)
				Merchant = new CommodityBroker(this);
			else
				Merchant = new PetBroker(this);
		}
Example #26
0
 public SetPricesAndLimitsGump(CommodityBroker broker) : this(broker, -1, 0)
 {
 }