Beispiel #1
0
        public RemovePetsGump(PetBroker broker, Mobile from, int index)
        {
            m_Broker = broker;
            m_Index  = index;

            AddHtmlLocalized(215, 10, 200, 18, 1150311, RedColor16, false, false);  // Animal Broker
            AddHtmlLocalized(145, 50, 250, 18, 1150337, RedColor16, false, false);  // ADD PET TO BROKER INVENTORY
            AddHtmlLocalized(10, 80, 500, 40, 1150633, GreenColor16, false, false); // Click the button next to a pet to select it, then click the REMOVE PET button below to transfer that pet to your stables.

            m_Broker.CheckInventory();

            int y = 130;

            for (int i = 0; i < broker.BrokerEntries.Count; i++)
            {
                BaseCreature bc  = broker.BrokerEntries[i].Pet;
                int          col = index == i ? YellowColor16 : OrangeColor16;
                AddButton(10, y, 4005, 4007, i + 1, GumpButtonType.Reply, 0);
                AddHtmlLocalized(50, y, 200, 18, 1150340, String.Format("{0}\t{1}", bc.Name, PetBrokerEntry.GetOriginalName(bc)), col, false, false);                 // ~1_NAME~ (~2_type~)

                y += 20;
            }

            AddHtmlLocalized(215, 405, 150, 18, 1150632, OrangeColor16, false, false);             // REMOVE PET
            AddButton(175, 405, 4014, 4016, 501, GumpButtonType.Reply, 0);

            AddButton(10, 490, 4014, 4016, 500, GumpButtonType.Reply, 0);
            AddHtmlLocalized(50, 490, 100, 18, 1149777, BlueColor16, false, false); // MAIN MENU
        }
Beispiel #2
0
        public SetPetPricesGump(PetBroker broker, int index)
        {
            m_Broker = broker;
            m_Index  = index;

            AddHtmlLocalized(215, 10, 200, 18, 1150311, RedColor16, false, false);    // Animal Broker

            AddHtmlLocalized(60, 90, 100, 18, 1150347, OrangeColor16, false, false);  // NAME
            AddHtmlLocalized(220, 90, 100, 18, 1150348, OrangeColor16, false, false); // TYPE
            AddHtmlLocalized(400, 90, 100, 18, 1150349, OrangeColor16, false, false); // PRICE

            m_Broker.CheckInventory();

            int y = 130;

            for (int i = 0; i < broker.BrokerEntries.Count; i++)
            {
                int col = index == i ? YellowColor : OrangeColor;

                PetBrokerEntry entry = broker.BrokerEntries[i];

                AddHtml(60, y, 200, 18, Color(entry.Pet.Name != null ? entry.Pet.Name : "Unknown", col), false, false);
                AddHtml(220, y, 200, 18, Color(entry.TypeName, col), false, false);
                AddHtml(400, y, 200, 18, Color(FormatAmt(entry.SalePrice), col), false, false);
                AddButton(10, y, 4005, 4007, i + 3, GumpButtonType.Reply, 0);

                y += 22;
            }

            int price = index >= 0 && index < broker.BrokerEntries.Count ? broker.BrokerEntries[index].SalePrice : 0;

            AddHtmlLocalized(215, 380, 150, 18, 1150627, BlueColor16, false, false);             // SET PRICE
            AddBackground(215, 405, 295, 22, 9350);
            AddTextEntry(216, 405, 294, 20, 0, 0, FormatAmt(price));
            AddButton(175, 405, 4005, 4007, 500, GumpButtonType.Reply, 0);

            AddButton(10, 490, 4014, 4016, 1, GumpButtonType.Reply, 0);
            AddHtmlLocalized(50, 490, 100, 18, 1149777, BlueColor16, false, false); // MAIN MENU
        }
Beispiel #3
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile from = state.Mobile;

            if (m_Broker == null || m_Broker.Plot == null)
            {
                return;
            }

            switch (info.ButtonID)
            {
            default:
            case 0: return;

            case 1:
                from.SendGump(new PetBrokerGump(m_Broker, from));
                from.SendGump(new BazaarInformationGump(1150311, 1150614));
                return;

            case 2:                     // Set Shop Name
                TextRelay tr   = info.TextEntries[0];
                string    text = tr.Text;

                if (!m_Broker.Plot.TrySetShopName(from, text))
                {
                    from.SendLocalizedMessage(1150775);                             // Shop names are limited to 40 characters in length. Shop names must pass an obscenity filter check. The text you have entered is not valid.
                }
                break;

            case 3:                     // Withdraw Funds
                TextRelay tr1    = info.TextEntries[1];
                string    text1  = tr1.Text;
                int       amount = 0;

                try
                {
                    amount = Convert.ToInt32(text1);
                }
                catch
                {}

                if (amount > 0)
                {
                    m_Broker.TryWithdrawFunds(from, amount);
                }
                break;

            case 4:                     // Deposit Funds
                TextRelay tr2     = info.TextEntries[2];
                string    text2   = tr2.Text;
                int       amount1 = 0;

                try
                {
                    amount1 = Convert.ToInt32(text2);
                }
                catch {}

                if (amount1 > 0)
                {
                    m_Broker.TryDepositFunds(from, amount1);
                }
                break;

            case 5:                     // TRANSFER STABLED PET TO MERCHANT
                if (from.Stabled.Count > 0)
                {
                    from.SendGump(new SelectPetsGump(m_Broker, from));
                }
                else
                {
                    from.SendLocalizedMessage(1150335);                             // You currently have no pets in your stables that can be traded via an animal broker.
                }
                return;

            case 6:                     // TRANSFER MERCHANT INVENTORY TO STABLE
                m_Broker.CheckInventory();
                if (m_Broker.BrokerEntries.Count > 0)
                {
                    if (m_Broker.BankBalance < 0)
                    {
                        from.SendGump(new BazaarInformationGump(1150623, 1150615));
                        return;
                    }
                    from.SendGump(new RemovePetsGump(m_Broker, from));
                }
                else
                {
                    from.SendLocalizedMessage(1150336);                             // The animal broker has no pets in its inventory.
                }
                return;

            case 7:                     // VIEW INVENTORY / EDIT PRICES
                m_Broker.CheckInventory();
                if (m_Broker.BrokerEntries.Count > 0)
                {
                    if (m_Broker.BankBalance < 0)
                    {
                        from.SendGump(new BazaarInformationGump(1150623, 1150615));
                        return;
                    }
                    else
                    {
                        from.SendGump(new SetPetPricesGump(m_Broker));
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1150336);                             // The animal broker has no pets in its inventory.
                }
                return;
            }

            from.SendGump(new PetBrokerGump(m_Broker, from));
        }
Beispiel #4
0
		public SetPetPricesGump(PetBroker broker, int index) 
		{
			m_Broker = broker;
			m_Index = index;

            AddHtmlLocalized(215, 10, 200, 18, 1150311, RedColor16, false, false); // Animal Broker
			
			AddHtmlLocalized(60, 90, 100, 18, 1150347, OrangeColor16, false, false); // NAME
			AddHtmlLocalized(220, 90, 100, 18, 1150348, OrangeColor16, false, false); // TYPE
			AddHtmlLocalized(400, 90, 100, 18, 1150349, OrangeColor16, false, false); // PRICE

            m_Broker.CheckInventory();

			int y = 130;
			for(int i = 0; i < broker.BrokerEntries.Count; i++)
			{
				int col = index == i ? YellowColor : OrangeColor;
				
				PetBrokerEntry entry = broker.BrokerEntries[i];
				
				AddHtml(60, y, 200, 18, Color(entry.Pet.Name != null ? entry.Pet.Name : "Unknown", col), false, false);
				AddHtml(220, y, 200, 18, Color(entry.TypeName, col), false, false);
				AddHtml(400, y, 200, 18, Color(FormatAmt(entry.SalePrice), col), false, false);
				AddButton(10, y, 4005, 4007, i + 3, GumpButtonType.Reply, 0);
				
				y += 22;
			}

            int price = index >= 0 && index < broker.BrokerEntries.Count ? broker.BrokerEntries[index].SalePrice : 0;

			AddHtmlLocalized(215, 380, 150, 18, 1150627, BlueColor16, false, false); // SET PRICE
			AddBackground(215, 405, 295, 22, 9350);
			AddTextEntry(216, 405, 294, 20, 0, 0, FormatAmt(price));
			AddButton(175, 405, 4005, 4007, 500, GumpButtonType.Reply, 0);

            AddButton(10, 490, 4014, 4016, 1, GumpButtonType.Reply, 0);
            AddHtmlLocalized(50, 490, 100, 18, 1149777, BlueColor16, false, false); // MAIN MENU
		}
Beispiel #5
0
        public RemovePetsGump(PetBroker broker, Mobile from, int index)
		{
			m_Broker = broker;
			m_Index = index;

            AddHtmlLocalized(215, 10, 200, 18, 1150311, RedColor16, false, false); // Animal Broker
            AddHtmlLocalized(145, 50, 250, 18, 1150337, RedColor16, false, false); // ADD PET TO BROKER INVENTORY
			AddHtmlLocalized(10, 80, 500, 40, 1150633, GreenColor16, false, false); // Click the button next to a pet to select it, then click the REMOVE PET button below to transfer that pet to your stables.

            m_Broker.CheckInventory();

			int y = 130;
			for(int i = 0; i < broker.BrokerEntries.Count; i++)
			{
				BaseCreature bc = broker.BrokerEntries[i].Pet;
				int col = index == i ? YellowColor16 : OrangeColor16;
				AddButton(10, y, 4005, 4007, i + 1, GumpButtonType.Reply, 0);
				AddHtmlLocalized(50, y, 200, 18, 1150340, String.Format("{0}\t{1}", bc.Name, PetBrokerEntry.GetOriginalName(bc)), col, false, false); // ~1_NAME~ (~2_type~)
					
				y += 20;
			}
			
			AddHtmlLocalized(215, 405, 150, 18, 1150632, OrangeColor16, false, false); // REMOVE PET
			AddButton(175, 405, 4014, 4016, 501, GumpButtonType.Reply, 0);

            AddButton(10, 490, 4014, 4016, 500, GumpButtonType.Reply, 0);
            AddHtmlLocalized(50, 490, 100, 18, 1149777, BlueColor16, false, false); // MAIN MENU
		}