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

            if (map == null)
            {
                return;
            }

            int mage = 0;

            foreach (Mobile m in this.GetMobilesInRange(10))
            {
                if (m is LizardmanMage)
                {
                    ++mage;
                }
            }

            if (mage < 3)
            {
                BaseCreature mage1 = new LizardmanMage();

                mage1.Team = this.Team;

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

                for (int j = 0; !validLocation && j < 10; ++j)
                {
                    int x = target.X + Utility.Random(3) - 1;
                    int y = target.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);
                    }
                }

                mage1.MoveToWorld(loc, map);

                mage1.Combatant = target;
            }
        }
Ejemplo n.º 2
0
		public void SpawnLizardmanMage( Mobile target )
		{
			Map map = target.Map;

			if ( map == null )
				return;

			int mage = 0;

			foreach ( Mobile m in this.GetMobilesInRange( 10 ) )
			{
				if ( m is LizardmanMage )
					++mage;
			}

			if ( mage < 3 )
			{
				BaseCreature mage1 = new LizardmanMage();

				mage1.Team = this.Team;

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

				for ( int j = 0; !validLocation && j < 10; ++j )
				{
					int x = target.X + Utility.Random( 3 ) - 1;
					int y = target.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 );
				}

				mage1.MoveToWorld( loc, map );

				mage1.Combatant = target;
			}
		}