Exemple #1
0
            public override void OnResponse(Mobile typer, string text)
            {
                int amount = Utility.ToInt32(text);

                if (amount < 10000)
                {
                    m_Box.ExtractResource(typer, m_type, amount);
                }
                else
                {
                    typer.SendMessage("You may only take a max of 10,000 items at once.");
                }

                typer.SendGump(new ResourceBoxGump(typer, m_Box, m_Page));
            }
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (m_Box == null)
            {
                return;
            }

            Mobile from = state.Mobile;
            int    BID  = info.ButtonID;

            if (!from.InRange(m_Box, 10))
            {
                from.SendMessage("You must be within 10 spaces of the box to use it.");
                return;
            }

            if (BID == 1)
            {
                from.SendMessage("Target a resource to add");
                from.Target = new ResourceBoxTarget(m_Box, m_Page);
            }

            else if (BID == 2)
            {
                from.SendGump(new ResourceBoxGump(from, m_Box, Pages.Start));
            }

            else if (BID >= 10 && BID < 26)
            {
                from.SendGump(new ResourceBoxGump(from, m_Box, (Pages)(BID - 9)));
            }

            else if (BID >= 100 && BID < 132)
            {
                Type type = m_Types[BID - 100];
                m_Box.ExtractResource(from, type);

                from.SendGump(new ResourceBoxGump(from, m_Box, m_Page));
            }
        }