Esempio n. 1
0
        private Point3D FindSpawnLocation()
        {
            int x, y, z;

            do
            {
                x = Utility.Random(m_Top.X, (m_Bottom.X - m_Top.X));
                y = Utility.Random(m_Top.Y, (m_Bottom.Y - m_Top.Y));
                z = SpawnMap.GetAverageZ(x, y);
            }while (!SpawnMap.CanSpawnMobile(x, y, z));

            return(new Point3D(x, y, z));
        }
Esempio n. 2
0
        private Point3D FindSpawnLocation()
        {
            int x, y, z;

            var count = 100;

            do
            {
                x = Utility.Random(_Top.X, (_Bottom.X - _Top.X));
                y = Utility.Random(_Top.Y, (_Bottom.Y - _Top.Y));
                z = SpawnMap.GetAverageZ(x, y);
            }while (!SpawnMap.CanSpawnMobile(x, y, z) && --count >= 0);

            if (count < 0)
            {
                x = y = z = 0;
            }

            return(new Point3D(x, y, z));
        }