Example #1
0
        public virtual string PickRandomDestination()
        {
            if (Map.Felucca.Regions.Count == 0 || Map == null || Map == Map.Internal || Location == Point3D.Zero)
            {
                return(null); // Not yet fully initialized
            }
            string[] possible = GetPossibleDestinations();
            string   picked   = null;

            while (picked == null)
            {
                picked = possible[Utility.Random(possible.Length)];
                EDI test = EDI.Find(picked);

                if (test != null && test.Contains(Location))
                {
                    picked = null;
                }
            }

            return(picked);
        }
Example #2
0
        public EDI GetDestination()
        {
            if (MLQuestSystem.Enabled)
            {
                return(null);
            }

            if (m_DestinationString == null && m_DeleteTimer == null)
            {
                m_DestinationString = PickRandomDestination();
            }

            if (m_Destination != null && m_Destination.Name == m_DestinationString)
            {
                return(m_Destination);
            }

            if (Map.Felucca.Regions.Count > 0)
            {
                return(m_Destination = EDI.Find(m_DestinationString));
            }

            return(m_Destination = null);
        }