Beispiel #1
0
        public void CheckFellows()
        {
            if (!Alive || Combatant == null || Map == null || Map == Map.Internal)
            {
                m_Fellows.ForEach(f => f.Delete());
                m_Fellows.Clear();

                m_FellowsTimer.Stop();
                m_FellowsTimer = null;
            }
            else
            {
                for (int i = 0; i < m_Fellows.Count; i++)
                {
                    Mobile friend = m_Fellows[i];

                    if (friend.Deleted)
                    {
                        m_Fellows.Remove(friend);
                    }
                }

                bool spawned = false;

                for (int i = m_Fellows.Count; i < MaxFellows; i++)
                {
                    BaseCreature friend = new LeatherWolfFellow();

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

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

                    m_Fellows.Add(friend);

                    spawned = true;
                }

                if (spawned)
                {
                    Say(1113132); // The leather wolf howls for help
                    PlaySound(0xE6);
                }
            }
        }
Beispiel #2
0
        public void CheckFellows()
        {
            if ( !Alive || Combatant == null || Controlled || Map == null || Map == Map.Internal )
            {
                m_Fellows.ForEach( f => f.Delete() );
                m_Fellows.Clear();

                m_FellowsTimer.Stop();
                m_FellowsTimer = null;
            }
            else
            {
                for ( int i = 0; i < m_Fellows.Count; i++ )
                {
                    Mobile friend = m_Fellows[i];

                    if ( friend.Deleted )
                        m_Fellows.Remove( friend );
                }

                bool spawned = false;

                for ( int i = m_Fellows.Count; i < MaxFellows; i++ )
                {
                    BaseCreature friend = new LeatherWolfFellow();

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

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

                    m_Fellows.Add( friend );

                    spawned = true;
                }

                if ( spawned )
                {
                    Say( 1113132 ); // The leather wolf howls for help
                    PlaySound( 0xE6 );
                }
            }
        }