示例#1
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            if (m_House.Deleted)
            {
                return;
            }

            else if (info.ButtonID == 1)
            {
                if (m_House.SewingKit > 0)
                {
                    m_From.AddToBackpack(new SewingKit(m_House.SewingKit));
                    m_House.SewingKit = (0);
                    m_From.SendGump(new ToolHouseGump(m_From, m_House));
                }
                else
                {
                    m_From.SendGump(new ToolHouseGump(m_From, m_House));
                    m_House.BeginCombine(m_From);
                }
            }
            else if (info.ButtonID == 2)
            {
                if (m_House.MortarPestle > 0)
                {
                    m_From.AddToBackpack(new MortarPestle(m_House.MortarPestle));
                    m_House.MortarPestle = (0);
                    m_From.SendGump(new ToolHouseGump(m_From, m_House));
                }
                else
                {
                    m_From.SendGump(new ToolHouseGump(m_From, m_House));
                    m_House.BeginCombine(m_From);
                }
            }
            else if (info.ButtonID == 3)
            {
                if (m_House.ScribesPen > 0)
                {
                    m_From.AddToBackpack(new ScribesPen(m_House.ScribesPen));
                    m_House.ScribesPen = (0);
                    m_From.SendGump(new ToolHouseGump(m_From, m_House));
                }
                else
                {
                    m_From.SendGump(new ToolHouseGump(m_From, m_House));
                    m_House.BeginCombine(m_From);
                }
            }
            else if (info.ButtonID == 4)
            {
                if (m_House.MalletAndChisel > 0)
                {
                    m_From.AddToBackpack(new MalletAndChisel(m_House.MalletAndChisel));
                    m_House.MalletAndChisel = (0);
                    m_From.SendGump(new ToolHouseGump(m_From, m_House));
                }
                else
                {
                    m_From.SendGump(new ToolHouseGump(m_From, m_House));
                    m_House.BeginCombine(m_From);
                }
            }
            else if (info.ButtonID == 5)
            {
                if (m_House.Carpentry > 0)
                {
                    m_From.AddToBackpack(new Hammer(m_House.Carpentry));
                    m_House.Carpentry = (0);
                    m_From.SendGump(new ToolHouseGump(m_From, m_House));
                }
                else
                {
                    m_From.SendGump(new ToolHouseGump(m_From, m_House));
                    m_House.BeginCombine(m_From);
                }
            }
            else if (info.ButtonID == 6)
            {
                if (m_House.FletcherTools > 0)
                {
                    m_From.AddToBackpack(new FletcherTools(m_House.FletcherTools));
                    m_House.FletcherTools = (0);
                    m_From.SendGump(new ToolHouseGump(m_From, m_House));
                }
                else
                {
                    m_From.SendGump(new ToolHouseGump(m_From, m_House));
                    m_House.BeginCombine(m_From);
                }
            }
            else if (info.ButtonID == 7)
            {
                if (m_House.TinkerTools > 0)
                {
                    m_From.AddToBackpack(new TinkerTools(m_House.TinkerTools));
                    m_House.TinkerTools = (0);
                    m_From.SendGump(new ToolHouseGump(m_From, m_House));
                }
                else
                {
                    m_From.SendGump(new ToolHouseGump(m_From, m_House));
                    m_House.BeginCombine(m_From);
                }
            }
            else if (info.ButtonID == 8)
            {
                if (m_House.BlackSmith > 0)
                {
                    m_From.AddToBackpack(new SmithHammer(m_House.BlackSmith));
                    m_House.BlackSmith = (0);
                    m_From.SendGump(new ToolHouseGump(m_From, m_House));
                }
                else
                {
                    m_From.SendGump(new ToolHouseGump(m_From, m_House));
                    m_House.BeginCombine(m_From);
                }
            }
            else if (info.ButtonID == 9)
            {
                if (m_House.Shovel > 0)
                {
                    m_From.AddToBackpack(new Shovel(m_House.Shovel));
                    m_House.Shovel = (0);
                    m_From.SendGump(new ToolHouseGump(m_From, m_House));
                }
                else
                {
                    m_From.SendGump(new ToolHouseGump(m_From, m_House));
                    m_House.BeginCombine(m_From);
                }
            }
            else if (info.ButtonID == 10)
            {
                if (m_House.GargoylesPickaxe > 0)
                {
                    GargoylesPickaxe gargoylesPickaxe = new GargoylesPickaxe(); // items that don't accept uses need to be handled like this
                    gargoylesPickaxe.UsesRemaining = m_House.GargoylesPickaxe;  // items that don't accept uses need to be handled like this
                    m_From.AddToBackpack(gargoylesPickaxe);                     // items that don't accept uses need to be handled like this
                    m_House.GargoylesPickaxe = (0);
                    m_From.SendGump(new ToolHouseGump(m_From, m_House));
                }
                else
                {
                    m_From.SendGump(new ToolHouseGump(m_From, m_House));
                    m_House.BeginCombine(m_From);
                }
            }
            else if (info.ButtonID == 11)
            {
                if (m_House.ProspectorsTool > 0)
                {
                    ProspectorsTool prospectorstool = new ProspectorsTool();    // items that don't accept uses need to be handled like this
                    prospectorstool.UsesRemaining = m_House.ProspectorsTool;    // items that don't accept uses need to be handled like this
                    m_From.AddToBackpack(prospectorstool);                      // items that don't accept uses need to be handled like this
                    m_House.ProspectorsTool = (0);
                    m_From.SendGump(new ToolHouseGump(m_From, m_House));
                }
                else
                {
                    m_From.SendGump(new ToolHouseGump(m_From, m_House));
                    m_House.BeginCombine(m_From);
                }

                /*else if ( info.ButtonID == 12 )
                 * {
                 *      if ( m_House.LumberjackingProspectorsTool > 0 )
                 *      {
                 *              LumberjackingProspectorsTool lumberjackingprospectorstool = new LumberjackingProspectorsTool();	// items that don't accept uses need to be handled like this
                 *              lumberjackingprospectorstool.UsesRemaining = m_House.LumberjackingProspectorsTool;	// items that don't accept uses need to be handled like this
                 *              m_From.AddToBackpack(lumberjackingprospectorstool);	// items that don't accept uses need to be handled like this
                 *              m_House.LumberjackingProspectorsTool = ( 0 );
                 *              m_From.SendGump( new ToolHouseGump( m_From, m_House ) );
                 *      }
                 *      else
                 *      {
                 *              m_From.SendGump( new ToolHouseGump( m_From, m_House ) );
                 *              m_House.BeginCombine( m_From );
                 *      }*/
            }
            else if (info.ButtonID == 13)
            {
                if (m_House.Lumberjacking > 0)
                {
                    Hatchet lumberjacking = new Hatchet();                      // items that don't accept uses need to be handled like this
                    lumberjacking.UsesRemaining = m_House.Lumberjacking;        // items that don't accept uses need to be handled like this
                    m_From.AddToBackpack(lumberjacking);                        // items that don't accept uses need to be handled like this
                    lumberjacking.ShowUsesRemaining = true;
                    m_House.Lumberjacking           = (0);
                    m_From.SendGump(new ToolHouseGump(m_From, m_House));
                }
                else
                {
                    m_From.SendGump(new ToolHouseGump(m_From, m_House));
                    m_House.BeginCombine(m_From);
                }
            }
            else if (info.ButtonID == 14)
            {
                if (m_House.Cooking > 0)
                {
                    m_From.AddToBackpack(new Skillet(m_House.Cooking));
                    m_House.Cooking = (0);
                    m_From.SendGump(new ToolHouseGump(m_From, m_House));
                }
                else
                {
                    m_From.SendGump(new ToolHouseGump(m_From, m_House));
                    m_House.BeginCombine(m_From);
                }
            }
            else if (info.ButtonID == 15)
            {
                if (m_House.Cartography > 0)
                {
                    m_From.AddToBackpack(new MapmakersPen(m_House.Cartography));
                    m_House.Cartography = (0);
                    m_From.SendGump(new ToolHouseGump(m_From, m_House));
                }
                else
                {
                    m_From.SendGump(new ToolHouseGump(m_From, m_House));
                    m_House.BeginCombine(m_From);
                }
            }
            else if (info.ButtonID == 16)
            {
                if (m_House.Glassblowing > 0)
                {
                    m_From.AddToBackpack(new Blowpipe(m_House.Glassblowing));
                    m_House.Glassblowing = (0);
                    m_From.SendGump(new ToolHouseGump(m_From, m_House));
                }
                else
                {
                    m_From.SendGump(new ToolHouseGump(m_From, m_House));
                    m_House.BeginCombine(m_From);
                }
            }
            else if (info.ButtonID == 17)
            {
                if (m_House.TaxidermyKit > 0)
                {
                    m_From.AddToBackpack(new TaxidermyKit());                       // have 1 time use
                    m_House.TaxidermyKit = (m_House.TaxidermyKit - 1);              // have 1 time use
                    m_From.SendGump(new ToolHouseGump(m_From, m_House));
                }
                else
                {
                    m_From.SendGump(new ToolHouseGump(m_From, m_House));
                    m_House.BeginCombine(m_From);
                }

                /*}
                 * else if ( info.ButtonID == 18 )
                 * {
                 *      if ( m_House.GargoylesAxe > 0 )
                 *      {
                 *              m_From.AddToBackpack( new GargoylesAxe(m_House.GargoylesAxe) );
                 *              m_House.GargoylesAxe = ( 0 );
                 *              m_From.SendGump( new ToolHouseGump( m_From, m_House ) );
                 *      }
                 *      else
                 *      {
                 *              m_From.SendGump( new ToolHouseGump( m_From, m_House ) );
                 *              m_House.BeginCombine( m_From );
                 *      }
                 * }
                 * else if ( info.ButtonID == 19 )
                 * {
                 *      if ( m_House.GargoylesKnife > 0 )
                 *      {
                 *              m_From.AddToBackpack( new GargoylesKnife(m_House.GargoylesKnife) );
                 *              m_House.GargoylesKnife = ( 0 );
                 *              m_From.SendGump( new ToolHouseGump( m_From, m_House ) );
                 *      }
                 *      else
                 *      {
                 *              m_From.SendGump( new ToolHouseGump( m_From, m_House ) );
                 *              m_House.BeginCombine( m_From );
                 *      }*/
            }
///			else if ( info.ButtonID == 20 )
///			{
///				if ( m_House.Brush > 0 )
///				{
///					m_From.AddToBackpack( new Brush(m_House.Brush) );
///					m_House.Brush = ( 0 );
///					m_From.SendGump( new ToolHouseGump( m_From, m_House ) );
///				}
///				else
///				{
///					m_From.SendGump( new ToolHouseGump( m_From, m_House ) );
///					m_House.BeginCombine( m_From );
///				}
///			}
            else if (info.ButtonID == 21)
            {
                m_From.SendGump(new ToolHouseGump(m_From, m_House));
                m_House.BeginCombine(m_From);
            }
        }