Esempio n. 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;
                        }
                }
            }
        }
Esempio n. 2
0
        public void CheckFriends()
        {
            if (!Alive || Combatant == null || Controlled || Map == null || Map == Map.Internal)
            {
                m_Friends.ForEach(f => f.Delete());
                m_Friends.Clear();

                m_FriendsTimer.Stop();
                m_FriendsTimer = null;
            }
            else
            {
                int count = 0;

                for (int i = 0; i < m_Friends.Count; i++)
                {
                    // remove dead friends

                    Mobile friend = m_Friends[i];

                    if (friend == null || friend.Deleted)
                    {
                        m_Friends.Remove(friend);
                    }
                    else
                    {
                        count++;
                    }
                }

                for (int i = count; i < MaxFriends; i++)
                {
                    // spawn new friends

                    BaseCreature friend = new Raptor(true);

                    friend.MoveToWorld(Map.GetSpawnPosition(Location, 6), Map);
                    friend.Combatant = Combatant;

                    if (friend.AIObject != null)
                    {
                        friend.AIObject.Action = ActionType.Combat;
                    }

                    m_Friends.Add(friend);
                }
            }
        }
Esempio n. 3
0
        public void SpawnRaptors(Mobile target)
        {
            var map = Map;

            if (map == null)
            {
                return;
            }

            var newRaptors = Utility.RandomMinMax(1, 2);

            for (var i = 0; i < newRaptors; ++i)
            {
                var raptor = new Raptor();

                raptor.Team      = Team;
                raptor.FightMode = FightMode.Closest;

                var validLocation = false;
                var loc           = Location;

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

                raptor.MoveToWorld(loc, map);
                raptor.Combatant = target;
            }
        }
Esempio n. 4
0
 public InternalTimer(Raptor owner)
     : base(TimeSpan.Zero, TimeSpan.FromSeconds(30.0))
 {
     m_Owner = owner;
 }
Esempio n. 5
0
        public void CheckFriends()
        {
            if (!Alive || Combatant == null || Controlled || Map == null || Map == Map.Internal)
            {
                m_Friends.ForEach(f => f.Delete());
                m_Friends.Clear();

                m_FriendsTimer.Stop();
                m_FriendsTimer = null;
            }
            else
            {
                int count = 0;

                for (int i = 0; i < m_Friends.Count; i++)
                {
                    // remove dead friends

                    Mobile friend = m_Friends[i];

                    if (friend == null || friend.Deleted)
                    {
                        m_Friends.Remove(friend);
                    }
                    else
                    {
                        count++;
                    }
                }

                for (int i = count; i < MaxFriends; i++)
                {
                    // spawn new friends

                    BaseCreature friend        = new Raptor(true);
                    var          loc           = Location;
                    var          validLocation = false;
                    for (var j = 0; !validLocation && j < 10; ++j)
                    {
                        var x = X + Utility.Random(3) - 1;
                        var y = Y + Utility.Random(3) - 1;
                        var 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);
                        }
                    }

                    friend.MoveToWorld(loc, Map);
                    friend.Combatant = Combatant;

                    if (friend.AIObject != null)
                    {
                        friend.AIObject.Action = ActionType.Combat;
                    }

                    m_Friends.Add(friend);
                }
            }
        }
Esempio n. 6
0
        public void SpawnRaptors(Mobile target)
        {
            var map = Map;

            if (map == null)
                return;

            var newRaptors = Utility.RandomMinMax(1, 2);

            for (var i = 0; i < newRaptors; ++i)
            {
                var raptor = new Raptor();

                raptor.Team = Team;
                raptor.FightMode = FightMode.Closest;

                var validLocation = false;
                var loc = Location;

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

                raptor.MoveToWorld(loc, map);
                raptor.Combatant = target;
            }
        }
Esempio n. 7
0
 public InternalTimer( Raptor owner )
     : base(TimeSpan.Zero, TimeSpan.FromSeconds( 30.0 ))
 {
     m_Owner = owner;
 }
Esempio n. 8
0
        public void CheckFriends()
        {
            if ( !Alive || Combatant == null || Controlled || Map == null || Map == Map.Internal )
            {
                m_Friends.ForEach( f => f.Delete() );
                m_Friends.Clear();

                m_FriendsTimer.Stop();
                m_FriendsTimer = null;
            }
            else
            {
                int count = 0;

                for ( int i = 0; i < m_Friends.Count; i++ )
                {
                    // remove dead friends

                    Mobile friend = m_Friends[i];

                    if ( friend == null || friend.Deleted )
                        m_Friends.Remove( friend );
                    else
                        count++;
                }

                for ( int i = count; i < MaxFriends; i++ )
                {
                    // spawn new friends

                    BaseCreature friend = new Raptor( true );

                    friend.MoveToWorld( Map.GetSpawnPosition( Location, 6 ), Map );
                    friend.Combatant = Combatant;

                    if ( friend.AIObject != null )
                        friend.AIObject.Action = ActionType.Combat;

                    m_Friends.Add( friend );
                }
            }
        }
Esempio n. 9
0
		public void CheckFriends()
		{
			if (!Alive || Combatant == null || Controlled || Map == null || Map == Map.Internal)
			{
				m_Friends.ForEach(f => f.Delete());
				m_Friends.Clear();

				m_FriendsTimer.Stop();
				m_FriendsTimer = null;
			}
			else
			{
				int count = 0;

				for (int i = 0; i < m_Friends.Count; i++)
				{
					// remove dead friends

					Mobile friend = m_Friends[i];

					if (friend == null || friend.Deleted)
						m_Friends.Remove(friend);
					else
						count++;
				}

				for (int i = count; i < MaxFriends; i++)
				{
					// spawn new friends

					BaseCreature friend = new Raptor(true);
					var loc = Location;
					var validLocation = false;
					for (var j = 0; !validLocation && j < 10; ++j)
					{
						var x = X + Utility.Random(3) - 1;
						var y = Y + Utility.Random(3) - 1;
						var 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);
					}

					friend.MoveToWorld(loc, Map);
					friend.Combatant = Combatant;

					if (friend.AIObject != null)
						friend.AIObject.Action = ActionType.Combat;

					m_Friends.Add(friend);
				}
			}
		}