Ejemplo n.º 1
0
        public void SpawnPixies(Mobile target)
        {
            Map map = Map;

            if (map == null)
            {
                return;
            }

            int newPixies = Utility.RandomMinMax(3, 6);

            for (int i = 0; i < newPixies; ++i)
            {
                Pixie pixie = new Pixie
                {
                    Team      = Team,
                    FightMode = FightMode.Closest
                };

                bool    validLocation = false;
                Point3D loc           = Location;

                for (int j = 0; !validLocation && j < 10; ++j)
                {
                    int x = X + Utility.Random(3) - 1;
                    int y = Y + Utility.Random(3) - 1;
                    int z = map.GetAverageZ(x, y);

                    if (validLocation = map.CanFit(x, y, Z, 16, false, false))
                    {
                        loc = new Point3D(x, y, Z);
                    }
                    else if (validLocation = map.CanFit(x, y, z, 16, false, false))
                    {
                        loc = new Point3D(x, y, z);
                    }
                }

                pixie.MoveToWorld(loc, map);
                pixie.Combatant = target;
            }
        }
Ejemplo n.º 2
0
        public void SpawnPixies(Mobile target)
        {
            var map = Map;

            if (map == null)
            {
                return;
            }

            var newPixies = Utility.RandomMinMax(3, 6);

            for (var i = 0; i < newPixies; ++i)
            {
                var pixie = new Pixie {
                    Team = Team, FightMode = FightMode.Closest
                };

                pixie.MoveToWorld(map.GetRandomNearbyLocation(Location), map);
                pixie.Combatant = target;
            }
        }
Ejemplo n.º 3
0
        public void SpawnPixies(Mobile target)
        {
            Map map = Map;

            if (map == null)
                return;

            int newPixies = Utility.RandomMinMax(3, 6);

            for (int i = 0; i < newPixies; ++i)
            {
                var pixie = new Pixie {Team = Team, FightMode = FightMode.Closest};

                Point3D loc = Location;

                for (int j = 0; j < 10; ++j)
                {
                    int x = X + Utility.Random(3) - 1;
                    int y = Y + Utility.Random(3) - 1;
                    int z = map.GetAverageZ(x, y);

                    if (false == map.CanFit(x, y, Z, 16, false, false))
                        loc = new Point3D(x, y, Z);
                    else if (false == map.CanFit(x, y, z, 16, false, false))
                        loc = new Point3D(x, y, z);
                }

                pixie.MoveToWorld(loc, map);
                pixie.Combatant = target;
            }
        }
Ejemplo n.º 4
0
		public void SpawnPixies( Mobile target )
		{
			Map map = this.Map;

			if ( map == null )
				return;

			int newPixies = Utility.RandomMinMax( 3, 6 );

			for ( int i = 0; i < newPixies; ++i )
			{
				Pixie pixie = new Pixie();

				pixie.Team = this.Team;
				pixie.FightMode = FightMode.Closest;

				bool validLocation = false;
				Point3D loc = this.Location;

				for ( int j = 0; !validLocation && j < 10; ++j )
				{
					int x = X + Utility.Random( 3 ) - 1;
					int y = Y + Utility.Random( 3 ) - 1;
					int z = map.GetAverageZ( x, y );

					if ( validLocation = map.CanFit( x, y, this.Z, 16, false, false ) )
						loc = new Point3D( x, y, Z );
					else if ( validLocation = map.CanFit( x, y, z, 16, false, false ) )
						loc = new Point3D( x, y, z );
				}

				pixie.MoveToWorld( loc, map );
				pixie.Combatant = target;
			}
		}