Example #1
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!this.CheckUse(from))
                return;
            Map map = this.Map;
            Point3D loc = this.Location;

            if (from.InRange(loc, 1) || from.InLOS(this))
            {
                (this).Delete();

                Snake snake = new Snake();
                Mongbat mongbat = new Mongbat();
                SilverSerpent silverserpent = new SilverSerpent();
                Raptor raptor = new Raptor();
                Ballem ballem = new Ballem();
                FNPitchfork fnpitchfork = new FNPitchfork();

                switch (Utility.Random(6))
                {
                    case 0:
                        snake.MoveToWorld(loc, map);
                        break;
                    case 1:
                        mongbat.MoveToWorld(loc, map);
                        break;
                    case 2:
                        silverserpent.MoveToWorld(loc, map);
                        break;
                    case 3:
                        raptor.MoveToWorld(loc, map);
                        break;
                    case 4:
                        ballem.MoveToWorld(loc, map);
                        break;
                    case 5:
                        if (Utility.RandomDouble() < 0.20)
                        {
                            fnpitchfork.MoveToWorld(loc, map);
                            from.SendMessage("You find Farmer Nash's pitchfork under one of the brambles of weeds. You pick up the pitchfork and put it in your backpack.");
                            break;
                        }
                        else
                        {
                            silverserpent.MoveToWorld(loc, map);
                            break;
                        }
                }
            }
        }
Example #2
0
        public void SpawnSnake(Mobile target)
        {
            Map map = this.Map;

            if (map == null)
            {
                return;
            }

            int newSnake = Utility.RandomMinMax(1, 2);

            for (int i = 0; i < newSnake; ++i)
            {
                Snake Snake = new Snake();

                Snake.Team      = this.Team;
                Snake.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);
                    }
                }

                Snake.MoveToWorld(loc, map);
                Snake.Combatant = target;
            }
        }
Example #3
0
        public void spawnsnakes(Mobile target)
        {
            Map map = this.Map;

            if (map == null)
            {
                return;
            }

            int snakes = 0;

            foreach (Mobile m in this.GetMobilesInRange(10))
            {
                if (m is GiganticSnake || m is GiantSerpent || m is Snake)
                {
                    ++snakes;
                }
            }

            if (snakes < 4)
            {
                int newsnakes = 1;

                for (int i = 0; i < newsnakes; ++i)
                {
                    BaseCreature Snake;

                    switch (Utility.Random(6))
                    {
                    default:
                    case 0:
                    case 1: Snake = new GiganticSnake(); break;

                    case 2:
                    case 3: Snake = new GiantSerpent(); break;

                    case 4:
                    case 5: Snake = new Snake(); break;
                    }

                    Snake.Team = this.Team;

                    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);
                        }
                    }

                    Snake.MoveToWorld(loc, map);
                    Snake.Combatant = target;
                }
            }
        }
Example #4
0
		public void SpawnSnake( Mobile target )
		{
			Map map = this.Map;

			if ( map == null )
				return;

			int newSnake = Utility.RandomMinMax( 1, 2 );

			for ( int i = 0; i < newSnake; ++i )
			{
				Snake Snake = new Snake();

				Snake.Team = this.Team;
				Snake.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 );
				}

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