context: using Server;
  using System;
  using Server.Mobiles;
  using Server.Gumps;
  using System.Collections.Generic;
  using Server.Targeting;
  using Server.Items;
  
  namespace Server.Regions
  {
  	public class MazeOfDeathRegion : Region
  	{
  		public static void Initialize()
  		{
  			new MazeOfDeathRegion();
  			
  			m_Path = new List<Point3D>();
  			
  			m_Path.Add(new Point3D(1062, 1060, -42));
  			m_Path.Add(new Point3D(1062, 1059, -42));
  			m_Path.Add(new Point3D(1062, 1058, -42));
  			m_Path.Add(new Point3D(1061, 1058, -42));
              m_Path.Add(new Point3D(1060, 1058, -42));
              m_Path.Add(new Point3D(1060, 1057, -42));
  			m_Path.Add(new Point3D(1059, 1057, -42));
  			m_Path.Add(new Point3D(1059, 1056, -42));
  			m_Path.Add(new Point3D(1059, 1055, -42));
  			m_Path.Add(new Point3D(1060, 1055, -42));
  			m_Path.Add(new Point3D(1060, 1054, -42));
  			m_Path.Add(new Point3D(1060, 1053, -42));
              m_Path.Add(new Point3D(1059, 1053, -42));
              m_Path.Add(new Point3D(1059, 1052, -42));
              m_Path.Add(new Point3D(1059, 1051, -42));
              m_Path.Add(new Point3D(1059, 1050, -42));
              m_Path.Add(new Point3D(1058, 1050, -42));
              m_Path.Add(new Point3D(1058, 1049, -42));
              m_Path.Add(new Point3D(1057, 1049, -42));
              m_Path.Add(new Point3D(1057, 1048, -42));
              m_Path.Add(new Point3D(1057, 1047, -42));
              m_Path.Add(new Point3D(1057, 1046, -42));
              m_Path.Add(new Point3D(1058, 1047, -42));
              m_Path.Add(new Point3D(1059, 1047, -42));
              m_Path.Add(new Point3D(1059, 1046, -42));
              m_Path.Add(new Point3D(1059, 1045, -42));
              m_Path.Add(new Point3D(1059, 1044, -42));
              m_Path.Add(new Point3D(1060, 1044, -42));
              m_Path.Add(new Point3D(1061, 1044, -42));
              m_Path.Add(new Point3D(1061, 1043, -42));
              m_Path.Add(new Point3D(1060, 1042, -42));
  
              m_Path.Add(new Point3D(1059, 1042, -42));
              m_Path.Add(new Point3D(1058, 1042, -42));
              m_Path.Add(new Point3D(1057, 1042, -42));
  
              m_Path.Add(new Point3D(1061, 1042, -42));
              m_Path.Add(new Point3D(1061, 1041, -42));
              m_Path.Add(new Point3D(1061, 1042, -42));
              m_Path.Add(new Point3D(1062, 1042, -42));
              m_Path.Add(new Point3D(1062, 1041, -42));
              m_Path.Add(new Point3D(1062, 1040, -42));
              m_Path.Add(new Point3D(1063, 1040, -42));
              m_Path.Add(new Point3D(1063, 1041, -42));
              m_Path.Add(new Point3D(1063, 1040, -42));
              m_Path.Add(new Point3D(1063, 1039, -42));
              m_Path.Add(new Point3D(1062, 1039, -42));
              m_Path.Add(new Point3D(1062, 1038, -42));
              m_Path.Add(new Point3D(1061, 1038, -42));
              m_Path.Add(new Point3D(1061, 1037, -42));
              m_Path.Add(new Point3D(1060, 1037, -42));
              m_Path.Add(new Point3D(1059, 1037, -42));
              m_Path.Add(new Point3D(1058, 1037, -42));
              m_Path.Add(new Point3D(1057, 1037, -42));
              m_Path.Add(new Point3D(1057, 1036, -42));
              m_Path.Add(new Point3D(1057, 1035, -42));
  
              m_Path.Add(new Point3D(1058, 1035, -42));
              m_Path.Add(new Point3D(1059, 1035, -42));
  
              m_Path.Add(new Point3D(1057, 1034, -42));
              m_Path.Add(new Point3D(1057, 1033, -42));
              m_Path.Add(new Point3D(1057, 1032, -42));
              m_Path.Add(new Point3D(1058, 1032, -42));
              m_Path.Add(new Point3D(1059, 1032, -42));
              m_Path.Add(new Point3D(1060, 1032, -42));
              m_Path.Add(new Point3D(1060, 1031, -42));
              m_Path.Add(new Point3D(1060, 1030, -42));
              m_Path.Add(new Point3D(1060, 1029, -42));
              m_Path.Add(new Point3D(1061, 1029, -42));
              m_Path.Add(new Point3D(1061, 1028, -42));
  
              m_Path.Add(new Point3D(1061, 1027, -42));
              m_Path.Add(new Point3D(1062, 1027, -42));
              m_Path.Add(new Point3D(1063, 1027, -42));
              m_Path.Add(new Point3D(1064, 1027, -42));
              m_Path.Add(new Point3D(1061, 1026, -42));
              m_Path.Add(new Point3D(1062, 1026, -42));
              m_Path.Add(new Point3D(1063, 1026, -42));
              m_Path.Add(new Point3D(1064, 1026, -42));
  
              m_Path.Add(new Point3D(1061, 1026, -42));
              m_Path.Add(new Point3D(1061, 1025, -42));
              m_Path.Add(new Point3D(1061, 1024, -42));
              m_Path.Add(new Point3D(1061, 1023, -42));
              m_Path.Add(new Point3D(1061, 1022, -42));
  
              m_Path.Add(new Point3D(1060, 1026, -42));
              m_Path.Add(new Point3D(1059, 1026, -42));
              m_Path.Add(new Point3D(1058, 1026, -42));
  
              m_Path.Add(new Point3D(1058, 1025, -42));
              m_Path.Add(new Point3D(1058, 1024, -42));
              m_Path.Add(new Point3D(1058, 1023, -42));
              m_Path.Add(new Point3D(1058, 1022, -42));
              m_Path.Add(new Point3D(1058, 1021, -42));
  
              m_Path.Add(new Point3D(1057, 1021, -42));
  
              m_Path.Add(new Point3D(1057, 1020, -42));
              m_Path.Add(new Point3D(1057, 1019, -42));
              m_Path.Add(new Point3D(1057, 1018, -42));
  
              m_Path.Add(new Point3D(1058, 1018, -42));
              m_Path.Add(new Point3D(1059, 1018, -42));
              m_Path.Add(new Point3D(1060, 1018, -42));
              m_Path.Add(new Point3D(1061, 1018, -42));
  
              m_Path.Add(new Point3D(1061, 1017, -42));
              m_Path.Add(new Point3D(1061, 1016, -42));
              m_Path.Add(new Point3D(1061, 1015, -42));
              m_Path.Add(new Point3D(1061, 1014, -42));
              m_Path.Add(new Point3D(1061, 1013, -42));
              m_Path.Add(new Point3D(1061, 1012, -42));
              m_Path.Add(new Point3D(1061, 1011, -42));
              m_Path.Add(new Point3D(1061, 1010, -42));
  
              m_Path.Add(new Point3D(1060, 1010, -42));
              m_Path.Add(new Point3D(1059, 1010, -42));
  
              m_Path.Add(new Point3D(1059, 1009, -42));
              m_Path.Add(new Point3D(1059, 1008, -42));
              m_Path.Add(new Point3D(1059, 1007, -42));
              m_Path.Add(new Point3D(1059, 1006, -42));
              m_Path.Add(new Point3D(1059, 1005, -42));
              m_Path.Add(new Point3D(1059, 1004, -42));
  
              m_Path.Add(new Point3D(1058, 1004, -42));
              m_Path.Add(new Point3D(1057, 1004, -42));
  
              m_Path.Add(new Point3D(1057, 1003, -42));
              m_Path.Add(new Point3D(1057, 1002, -42));
              m_Path.Add(new Point3D(1057, 1001, -42));
              m_Path.Add(new Point3D(1057, 1000, -42));
              m_Path.Add(new Point3D(1057, 999, -42));
  
              m_Path.Add(new Point3D(1058, 999, -42));
              m_Path.Add(new Point3D(1059, 999, -42));
              m_Path.Add(new Point3D(1060, 999, -42));
              m_Path.Add(new Point3D(1061, 999, -42));
              m_Path.Add(new Point3D(1062, 999, -42));
              m_Path.Add(new Point3D(1063, 999, -42));
  
              m_Path.Add(new Point3D(1063, 998, -42));
              m_Path.Add(new Point3D(1063, 997, -42));
              m_Path.Add(new Point3D(1063, 996, -42));
              m_Path.Add(new Point3D(1063, 995, -42));
              m_Path.Add(new Point3D(1063, 994, -42));
  
              m_Path.Add(new Point3D(1062, 994, -42));
              m_Path.Add(new Point3D(1061, 994, -42));
  
              m_Path.Add(new Point3D(1061, 993, -42));
              m_Path.Add(new Point3D(1061, 992, -42));
              m_Path.Add(new Point3D(1061, 991, -42));
              m_Path.Add(new Point3D(1061, 990, -42));
  
              //Add some randoms
              int toAdd = 33;
  
              while (toAdd > 0)
              {
                  int x = Utility.RandomMinMax(m_TrapBounds.X, m_TrapBounds.X + m_TrapBounds.Width);
                  int y = Utility.RandomMinMax(m_TrapBounds.Y, m_TrapBounds.Y + m_TrapBounds.Height);
                  int z = -42;
  
                  Point3D p = new Point3D(x, y, z);
  
                  if (!m_Path.Contains(p))
                  {
                      m_Path.Add(p);
                      toAdd--;
                  }
              }
  		}
  		
  		private static Rectangle2D[] m_Bounds = new Rectangle2D[]
  		{
  			new Rectangle2D(1057, 1028, 16, 40),
              new Rectangle2D(1057, 990, 16, 38)
  		};
  
          private static Rectangle2D m_TrapBounds = new Rectangle2D(1057, 990, 7, 71);
  		
  		private static List<Point3D> m_Path;
  		public static List<Point3D> Path { get { return m_Path; } }
  		
  		private static Rectangle2D m_Entrance = new Rectangle2D(1057, 1062, 7, 5);
  		
  		public MazeOfDeathRegion() : base("Maze of Death", Map.TerMur, Region.DefaultPriority, m_Bounds)
  		{
  			Register();
  		}
  
          public override bool OnBeginSpellCast(Mobile m, ISpell s)
          {
  
gt:             if (m.AccessLevel > AccessLevel.Player)