Ejemplo n.º 1
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile from = state.Mobile;

            if (info.ButtonID >= 1 && info.ButtonID <= 18)
            {
                from.SendGump(new SeedBoxGump(from, m_box, info.ButtonID - 1));
                return;
            }

            if (info.ButtonID >= 19)
            {
                int bid = GetButton(info.ButtonID);
                if (bid != -1)
                {
                    int hue = m_Hues[bid];

                    if (m_box.m_counts[m_id, bid] > 0)
                    {
                        from.AddToBackpack(new Seed(ConvertType(m_id - 8), ConvertHue(hue), true));
                        m_box.m_counts[m_id, bid]--;
                        m_box.TotalItems = m_box.SeedCount() / 5;
                    }
                    else
                    {
                        from.SendMessage("You do not have any of those seeds!");
                    }
                    m_box.InvalidateProperties();
                    from.SendGump(new SeedBoxGump(from, m_box, m_id));
                }
            }
        }
Ejemplo n.º 2
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile from = state.Mobile;

            //                        from.SendMessage( "" + info.ButtonID.ToString() );
            if (info.ButtonID >= 1 && info.ButtonID <= 17)
            {
                from.SendGump(new SeedBoxGump(from, m_box, info.ButtonID - 1));
                return;
            }

            if (info.ButtonID >= 18)
            {
                int bid = GetButton(info.ButtonID);
                if (bid != -1)
                {
                    int hue = m_Hues[bid];
                    //                                Console.WriteLine("m_id="+m_id.ToString()+" hue="+);
                    if (m_box.m_counts[m_id, bid] > 0)
                    {
                        //from.AddToBackpack( new NamedSeed( hue, m_id - 8 ) );
                        from.AddToBackpack(new Seed(ConvertType(m_id - 8), ConvertHue(hue), true));
                        m_box.m_counts[m_id, bid]--;
                    }
                    else
                    {
                        from.SendMessage("You do not have any of those seeds!");
                    }
                    m_box.InvalidateProperties();
                    from.SendGump(new SeedBoxGump(from, m_box, m_id));
                }
            }
        }