public void EndMobileCombine(Mobile from, object o)
        {
            if (o is Item && ((Item)o).IsChildOf(from.Backpack))
            {
                if (o is SmallMobileBOD)
                {
                    SmallMobileBOD small = (SmallMobileBOD)o;

                    LargeMobileBulkEntry entry = null;

                    for (int i = 0; entry == null && i < m_Entries.Length; ++i)
                    {
                        if (m_Entries[i].Details.Type == small.Type)
                        {
                            entry = m_Entries[i];
                        }
                    }

                    if (entry == null)
                    {
                        from.SendLocalizedMessage(1045160);                           // That is not a bulk order for this large request.
                    }
                    else if (m_AmountMax != small.AmountMax)
                    {
                        from.SendLocalizedMessage(1045163);                           // The two orders have different requested amounts and cannot be combined.
                    }
                    else if (small.AmountCur < small.AmountMax)
                    {
                        from.SendLocalizedMessage(1045164);                           // The order to combine with is not completed.
                    }
                    else if (entry.Amount >= m_AmountMax)
                    {
                        from.SendLocalizedMessage(1045166);                           // The maximum amount of requested items have already been combined to this deed.
                    }
                    else
                    {
                        entry.Amount += small.AmountCur;
                        small.Delete();

                        from.SendLocalizedMessage(1045165);                           // The orders have been combined.

                        from.SendGump(new LargeMobileBODGump(from, this));

                        if (!Complete)
                        {
                            BeginMobileCombine(from);
                        }
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1045159);                       // That is not a bulk order.
                }
            }
            else
            {
                from.SendLocalizedMessage(1045158);                   // You must have the item in your backpack to target it.
            }
        }
        public Item Reconstruct()
        {
            SmallMobileBOD bod = null;

            bod = new SmallTamingBOD(m_AmountCur, m_AmountMax, m_Type, m_AnimalName, m_Graphic);

            return(bod);
        }
        public TamingBOBSmallEntry(SmallMobileBOD bod)
        {
            m_Type = bod.Type;

            m_AmountCur  = bod.AmountCur;
            m_AmountMax  = bod.AmountMax;
            m_AnimalName = bod.AnimalName;
            m_Graphic    = bod.Graphic;
        }
Exemple #4
0
        public SmallMobileBODAcceptGump(Mobile from, SmallMobileBOD deed) : base(50, 50)
        {
            m_From = from;
            m_Deed = deed;

            m_From.CloseGump(typeof(LargeBODAcceptGump));
            m_From.CloseGump(typeof(SmallMobileBODAcceptGump));

            AddPage(0);

            AddBackground(25, 10, 430, 264, 5054);

            AddImageTiled(33, 20, 413, 245, 2624);
            AddAlphaRegion(33, 20, 413, 245);

            AddImage(20, 5, 10460);
            AddImage(430, 5, 10460);
            AddImage(20, 249, 10460);
            AddImage(430, 249, 10460);

            AddHtmlLocalized(190, 25, 120, 20, 1045133, 0x7FFF, false, false); // A bulk order
            AddHtmlLocalized(40, 48, 350, 20, 1045135, 0x7FFF, false, false);  // Ah!  Thanks for the goods!  Would you help me out?

            AddLabel(40, 72, 1152, @"Amount to tame:");                        // Amount to make:
            AddLabel(250, 72, 1152, deed.AmountMax.ToString());

            AddHtmlLocalized(40, 96, 120, 20, 1045136, 0x7FFF, false, false);               // Item requested:
            AddItem(385, 96, deed.Graphic);

            string s = deed.AnimalName;

            int capsbreak = s.IndexOfAny("ABCDEFGHIJKLMNOPQRSTUVWXYZ".ToCharArray(), 1);

            if (capsbreak > -1)
            {
                string secondhalf = s.Substring(capsbreak);
                string firsthalf  = s.Substring(0, capsbreak);

                string newname = firsthalf + " " + secondhalf;

                AddLabel(40, 120, 1152, newname.ToString());
            }
            else
            {
                AddLabel(40, 120, 1152, deed.AnimalName.ToString());
            }

            AddHtmlLocalized(40, 216, 350, 20, 1045139, 0x7FFF, false, false);               // Do you want to accept this order?

            AddButton(100, 240, 4005, 4007, 1, GumpButtonType.Reply, 0);
            AddHtmlLocalized(135, 240, 120, 20, 1006044, 0x7FFF, false, false);               // Ok

            AddButton(275, 240, 4005, 4007, 0, GumpButtonType.Reply, 0);
            AddHtmlLocalized(310, 240, 120, 20, 1011012, 0x7FFF, false, false);               // CANCEL
        }
		public SmallMobileBODAcceptGump( Mobile from, SmallMobileBOD deed ) : base( 50, 50 )
		{
			m_From = from;
			m_Deed = deed;

			m_From.CloseGump( typeof( LargeBODAcceptGump ) );
			m_From.CloseGump( typeof( SmallMobileBODAcceptGump ) );

			AddPage( 0 );

			AddBackground( 25, 10, 430, 264, 5054 );

			AddImageTiled( 33, 20, 413, 245, 2624 );
			AddAlphaRegion( 33, 20, 413, 245 );

			AddImage( 20, 5, 10460 );
			AddImage( 430, 5, 10460 );
			AddImage( 20, 249, 10460 );
			AddImage( 430, 249, 10460 );

			AddHtmlLocalized( 190, 25, 120, 20, 1045133, 0x7FFF, false, false ); // A bulk order
			AddHtmlLocalized( 40, 48, 350, 20, 1045135, 0x7FFF, false, false ); // Ah!  Thanks for the goods!  Would you help me out?

			AddLabel( 40, 72, 1152, @"Amount to tame:"); // Amount to make:
			AddLabel( 250, 72, 1152, deed.AmountMax.ToString() );

			AddHtmlLocalized( 40, 96, 120, 20, 1045136, 0x7FFF, false, false ); // Item requested:
			AddItem( 385, 96, deed.Graphic );

			string s = deed.AnimalName;

			int capsbreak = s.IndexOfAny("ABCDEFGHIJKLMNOPQRSTUVWXYZ".ToCharArray(),1);

			if( capsbreak > -1 )
			{
				string secondhalf = s.Substring( capsbreak );
 				string firsthalf = s.Substring(0, capsbreak );

				string newname = firsthalf + " " + secondhalf;

				AddLabel( 40, 120, 1152, newname.ToString() );
			}
			else
			{
				AddLabel( 40, 120, 1152, deed.AnimalName.ToString() );
			}

			AddHtmlLocalized( 40, 216, 350, 20, 1045139, 0x7FFF, false, false ); // Do you want to accept this order?

			AddButton( 100, 240, 4005, 4007, 1, GumpButtonType.Reply, 0 );
			AddHtmlLocalized( 135, 240, 120, 20, 1006044, 0x7FFF, false, false ); // Ok

			AddButton( 275, 240, 4005, 4007, 0, GumpButtonType.Reply, 0 );
			AddHtmlLocalized( 310, 240, 120, 20, 1011012, 0x7FFF, false, false ); // CANCEL
		}
		public SmallMobileBODGump( Mobile from, SmallMobileBOD deed ) : base( 25, 25 )
		{
			m_From = from;
			m_Deed = deed;

			m_From.CloseGump( typeof( LargeBODGump ) );
			m_From.CloseGump( typeof( SmallMobileBODGump ) );

			AddPage( 0 );

			AddBackground( 50, 10, 455, 260, 5054 );
			AddImageTiled( 58, 20, 438, 241, 2624 );
			AddAlphaRegion( 58, 20, 438, 241 );

			AddImage( 45, 5, 10460 );
			AddImage( 480, 5, 10460 );
			AddImage( 45, 245, 10460 );
			AddImage( 480, 245, 10460 );

			AddHtmlLocalized( 225, 25, 120, 20, 1045133, 0x7FFF, false, false ); // A bulk order

			AddLabel( 75, 48, 0x480, @"Amount to tame:"); // Amount to make:
			AddLabel( 275, 48, 1152, deed.AmountMax.ToString() );

			AddHtmlLocalized( 275, 76, 200, 20, 1045153, 0x7FFF, false, false ); // Amount finished:
			AddHtmlLocalized( 75, 72, 120, 20, 1045136, 0x7FFF, false, false ); // Item requested:

			AddItem( 410, 72, deed.Graphic );

			string s = deed.AnimalName;

			int capsbreak = s.IndexOfAny("ABCDEFGHIJKLMNOPQRSTUVWXYZ".ToCharArray(),1);

			if( capsbreak > -1 )
			{
				string secondhalf = s.Substring( capsbreak );
 				string firsthalf = s.Substring(0, capsbreak );

				string newname = firsthalf + " " + secondhalf;

				AddLabel( 75, 96, 0x480, newname.ToString() );
			}
			else
			{
				AddLabel( 75, 96, 0x480, deed.AnimalName.ToString() );
			}
			AddLabel( 275, 96, 0x480, deed.AmountCur.ToString() );

			AddButton( 125, 192, 4005, 4007, 2, GumpButtonType.Reply, 0 );
			AddHtmlLocalized( 160, 192, 300, 20, 1045154, 0x7FFF, false, false ); // Combine this deed with the item requested.

			AddButton( 125, 216, 4005, 4007, 1, GumpButtonType.Reply, 0 );
			AddHtmlLocalized( 160, 216, 120, 20, 1011441, 0x7FFF, false, false ); // EXIT
		}
        public SmallMobileBODGump(Mobile from, SmallMobileBOD deed) : base(25, 25)
        {
            m_From = from;
            m_Deed = deed;

            m_From.CloseGump(typeof(LargeBODGump));
            m_From.CloseGump(typeof(SmallMobileBODGump));

            AddPage(0);

            AddBackground(50, 10, 455, 260, 5054);
            AddImageTiled(58, 20, 438, 241, 2624);
            AddAlphaRegion(58, 20, 438, 241);

            AddImage(45, 5, 10460);
            AddImage(480, 5, 10460);
            AddImage(45, 245, 10460);
            AddImage(480, 245, 10460);

            AddHtmlLocalized(225, 25, 120, 20, 1045133, 0x7FFF, false, false); // A bulk order

            AddLabel(75, 48, 0x480, @"Amount to tame:");                       // Amount to make:
            AddLabel(275, 48, 1152, deed.AmountMax.ToString());

            AddHtmlLocalized(275, 76, 200, 20, 1045153, 0x7FFF, false, false);              // Amount finished:
            AddHtmlLocalized(75, 72, 120, 20, 1045136, 0x7FFF, false, false);               // Item requested:

            AddItem(410, 72, deed.Graphic);

            string s = deed.AnimalName;

            int capsbreak = s.IndexOfAny("ABCDEFGHIJKLMNOPQRSTUVWXYZ".ToCharArray(), 1);

            if (capsbreak > -1)
            {
                string secondhalf = s.Substring(capsbreak);
                string firsthalf  = s.Substring(0, capsbreak);

                string newname = firsthalf + " " + secondhalf;

                AddLabel(75, 96, 0x480, newname.ToString());
            }
            else
            {
                AddLabel(75, 96, 0x480, deed.AnimalName.ToString());
            }
            AddLabel(275, 96, 0x480, deed.AmountCur.ToString());

            AddButton(125, 192, 4005, 4007, 2, GumpButtonType.Reply, 0);
            AddHtmlLocalized(160, 192, 300, 20, 1045154, 0x7FFF, false, false);               // Combine this deed with the item requested.

            AddButton(125, 216, 4005, 4007, 1, GumpButtonType.Reply, 0);
            AddHtmlLocalized(160, 216, 120, 20, 1011441, 0x7FFF, false, false);               // EXIT
        }
 public SmallMobileBODTarget(SmallMobileBOD deed) : base(18, false, TargetFlags.None)
 {
     m_Deed = deed;
 }
		public SmallMobileBODTarget( SmallMobileBOD deed ) : base( 18, false, TargetFlags.None )
		{
			m_Deed = deed;
		}