Exemplo n.º 1
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!from.InRange(Location, 3))
            {
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
                return;
            }

            if (from.IsPlayer() && IsInCooldown(from))
            {
                from.SendLocalizedMessage(1113386); // You are too tired to attempt solving more puzzles at this time.
                return;
            }

            if (from.Backpack != null)
            {
                var item = from.Backpack.FindItemByType(typeof(UnderworldPuzzleItem));

                if (item != null)
                {
                    from.SendLocalizedMessage(501885); // You already own one of those!
                }
                else
                {
                    UnderworldPuzzleItem puzzle = new UnderworldPuzzleItem();

                    from.AddToBackpack(puzzle);
                    from.SendLocalizedMessage(1072223); // An item has been placed in your backpack.
                    puzzle.SendTimeRemainingMessage(from);

                    if (from.AccessLevel == AccessLevel.Player)
                    {
                        m_Table[from] = DateTime.UtcNow + TimeSpan.FromHours(24);
                    }
                }
            }
        }
Exemplo n.º 2
0
        public UnderworldPuzzleGump(Mobile from, UnderworldPuzzleItem item, int row)
            : base(45, 45)
		{
            if (row > 3) row = 3;
            if (row < 0) row = 0;

			m_From = from;
			m_Item = item;
			m_Row = row;
			
			m_Solution = item.Solution;
			m_CurrentSolution = item.CurrentSolution;
			
			AddBackground(50, 50, 500, 200, 9250);
			
			AddImageTiled(85, 210, 17, 150, 9255);
			AddImageTiled(110, 63, 17, 150, 9255);
			
			AddImageTiled(140, 90, 250, 17, 9251);
			AddImageTiled(60, 125, 350, 17, 9251);
			AddImageTiled(140, 160, 250, 17, 9251);
			AddImageTiled(60, 195, 350, 17, 9251);
			
			AddBackground(70, 70, 90, 155, 9250);
			AddBackground(200, 70, 140, 155, 9250);
			AddBackground(390, 70, 140, 155, 9250);
			
			AddBackground(50, 280, 200, 120, 9250);
			
			AddImage(0, 0, 10400);
			AddImage(0, 170, 10401);
			AddImage(0, 350, 10402);

            AddButton(105, 87, row == 0 ? 208 : 209, row == 0 ? 209 : 208, 1, GumpButtonType.Reply, 0);
            AddButton(105, 122, row == 1 ? 208 : 209, row == 0 ? 209 : 208, 2, GumpButtonType.Reply, 0);
            AddButton(105, 157, row == 2 ? 208 : 209, row == 0 ? 209 : 208, 3, GumpButtonType.Reply, 0);
            AddButton(105, 192, row == 3 ? 208 : 209, row == 0 ? 209 : 208, 4, GumpButtonType.Reply, 0);
			
			AddPiece(0, true, m_Solution.First);
			AddPiece(1, true, m_Solution.Second);
			AddPiece(2, true, m_Solution.Third);
			AddPiece(3, true, m_Solution.Fourth);
			
			AddPiece(0, false, m_CurrentSolution.First);
			AddPiece(1, false, m_CurrentSolution.Second);
			AddPiece(2, false, m_CurrentSolution.Third);
			AddPiece(3, false, m_CurrentSolution.Fourth);

            for (int i = 0; i < 4; i++)
            {
                if (i == row && m_CurrentSolution.Rows[i] != PuzzlePiece.None && m_Item.Attempts < m_Solution.MaxAttempts)
                {
                    AddButton(85, 87 + (i * 35), 2650, 2650, 5, GumpButtonType.Reply, 0); //Up
                    AddButton(125, 87 + (i * 35), 2648, 2648, 6, GumpButtonType.Reply, 0); //Down
                }
                else
                {
                    AddImage(85, 87 + (i * 35), 2709);
                    AddImage(125, 87 + (i * 35), 2709);
                }
            }

			AddButton(85, 87 + (row * 35), 2650, 2650, 5, GumpButtonType.Reply, 0); //Up
            AddButton(125, 87 + (row * 35), 2648, 2648, 6, GumpButtonType.Reply, 0); //Down
			
            AddHtmlLocalized(65, 295, 130, 16, 1150180, false, false); // Command Functions: 
            AddLabel(200, 295, 0, String.Format("{0}/{1}", m_Item.Attempts, m_Solution.MaxAttempts));
			
			if(from.Skills[SkillName.Lockpicking].Base >= 100.0)
			{
				int locked = m_Solution.GetMatches(m_CurrentSolution);
                AddHtmlLocalized(65, 310, 120, 16, 1150179, false, false); // Crystals Locked  : 
                AddLabel(190, 310, 0, locked.ToString());
			}
			
			AddButton(80, 335, 2124, 2123, 7, GumpButtonType.Reply, 0); // Okay
			AddButton(160, 335, 2073, 2072, 8, GumpButtonType.Reply, 0); // Cancel
            AddButton(120, 360, 2011, 2010, 0, GumpButtonType.Reply, 0); // Logout
		}
Exemplo n.º 3
0
 public UnderworldPuzzleGump(Mobile from, UnderworldPuzzleItem item)
     : this(from, item, 0)
 {
 }
Exemplo n.º 4
0
        public UnderworldPuzzleGump(Mobile from, UnderworldPuzzleItem item, int row)
            : base(45, 45)
        {
            if (row > 3)
            {
                row = 3;
            }
            if (row < 0)
            {
                row = 0;
            }

            m_From = from;
            m_Item = item;
            m_Row  = row;

            m_Solution        = item.Solution;
            m_CurrentSolution = item.CurrentSolution;

            AddBackground(50, 50, 500, 200, 9250);

            AddImageTiled(85, 210, 17, 150, 9255);
            AddImageTiled(110, 63, 17, 150, 9255);

            AddImageTiled(140, 90, 250, 17, 9251);
            AddImageTiled(60, 125, 350, 17, 9251);
            AddImageTiled(140, 160, 250, 17, 9251);
            AddImageTiled(60, 195, 350, 17, 9251);

            AddBackground(70, 70, 90, 155, 9250);
            AddBackground(200, 70, 140, 155, 9250);
            AddBackground(390, 70, 140, 155, 9250);

            AddBackground(50, 280, 200, 120, 9250);

            AddImage(0, 0, 10400);
            AddImage(0, 170, 10401);
            AddImage(0, 350, 10402);

            AddButton(105, 87, row == 0 ? 208 : 209, row == 0 ? 209 : 208, 1, GumpButtonType.Reply, 0);
            AddButton(105, 122, row == 1 ? 208 : 209, row == 0 ? 209 : 208, 2, GumpButtonType.Reply, 0);
            AddButton(105, 157, row == 2 ? 208 : 209, row == 0 ? 209 : 208, 3, GumpButtonType.Reply, 0);
            AddButton(105, 192, row == 3 ? 208 : 209, row == 0 ? 209 : 208, 4, GumpButtonType.Reply, 0);

            AddPiece(0, true, m_Solution.First);
            AddPiece(1, true, m_Solution.Second);
            AddPiece(2, true, m_Solution.Third);
            AddPiece(3, true, m_Solution.Fourth);

            AddPiece(0, false, m_CurrentSolution.First);
            AddPiece(1, false, m_CurrentSolution.Second);
            AddPiece(2, false, m_CurrentSolution.Third);
            AddPiece(3, false, m_CurrentSolution.Fourth);

            for (int i = 0; i < 4; i++)
            {
                if (i == row && m_CurrentSolution.Rows[i] != PuzzlePiece.None && m_Item.Attempts < m_Solution.MaxAttempts)
                {
                    AddButton(85, 87 + (i * 35), 2650, 2650, 5, GumpButtonType.Reply, 0);  //Up
                    AddButton(125, 87 + (i * 35), 2648, 2648, 6, GumpButtonType.Reply, 0); //Down
                }
                else
                {
                    AddImage(85, 87 + (i * 35), 2709);
                    AddImage(125, 87 + (i * 35), 2709);
                }
            }

            AddButton(85, 87 + (row * 35), 2650, 2650, 5, GumpButtonType.Reply, 0);  //Up
            AddButton(125, 87 + (row * 35), 2648, 2648, 6, GumpButtonType.Reply, 0); //Down

            AddHtmlLocalized(65, 295, 130, 16, 1150180, false, false);               // Command Functions:
            AddLabel(200, 295, 0, String.Format("{0}/{1}", m_Item.Attempts, m_Solution.MaxAttempts));

            if (from.Skills[SkillName.Lockpicking].Base >= 100.0)
            {
                int locked = m_Solution.GetMatches(m_CurrentSolution);
                AddHtmlLocalized(65, 310, 120, 16, 1150179, false, false); // Crystals Locked  :
                AddLabel(190, 310, 0, locked.ToString());
            }

            AddButton(80, 335, 2124, 2123, 7, GumpButtonType.Reply, 0);  // Okay
            AddButton(160, 335, 2073, 2072, 8, GumpButtonType.Reply, 0); // Cancel
            AddButton(120, 360, 2011, 2010, 0, GumpButtonType.Reply, 0); // Logout
        }
Exemplo n.º 5
0
 public UnderworldPuzzleGump(Mobile from, UnderworldPuzzleItem item)
     : this(from, item, 0)
 {
 }
Exemplo n.º 6
0
        public UnderworldPuzzleGump(Mobile from, UnderworldPuzzleItem item, int row)
            : base(5, 30)
        {
            if (row > 3)
            {
                row = 3;
            }
            if (row < 0)
            {
                row = 0;
            }

            m_From = from;
            m_Item = item;
            m_Row  = row;

            m_Solution        = item.Solution;
            m_CurrentSolution = item.CurrentSolution;

            AddBackground(55, 45, 500, 200, 0x2422);
            AddImage(75, 83, 0x2423);
            AddImage(65, 118, 0x2423);
            AddImage(75, 153, 0x2423);
            AddImage(65, 188, 0x2423);
            AddImage(108, 55, 0x2427);
            AddImage(86, 65, 0x2427);
            AddBackground(75, 65, 86, 153, 0x2422);
            AddBackground(192, 65, 137, 153, 0x2422);
            AddBackground(397, 65, 137, 153, 0x2422);
            AddBackground(55, 270, 195, 110, 0x2422);
            AddImage(205, 77, 0x52);
            AddImage(205, 110, 0x52);
            AddImage(205, 143, 0x52);
            AddImage(410, 77, 0x52);
            AddImage(410, 110, 0x52);
            AddImage(410, 143, 0x52);
            AddImage(5, 5, 0x28C8);

            AddButton(160, 320, 0xF2, 0xF1, 8, GumpButtonType.Reply, 0);   // Cancel
            AddButton(80, 320, 0xEF, 0xF0, 7, GumpButtonType.Reply, 0);    // Apply
            AddButton(120, 345, 0x7DB, 0x7DB, 0, GumpButtonType.Reply, 0); // Log out

            AddHtmlLocalized(72, 285, 170, 20, 1150180, false, false);     // Command Functions:
            AddHtml(200, 285, 100, 20, string.Format("{0}/{1}", m_Item.Attempts, m_Solution.MaxAttempts), false, false);

            if (from.Skills[SkillName.Lockpicking].Base >= 100.0)
            {
                int locked = m_Solution.GetMatches(m_CurrentSolution);
                AddHtmlLocalized(72, 300, 170, 20, 1150179, false, false); // Crystals Locked  :
                AddHtml(200, 300, 100, 20, locked.ToString(), false, false);
            }

            AddButton(108, 82, row == 0 ? 208 : 209, row == 0 ? 209 : 208, 1, GumpButtonType.Reply, 0);
            AddButton(108, 115, row == 1 ? 208 : 209, row == 0 ? 209 : 208, 2, GumpButtonType.Reply, 0);
            AddButton(108, 148, row == 2 ? 208 : 209, row == 0 ? 209 : 208, 3, GumpButtonType.Reply, 0);
            AddButton(108, 181, row == 3 ? 208 : 209, row == 0 ? 209 : 208, 4, GumpButtonType.Reply, 0);

            AddPiece(0, true, m_Solution.First);
            AddPiece(1, true, m_Solution.Second);
            AddPiece(2, true, m_Solution.Third);
            AddPiece(3, true, m_Solution.Fourth);

            AddPiece(0, false, m_CurrentSolution.First);
            AddPiece(1, false, m_CurrentSolution.Second);
            AddPiece(2, false, m_CurrentSolution.Third);
            AddPiece(3, false, m_CurrentSolution.Fourth);

            for (int i = 0; i < 4; i++)
            {
                if (i == row && m_CurrentSolution.Rows[i] != PuzzlePiece.None && m_Item.Attempts < m_Solution.MaxAttempts)
                {
                    AddButton(88, 82 + (i * 33), 2650, 2650, 5, GumpButtonType.Reply, 0);  //Up
                    AddButton(128, 82 + (i * 33), 2648, 2648, 6, GumpButtonType.Reply, 0); //Down
                }
                else
                {
                    AddImage(88, 82 + (i * 33), 2709);
                    AddImage(128, 82 + (i * 33), 2709);
                }
            }

            AddButton(88, 82 + (row * 35), 2650, 2650, 5, GumpButtonType.Reply, 0);  //Up
            AddButton(128, 82 + (row * 35), 2648, 2648, 6, GumpButtonType.Reply, 0); //Down
        }