public FirstTimer(PlayerMobile pm, SelfReplicatingPuzzleBox box, Container pack)
     : base(TimeSpan.FromSeconds(2.0), TimeSpan.FromSeconds(2.0), 10)
 {
     m_Box  = box;
     m_Pm   = pm;
     m_Pack = pack;
 }
            public InternalGump(PlayerMobile pm, SelfReplicatingPuzzleBox box, Container pack, InternalTimer timer)
                : base(150, 150)
            {
                this.Closable   = false;
                this.Disposable = false;
                this.Dragable   = false;
                this.Resizable  = false;

                m_Pm     = pm;
                m_Box    = box;
                m_Pack   = pack;
                m_Timer  = timer;
                m_Choice = Utility.RandomMinMax(1, 3);

                string choice = m_Choice == 1 ? "fish" : m_Choice == 2 ? "gold" : "old prospector";

                AddPage(0);
                AddBackground(150, 150, 300, 200, 9300);
                AddLabel(220, 165, 0, string.Format("Select the {0}.", choice));
                AddLabel(180, 190, 0, "The box will continue replicating");
                AddLabel(180, 215, 0, "until you get it right.");
                AddButton(165, 250, 0x15BD, 0x15BE, 1, GumpButtonType.Reply, 0);
                AddButton(235, 250, 0x15C3, 0x15C4, 2, GumpButtonType.Reply, 0);
                AddButton(305, 250, 0x15C5, 0x15C6, 3, GumpButtonType.Reply, 0);
            }
 public FirstTimer(PlayerMobile pm, SelfReplicatingPuzzleBox box, Container pack)
     : base(TimeSpan.FromSeconds(2.0), TimeSpan.FromSeconds(2.0), 10)
 {
     m_Box = box;
     m_Pm = pm;
     m_Pack = pack;
 }
 public InternalTimer(PlayerMobile pm, SelfReplicatingPuzzleBox box, Container pack, bool first)
     : base(TimeSpan.FromSeconds(2.0), TimeSpan.FromSeconds(2.0), 600)
 {
     m_Box       = box;
     m_Pm        = pm;
     m_Pack      = pack;
     m_FirstPass = first;
     tick        = 0;
 }
        private static void CleanPack(PlayerMobile pm, SelfReplicatingPuzzleBox box, Container pack, string message)
        {
            box.Active = false;
            List <SelfReplicatingPuzzleBox> boxes = new List <SelfReplicatingPuzzleBox>();

            foreach (Item i in pack.Items)
            {
                if (i is SelfReplicatingPuzzleBox)
                {
                    boxes.Add(i as SelfReplicatingPuzzleBox);
                }
            }
            if (boxes != null)
            {
                int count = boxes.Count;
                try
                {
                    for (int x = 0; x < count; x++)
                    {
                        boxes[x].Delete();
                    }
                    boxes.Clear();
                }
                catch { Console.WriteLine("Caught exception trying to delete boxes."); }
                if (message == "")
                {
                    int amount = Utility.RandomMinMax(300, 700) - count;
                    if (amount < 10)
                    {
                        amount = 10;
                    }
                    pack.DropItem(new Gold(amount));
                    pm.SendMessage("You find {0} gold after solving the puzzle box!", amount);
                }
                else
                {
                    pm.SendMessage(message);
                }
            }
            else
            {
                Console.WriteLine("No boxes found???");
            }
        }
 public FirstTimer(SelfReplicatingPuzzleBox box) : this(null, box, null)
 {
 }
 public InternalTimer(SelfReplicatingPuzzleBox box) : this(null, box, null, false)
 {
 }
 public FirstTimer(SelfReplicatingPuzzleBox box) : this(null, box, null) { }
            public InternalGump(PlayerMobile pm, SelfReplicatingPuzzleBox box, Container pack, InternalTimer timer)
                : base(150, 150)
            {
                this.Closable = false;
                this.Disposable = false;
                this.Dragable = false;
                this.Resizable = false;

                m_Pm = pm;
                m_Box = box;
                m_Pack = pack;
                m_Timer = timer;
                m_Choice = Utility.RandomMinMax(1, 3);

                string choice = m_Choice == 1 ? "fish" : m_Choice == 2 ? "gold" : "old prospector";

                AddPage(0);
                AddBackground(150, 150, 300, 200, 9300);
                AddLabel(220, 165, 0, string.Format("Select the {0}.", choice));
                AddLabel(180, 190, 0, "The box will continue replicating");
                AddLabel(180, 215, 0, "until you get it right.");
                AddButton(165, 250, 0x15BD, 0x15BE, 1, GumpButtonType.Reply, 0);
                AddButton(235, 250, 0x15C3, 0x15C4, 2, GumpButtonType.Reply, 0);
                AddButton(305, 250, 0x15C5, 0x15C6, 3, GumpButtonType.Reply, 0);
            }
 private static void CleanPack(PlayerMobile pm, SelfReplicatingPuzzleBox box, Container pack, string message)
 {
     box.Active = false;
     List<SelfReplicatingPuzzleBox> boxes = new List<SelfReplicatingPuzzleBox>();
     foreach (Item i in pack.Items)
     {
         if (i is SelfReplicatingPuzzleBox) boxes.Add(i as SelfReplicatingPuzzleBox);
     }
     if (boxes != null)
     {
         int count = boxes.Count;
         try
         {
             for (int x = 0; x < count; x++)
             {
                 boxes[x].Delete();
             }
             boxes.Clear();
         }
         catch { Console.WriteLine("Caught exception trying to delete boxes."); }
         if (message == "")
         {
             int amount = Utility.RandomMinMax(300, 700) - count;
             if (amount < 10) amount = 10;
             pack.DropItem(new Gold(amount));
             pm.SendMessage("You find {0} gold after solving the puzzle box!", amount);
         }
         else
             pm.SendMessage(message);
     }
     else
         Console.WriteLine("No boxes found???");
 }
 public InternalTimer(PlayerMobile pm, SelfReplicatingPuzzleBox box, Container pack, bool first)
     : base(TimeSpan.FromSeconds(2.0), TimeSpan.FromSeconds(2.0), 600)
 {
     m_Box = box;
     m_Pm = pm;
     m_Pack = pack;
     m_FirstPass = first;
     tick = 0;
 }
 public InternalTimer(SelfReplicatingPuzzleBox box) : this(null, box, null, false) { }