Пример #1
0
 public override void OnDoubleClick(Mobile from)
 {
     if (MazePuzzleItem.IsInPuzzleRoom(from))
     {
         base.OnDoubleClick(from);
     }
 }
Пример #2
0
            public InternalTimer(MazePuzzleItem item, Mobile from) : base(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1))
            {
                m_Item       = item;
                m_From       = from;
                m_NextDamage = DateTime.UtcNow;
                m_Tick       = 0;

                if (item != null)
                {
                    item.ApplyShock(from, 0);
                }
            }
Пример #3
0
		public MazePuzzleGump(Mobile from, MazePuzzleItem item, List<int> path, List<int> progress, bool showNext) : base(25, 25)
		{
			m_Item = item;
			m_Path = path;
			m_Progress = progress;
			
			AddBackground(50, 50, 550, 440, 2600);
			AddBackground(100, 75, 450, 90, 2600);
            AddBackground(90, 175, 270, 270, 2600);
            AddBackground(100, 185, 250, 250, 5120);
            AddBackground(370, 175, 178, 200, 5120);

            AddImage(145, 95, 10451);
            AddImage(435, 95, 10451);
            AddImage(0, 50, 10400);
            AddImage(0, 200, 10401);
            AddImage(0, 360, 10402);

            AddImage(565, 50, 10410);
            AddImage(565, 200, 10411);
            AddImage(565, 360, 10412);

            AddImage(370, 175, 10452);
            AddImage(370, 360, 10452);

            AddImageTiled(125, 207, 195, 3, 5031);
            AddImageTiled(125, 247, 195, 3, 5031);
            AddImageTiled(125, 287, 195, 3, 5031);
            AddImageTiled(125, 327, 195, 3, 5031);
            AddImageTiled(125, 367, 195, 3, 5031);
            AddImageTiled(125, 407, 195, 3, 5031);

            AddImageTiled(123, 205, 3, 195, 5031);
            AddImageTiled(163, 205, 3, 195, 5031);
            AddImageTiled(203, 205, 3, 195, 5031);
            AddImageTiled(243, 205, 3, 195, 5031);
            AddImageTiled(283, 205, 3, 195, 5031);
            AddImageTiled(323, 205, 3, 195, 5031);

            AddImage(420, 250, 1417);
            AddImage(440, 270, 2642);

            AddHtmlLocalized(220, 90, 210, 16, 1153747, false, false); // <center>GENERATOR CONTROL PANEL</center>
            AddHtmlLocalized(220, 115, 210, 16, 1153748, false, false); // <center>Use the Directional Controls to</center>
            AddHtmlLocalized(220, 131, 210, 16, 1153749, false, false); // <center>Close the Grid Circuit</center>

			if(m_Path == null)
			{
				m_Path = GetRandomPath();
				m_Item.Path = m_Path;
			}
				
			if(m_Progress == null || m_Progress.Count == 0)
			{
				m_Progress = new List<int>();
				m_Progress.Add(0);
			}
				
			int x = 110;
			int y = 195;
			int xOffset = 0;
			int yOffset = 0;
			
			for(int i = 0; i < 36; i++)
			{
				int itemID = m_Progress.Contains(i) ? 2152 : 9720;
				
				if(i < 6)
				{
					xOffset =  x + (40 * i);
					yOffset = y;
				}
				
				else if (i < 12)
				{
					xOffset =  x + (40 * (i - 6));
					yOffset = y + 40;
				}
				else if (i < 18)
				{
					xOffset = x + (40 * (i - 12));
					yOffset = y + 80;
				}
				else if (i < 24)
				{
					xOffset =  x + (40 * (i - 18));
					yOffset = y + 120;
				}
				else if (i < 30)
				{
					xOffset =  x + (40 * (i - 24));
					yOffset = y + 160;
				}
				else if (i < 36)
				{
					xOffset =  x + (40 * (i - 30));
					yOffset = y + 200;
				}
				
				AddImage(xOffset, yOffset, itemID);
				
				if(i == m_Progress[m_Progress.Count - 1])
					AddImage(xOffset + 8, yOffset + 8, 5032); 

                if(showNext && m_Progress.Count <= m_Path.Count && i == m_Path[m_Progress.Count])
                    AddImage(xOffset + 8, yOffset + 8, 2361); 

			}
			
			if(from.Skills[SkillName.Lockpicking].Base >= 100)
			{
                AddHtmlLocalized(410, 415, 150, 32, 1153750, false, false); // Attempt to Decipher the Circuit Path
				AddButton(370, 415, 4005, 4005, 5, GumpButtonType.Reply, 0);
			}
			
			AddButton(453, 245, 10700, 10701, 1, GumpButtonType.Reply, 0); // up
            AddButton(478, 281, 10710, 10711, 2, GumpButtonType.Reply, 0); // right
            AddButton(453, 305, 10720, 10721, 3, GumpButtonType.Reply, 0); // down 
            AddButton(413, 281, 10730, 10731, 4, GumpButtonType.Reply, 0); // left
			
		}
Пример #4
0
 public MazePuzzleGump(Mobile from, MazePuzzleItem item, List<int> path, List<int> progress)
     : this(from, item, path, progress, false)
 {
 }
Пример #5
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!from.InRange(this.Location, 3))
            {
                from.SendLocalizedMessage(3000268);                 // that is too far away.
            }
            else if (from.Backpack != null)
            {
                Type needed;
                Item puzzle = null;

                Item key         = from.Backpack.FindItemByType(typeof(MagicKey));
                Item puzzleItem1 = from.Backpack.FindItemByType(typeof(MazePuzzleItem));
                Item puzzleItem2 = from.Backpack.FindItemByType(typeof(MastermindPuzzleItem));

                if (key == null)
                {
                    int x = Utility.RandomMinMax(1095, 1099);
                    int y = Utility.RandomMinMax(1178, 1179);
                    int z = -1;

                    Point3D loc = from.Location;
                    Point3D p   = new Point3D(x, y, z);
                    BaseCreature.TeleportPets(from, p, Map.TerMur);
                    from.MoveToWorld(p, Map.TerMur);

                    from.PlaySound(0x1FE);
                    Effects.SendLocationParticles(EffectItem.Create(loc, from.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
                    Effects.SendLocationParticles(EffectItem.Create(p, from.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023);
                }

                if (puzzleItem1 != null || puzzleItem2 != null)
                {
                    from.SendMessage("You already have a puzzle board.");
                    return;
                }

                switch (m_PuzzleType)
                {
                default:
                case PuzzleType.WestBox:
                case PuzzleType.EastBox: needed = typeof(MagicKey); break;

                case PuzzleType.NorthBox: needed = typeof(GoldPuzzleKey); break;
                }

                Item item = from.Backpack.FindItemByType(needed);

                if (item != null && key is MagicKey)
                {
                    if (m_PuzzleType == PuzzleType.NorthBox)
                    {
                        puzzle = new MastermindPuzzleItem((MagicKey)key);
                    }
                    else
                    {
                        puzzle = new MazePuzzleItem((MagicKey)key);
                    }
                }

                if (puzzle != null)
                {
                    if (!from.Backpack.TryDropItem(from, puzzle, true))
                    {
                        puzzle.Delete();
                    }
                    else
                    {
                        from.SendMessage("You recieve a puzzle board.");
                    }
                }
                else
                {
                    from.SendMessage("You do not have the required key to get that puzzle board.");
                }
            }
        }
Пример #6
0
		public override void OnDoubleClick(Mobile from)
		{
			if(!from.InRange(this.Location, 3))
				from.SendLocalizedMessage(3000268); // that is too far away.
			else if (from.Backpack != null)
			{
				Type needed;
				Item puzzle = null;

                Item key = from.Backpack.FindItemByType(typeof(MagicKey));
				Item puzzleItem1 = from.Backpack.FindItemByType(typeof(MazePuzzleItem));
				Item puzzleItem2 = from.Backpack.FindItemByType(typeof(MastermindPuzzleItem));

                if (key == null)
                {
                    int x = Utility.RandomMinMax(1095, 1099);
                    int y = Utility.RandomMinMax(1178, 1179);
                    int z = -1;

                    Point3D loc = from.Location;
                    Point3D p = new Point3D(x, y, z);
                    BaseCreature.TeleportPets(from, p, Map.TerMur);
                    from.MoveToWorld(p, Map.TerMur);

                    from.PlaySound(0x1FE);
                    Effects.SendLocationParticles(EffectItem.Create(loc, from.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
                    Effects.SendLocationParticles(EffectItem.Create(p, from.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023);
                }

                if (puzzleItem1 != null || puzzleItem2 != null)
				{
					from.SendMessage("You already have a puzzle board.");
					return;
				}
				
				switch(m_PuzzleType)
				{
					default:
					case PuzzleType.WestBox:
					case PuzzleType.EastBox: needed = typeof(MagicKey); break;
					case PuzzleType.NorthBox: needed = typeof(GoldPuzzleKey); break;
				}
				
				Item item = from.Backpack.FindItemByType(needed);
				
				if(item != null && key is MagicKey)
				{
					if(m_PuzzleType == PuzzleType.NorthBox)
						puzzle = new MastermindPuzzleItem((MagicKey)key);
					else
						puzzle = new MazePuzzleItem((MagicKey)key);
				}

                if (puzzle != null)
                {
                    if (!from.Backpack.TryDropItem(from, puzzle, true))
                        puzzle.Delete();
                    else
                        from.SendMessage("You recieve a puzzle board.");
                }
                else
                    from.SendMessage("You do not have the required key to get that puzzle board.");
			}
		}
Пример #7
0
			public InternalTimer(MazePuzzleItem item, Mobile from) : base(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1))
			{
				m_Item = item;
				m_From = from;
				m_NextDamage = DateTime.Now;
				m_Tick = 0;
				
				if(item != null)
					item.ApplyShock(from, 0);
			}