Exemplo n.º 1
0
        public static void DisplayTo(bool success, Mobile from, int type)
        {
            if (!success)
            {
                from.SendLocalizedMessage(1018092); // You see no evidence of those in the area.
                return;
            }

            Map map = from.Map;

            if (map == null)
            {
                return;
            }

            TrackTypeDelegate check = m_Delegates[type];

            from.CheckSkill(SkillName.Tracking, 21.1, 100.0); // Passive gain

            int range = 10 + (int)(from.Skills[SkillName.Tracking].Value / 10);

            List <Mobile>     list  = new List <Mobile>();
            IPooledEnumerable eable = from.GetMobilesInRange(range);

            foreach (Mobile m in eable)
            {
                // Ghosts can no longer be tracked
                if (m != from && (!Core.AOS || m.Alive) && (!m.Hidden || m.IsPlayer() || from.AccessLevel > m.AccessLevel) && check(m) && CheckDifficulty(from, m))
                {
                    list.Add(m);
                }
            }
            eable.Free();

            if (list.Count > 0)
            {
                list.Sort(new InternalSorter(from));

                from.SendGump(new TrackWhoGump(from, list, range));
                from.SendLocalizedMessage(1018093); // Select the one you would like to track.
            }
            else
            {
                if (type == 0)
                {
                    from.SendLocalizedMessage(502991); // You see no evidence of animals in the area.
                }
                else if (type == 1)
                {
                    from.SendLocalizedMessage(502993); // You see no evidence of creatures in the area.
                }
                else
                {
                    from.SendLocalizedMessage(502995); // You see no evidence of people in the area.
                }
            }
        }
Exemplo n.º 2
0
        public static void DisplayTo(bool success, Mobile from, int type)
        {
            if (!success)
            {
                from.SendMessage("Vous ne décernez aucune trace dans les environs");                   // You see no evidence of those in the area.
                return;
            }

            Map map = from.Map;

            if (map == null)
            {
                return;
            }

            TrackTypeDelegate check = m_Delegates[type];

            from.CheckSkill(SkillName.Tracking, 21.1, 100.0);               // Passive gain

            int range = 10 + (int)(from.Skills[SkillName.Tracking].Value / 10);

            List <Mobile> list = new List <Mobile>();

            foreach (Mobile m in from.GetMobilesInRange(range))
            {
                // Ghosts can no longer be tracked
                if (m != from && (!Core.AOS || m.Alive) && (!m.Hidden || m.AccessLevel == AccessLevel.Player || from.AccessLevel > m.AccessLevel) && check(m) && CheckDifficulty(from, m))
                {
                    list.Add(m);
                }
            }

            if (list.Count > 0)
            {
                list.Sort(new InternalSorter(from));

                from.SendGump(new TrackWhoGump(from, list, range));
                from.SendMessage("Sélectionnerz la piste à suivre");                   // Select the one you would like to track.
            }
            else
            {
                if (type == 0)
                {
                    from.SendMessage("Vous ne décelez aucune piste animale dans les environs");                       // You see no evidence of animals in the area.
                }
                else if (type == 1)
                {
                    from.SendMessage("Vous ne décelez aucune piste inhabituelle dans les environs");                       // You see no evidence of creatures in the area.
                }
                else
                {
                    from.SendMessage("Vous ne décelez aucune présence humaine dans les environs");                       // You see no evidence of people in the area.
                }
            }
        }
Exemplo n.º 3
0
        public static void DisplayTo(bool success, Mobile from, int type)
        {
            if (!success)
            {
                from.SendLocalizedMessage(1018092); // You see no evidence of those in the area.
                return;
            }

            Map map = from.Map;

            if (map == null)
            {
                return;
            }

            TrackTypeDelegate check = m_Delegates[type];

            from.CheckSkill(SkillName.Tracking, 21.1, 100.0); // Passive gain

            int range = 10 + (int)(from.Skills.Tracking.Value / 10);

            List <Mobile> list = from.GetMobilesInRange(range)
                                 .Where(m => m != from && (!Core.AOS || m.Alive) && (!m.Hidden || m.AccessLevel == AccessLevel.Player || from.AccessLevel > m.AccessLevel) && check(m) && CheckDifficulty(from, m))
                                 .ToList();

            if (list.Count > 0)
            {
                list.Sort(new InternalSorter(from));

                from.SendGump(new TrackWhoGump(from, list, range));
                from.SendLocalizedMessage(1018093); // Select the one you would like to track.
            }
            else
            {
                if (type == 0)
                {
                    from.SendLocalizedMessage(502991); // You see no evidence of animals in the area.
                }
                else if (type == 1)
                {
                    from.SendLocalizedMessage(502993); // You see no evidence of creatures in the area.
                }
                else
                {
                    from.SendLocalizedMessage(502995); // You see no evidence of people in the area.
                }
            }
        }
Exemplo n.º 4
0
        public static void DisplayTo(bool success, Mobile from, int type)
        {
            if (!success)
            {
                from.SendLocalizedMessage(1018092);                   // You see no evidence of those in the area.
                return;
            }

            Map map = from.Map;

            if (map == null)
            {
                return;
            }

            TrackTypeDelegate check = m_Delegates[type];

            from.CheckSkill(SkillName.Tracking, 21.1, 100.0);               // Passive gain

            int range = 25 + (int)(from.Skills[SkillName.Tracking].Value / 2);

            List <Mobile> list = new List <Mobile>();

            foreach (Mobile m in from.GetMobilesInRange(range))
            {
                bool canTrack = false;

                if (Worlds.IsPlayerInTheLand(m.Map, m.Location, m.X, m.Y) && Worlds.IsPlayerInTheLand(from.Map, from.Location, from.X, from.Y))
                {
                    canTrack = true;                     // THEY ARE BOTH IN THE MAJOR LAND AREA SO THEY CAN TRACK EACH OTHER
                }
                else if (Server.Misc.Worlds.GetRegionName(m.Map, m.Location) == Server.Misc.Worlds.GetRegionName(from.Map, from.Location))
                {
                    canTrack = true;                     // THEY ARE BOTH IN THE SAME CAVE OR DUNGEON SO THEY CAN TRACK EACH OTHER
                }

                if (canTrack)
                {
                    if ((m.WhisperHue == 666 || m.WhisperHue == 999) && m.Hidden && check(m))                           // ADD HIDDEN SEA MONSTERS
                    {
                        list.Add(m);
                    }

                    if (m != from && m.Alive && !(m is SpellCritter) && !(m is CorpseCritter) && (!m.Hidden || m.AccessLevel == AccessLevel.Player || from.AccessLevel > m.AccessLevel) && check(m) && CheckDifficulty(from, m))
                    {
                        list.Add(m);
                    }
                }
            }

            if (list.Count > 0)
            {
                list.Sort(new InternalSorter(from));

                from.SendGump(new TrackWhoGump(from, list, range));
                from.SendLocalizedMessage(1018093);                   // Select the one you would like to track.
            }
            else
            {
                from.SendLocalizedMessage(1018092);                   // You see no evidence of those in the area.
            }
        }
Exemplo n.º 5
0
        public static void DisplayTo(Mobile from, int type)
        {
            Map map = from.Map;

            if (map == null)
            {
                return;
            }

            TrackTypeDelegate check = m_Delegates[type];

            int    visibleTrackingRange = 20 + (int)Math.Floor((from.Skills[SkillName.Tracking].Value / 100) * 80);
            double detectHiddenScalar   = .1 + ((from.Skills[SkillName.DetectHidden].Value / 100) * .9);
            int    hiddenTrackingRange  = (int)(Math.Floor(visibleTrackingRange * detectHiddenScalar));

            List <Mobile> trackedMobiles = new List <Mobile>();

            IPooledEnumerable nearbyMobiles = from.GetMobilesInRange(visibleTrackingRange);

            foreach (Mobile mobile in nearbyMobiles)
            {
                if (from.Region.IsPartOf(typeof(DungeonRegion)) && from.Region != mobile.Region)
                {
                    continue;
                }
                if (mobile == from)
                {
                    continue;
                }
                if (!mobile.Alive)
                {
                    continue;
                }
                if (mobile.AccessLevel > AccessLevel.Player)
                {
                    continue;
                }
                if (!check(mobile))
                {
                    continue;
                }
                if (mobile.Hidden && Utility.GetDistance(from.Location, mobile.Location) > hiddenTrackingRange)
                {
                    continue;
                }

                trackedMobiles.Add(mobile);
            }

            nearbyMobiles.Free();

            if (trackedMobiles.Count > 0)
            {
                trackedMobiles.Sort(new InternalSorter(from));

                from.SendGump(new TrackWhoGump(from, trackedMobiles, visibleTrackingRange));
                from.SendLocalizedMessage(1018093); // Select the one you would like to track.
            }

            else
            {
                if (type == 0)
                {
                    from.SendLocalizedMessage(502991); // You see no evidence of animals in the area.
                }
                else if (type == 1)
                {
                    from.SendLocalizedMessage(502993); // You see no evidence of creatures in the area.
                }
                else
                {
                    from.SendLocalizedMessage(502995); // You see no evidence of people in the area.
                }
            }
        }
Exemplo n.º 6
0
        public static void DisplayTo(bool success, Mobile from, int type)
        {
            if (!success)
            {
                from.SendLocalizedMessage(1018092);                   // You see no evidence of those in the area.
                return;
            }

            Map map = from.Map;

            if (map == null)
            {
                return;
            }

            TrackTypeDelegate check = m_Delegates[type];

            from.CheckSkill(SkillName.Tracking, 0, 21.1);

            int range = 10 + (int)(from.Skills[SkillName.Tracking].Value / 10);

            // Adam: 9/19/04 - Return tracking to it's original distance.
            //Pixie: 9/11/04 - increase tracking range (double it)
            // range *= 2;

            ArrayList list = new ArrayList();

            IPooledEnumerable eable = from.GetMobilesInRange(range);

            foreach (Mobile m in eable)
            {
                if (m != from && (!m.Hidden || m.AccessLevel == AccessLevel.Player || from.AccessLevel > m.AccessLevel) && check(m))
                {
                    // At this point, we have a list of all mobiles in range, whether hidden or not.
                    // Now we check to see if the current mobile, m, is a player.
                    if (!m.Player)
                    {
                        list.Add(m);
                    }
                    else
                    {
                        bool TRACKINGSKILLDEBUG = (from.AccessLevel > AccessLevel.Player);

                        double Tracking  = from.Skills[SkillName.Tracking].Value;
                        double Forensics = from.Skills[SkillName.Forensics].Value;
                        double Hiding    = m.Skills[SkillName.Hiding].Value;
                        double Stealth   = m.Skills[SkillName.Stealth].Value;

                        double trackersSkill = Tracking;
                        double targetSkill   = Stealth;

                        double chance = 0;
                        if (targetSkill == 0)                          // if target's stealth is 0, start with a base of 100%
                        {
                            chance = 1;
                        }
                        else                         // chance is tracking/stealth*2 (giving 50% at equal levels)
                        {
                            chance = trackersSkill / (targetSkill * 2);
                        }

                        //Special case - if tracking is < 20 and hiding >= 80,
                        // make sure there's difficulty in tracking
                        if (from.Skills[SkillName.Tracking].Base < 20.0 &&
                            from.Skills[SkillName.Hiding].Base >= 80.0)
                        {
                            if (TRACKINGSKILLDEBUG)
                            {
                                from.SendMessage(string.Format("Changing chance to track {0} from {1} because tracker is below 20.0 base tracking", m.Name, chance));
                            }

                            chance = 0;
                        }

                        //if tracker can see the other, it's much
                        //easier to track them
                        if (from.CanSee(m))
                        {
                            if (TRACKINGSKILLDEBUG)
                            {
                                from.SendMessage(string.Format("Changing chance to track {0} from {1} because he can be seen", m.Name, chance));
                            }

                            double newchance = Tracking / 25.0;                  //25 tracking == 100% success when visible
                            if (newchance > chance)                              // make sure we're not killing their chances
                            {
                                chance = newchance;
                            }
                        }

                        // add bonus for fonensics (10% at GM forensics)
                        chance += Forensics / 1000;

                        // make sure there's always a small chance to
                        // succeed and a small chance to fail
                        if (chance <= 0)
                        {
                            chance = 0.001;                             // minimum .1% (1/1000) chance
                        }
                        if (chance >= 1.0)
                        {
                            chance = 0.999;                             // maximum 99.9% chance
                        }

                        if (TRACKINGSKILLDEBUG)
                        {
                            from.SendMessage(
                                string.Format("Your chance to track {0} is {1}.  T:{2:0.00} F:{3:0.00} S:{4:0.00} H{5:0.00}",
                                              m.Name, chance, Tracking, Forensics, Stealth, Hiding)
                                );
                        }

                        // Check Skill takes two arguments, the skill to check, and the chance to succeed.
                        bool succeeded = from.CheckSkill(SkillName.Tracking, chance);

                        // If our skill check succeeds, add the mobile to the list.
                        if (succeeded)
                        {
                            //Can't track > Player level
                            if (m.AccessLevel <= AccessLevel.Player)
                            {
                                list.Add(m);
                            }
                        }
                    }
                }
            }
            eable.Free();

            if (list.Count > 0)
            {
                list.Sort(new InternalSorter(from));

                from.SendGump(new TrackWhoGump(from, list, range));
                from.SendLocalizedMessage(1018093);                   // Select the one you would like to track.
            }
            else
            {
                if (type == 0)
                {
                    from.SendLocalizedMessage(502991);                       // You see no evidence of animals in the area.
                }
                else if (type == 1)
                {
                    from.SendLocalizedMessage(502993);                       // You see no evidence of creatures in the area.
                }
                else
                {
                    from.SendLocalizedMessage(502995);                       // You see no evidence of people in the area.
                }
            }
        }
Exemplo n.º 7
0
        public static void DisplayTo(bool success, Mobile from, int type)
        {
            if (!success)
            {
                from.SendLocalizedMessage(1018092);                   // You see no evidence of those in the area.
                return;
            }

            Map map = from.Map;

            if (map == null)
            {
                return;
            }

            TrackTypeDelegate check = m_Delegates[type];

            double bonus = 0;

            if (BruitSpell.m_BruitTable.Contains(from))
            {
                bonus += (double)BruitSpell.m_BruitTable[from];
            }

            from.CheckSkill(SkillName.Poursuite, 21.1 - bonus, 100.0 - bonus); // Passive gain

            int range = 10 + (int)(from.Skills[SkillName.Poursuite].Value / 3) + (int)bonus;

            List <Mobile> list = new List <Mobile>();

            foreach (Mobile m in from.GetMobilesInRange(range))
            {
                // Ghosts can no longer be tracked
                if (m != from && (!Core.AOS || m.Alive) && (!m.Hidden || m.AccessLevel == AccessLevel.Player || from.AccessLevel > m.AccessLevel) && check(m) && CheckDifficulty(from, m))
                {
                    list.Add(m);
                }
            }

            if (list.Count > 0)
            {
                list.Sort(new InternalSorter(from));

                from.SendGump(new TrackWhoGump(from, list, range));
                from.SendLocalizedMessage(1018093);                   // Select the one you would like to track.
            }
            else
            {
                if (type == 0)
                {
                    from.SendLocalizedMessage(502991);                       // You see no evidence of animals in the area.
                }
                else if (type == 1)
                {
                    from.SendLocalizedMessage(502993);                       // You see no evidence of creatures in the area.
                }
                else
                {
                    from.SendLocalizedMessage(502995);                       // You see no evidence of people in the area.
                }
            }
        }
Exemplo n.º 8
0
        public static void DisplayTo(bool success, Mobile from, int type)
        {
            if (!success)
            {
                from.SendLocalizedMessage(1018092); // You see no evidence of those in the area.
                return;
            }

            Map map = from.Map;

            if (map == null)
            {
                return;
            }

            TrackTypeDelegate check = m_Delegates[type];

            from.CheckSkill(SkillName.Tracking, 21.1, 100.0); // Passive gain

            int range = (BaseTrackingDetectionRange + (int)(from.Skills[SkillName.Tracking].Value / 10)) * NonPlayerRangeMultiplier;

            List <Mobile> list = new List <Mobile>();

            if (RegionTracking)
            {
                range = from.Skills[SkillName.Tracking].Fixed;

                range = range < BaseTrackingDetectionRange ? BaseTrackingDetectionRange : range;

                if (type == 3)
                {
                    list = NetState.Instances.AsParallel().Select(m => m.Mobile).Where(m => m != null &&
                                                                                       m != from &&
                                                                                       m.Map == from.Map &&
                                                                                       m.Alive &&
                                                                                       m.AccessLevel == AccessLevel.Player &&
                                                                                       check(m) &&
                                                                                       CheckDifficulty(from, m) &&
                                                                                       ReachableTarget(from, m, range) &&
                                                                                       !(m.Region is Engines.CannedEvil.ChampionSpawnRegion csr && csr.Map == Map.Felucca && csr.ChampionSpawn.GetMobileCurrentDamage(m) > 1000))
                           .OrderBy(x => x.GetDistanceToSqrt(from)).Select(x => x).Take(TotalTargetsBySkill(from)).ToList();
                }
                else
                {
                    IEnumerable <Mobile> mobiles = FilterRegionMobs(from, range);

                    list = mobiles.AsParallel().Where(m => m != null &&
                                                      m != from &&
                                                      m.Alive &&
                                                      m.AccessLevel == AccessLevel.Player &&
                                                      check(m) &&
                                                      CheckDifficulty(from, m) &&
                                                      ReachableTarget(from, m, range))
                           .OrderBy(x => x.GetDistanceToSqrt(from)).Select(x => x).Take(TotalTargetsBySkill(from)).ToList();
                }
            }
            else
            {
                IPooledEnumerable eable = from.GetMobilesInRange(range);

                foreach (Mobile m in eable)
                {
                    if (list.Count <= TotalTargetsBySkill(from) &&
                        m != from &&
                        m.Alive &&
                        m.AccessLevel == AccessLevel.Player &&
                        check(m) &&
                        CheckDifficulty(from, m) &&
                        (m.IsPlayer() && NonPlayerRangeMultiplier == 1 ? m.InRange(from, range / NonPlayerRangeMultiplier) : m.InRange(from, range)))
                    {
                        list.Add(m);
                    }

                    if (list.Count >= TotalTargetsBySkill(from))
                    {
                        break;
                    }
                }

                eable.Free();
            }

            if (list.Count > 0)
            {
                list.Sort(new InternalSorter(from));

                from.SendGump(new TrackWhoGump(from, list, range));
                from.SendLocalizedMessage(1018093); // Select the one you would like to track.
            }
            else
            {
                if (type == 0)
                {
                    from.SendLocalizedMessage(502991); // You see no evidence of animals in the area.
                }
                else if (type == 1)
                {
                    from.SendLocalizedMessage(502993); // You see no evidence of creatures in the area.
                }
                else
                {
                    from.SendLocalizedMessage(502995); // You see no evidence of people in the area.
                }
            }
        }
Exemplo n.º 9
0
        public static void DisplayTo(bool success, Mobile from, int type)
        {
            if (!success)
            {
                from.SendLocalizedMessage(1018092);                   // You see no evidence of those in the area.
                if (from is PlayerMobile)
                {
                    ((PlayerMobile)from).EndPlayerAction();
                }
                return;
            }

            Map map = from.Map;

            if (map == null)
            {
                if (from is PlayerMobile)
                {
                    ((PlayerMobile)from).EndPlayerAction();
                }
                return;
            }

            TrackTypeDelegate check = m_Delegates[type];

            //Taran - Removed passive gain, you already gain when you use the skill
            //from.CheckSkill( SkillName.Tracking, 21.1, 100.0 ); // Passive gain

            int range = 10 + (int)(from.Skills[SkillName.Tracking].Value / 2);

            List <Mobile> list = new List <Mobile>();

            foreach (Mobile m in from.GetMobilesInRange(range))
            {
                // Ghosts can no longer be tracked
                // Taran - Ghosts and invis people are trackable again
                if (m != from && (!Core.AOS) && (m.AccessLevel == AccessLevel.Player || from.AccessLevel > m.AccessLevel) && check(m) && CheckDifficulty(from, m))
                {
                    list.Add(m);
                }
            }

            if (list.Count > 0)
            {
                list.Sort(new InternalSorter(from));

                from.SendGump(new TrackWhoGump(from, list, range));
                from.SendLocalizedMessage(1018093);                   // Select the one you would like to track.
            }
            else
            {
                if (type == 0)
                {
                    from.SendLocalizedMessage(502991);                       // You see no evidence of animals in the area.
                }
                else if (type == 1)
                {
                    from.SendLocalizedMessage(502993);                       // You see no evidence of creatures in the area.
                }
                else
                {
                    from.SendLocalizedMessage(502995);                       // You see no evidence of people in the area.
                }
                if (from is PlayerMobile)
                {
                    ((PlayerMobile)from).EndPlayerAction();
                }
            }
        }
Exemplo n.º 10
0
        public static void DisplayTo(bool success, Mobile from, int type)
        {
            if (!success)
            {
                from.SendLocalizedMessage(1018092);                 // You see no evidence of those in the area.
                return;
            }

            Map map = from.Map;

            if (map == null)
            {
                return;
            }

            TrackTypeDelegate check = m_Delegates[type];

            from.CheckSkill(SkillName.Tracking, 0.0, 100.0);             // Passive gain

            int range = SpecialMovesController._TrackingMinDistance +
                        (int)(from.Skills[SkillName.Tracking].Value * SpecialMovesController._TrackingDistancePerSkillPoint);

            var list = new List <Mobile>();

            foreach (Mobile m in from.GetMobilesInRange(range))
            {
                if (m is FireElemental && (m.Name == "" || m.Name == "a mysterious gate"))
                {
                    if (m.InRange(from.Location, range - 50))
                    {
                        list.Add(m);
                    }
                }
                else if (m != from && (!from.EraAOS || m.Alive) &&
                         (!m.Hidden || m.AccessLevel == AccessLevel.Player || from.AccessLevel > m.AccessLevel) && check(m) &&
                         CheckDifficulty(from, m))
                {
                    list.Add(m);
                }
            }

            if (list.Count > 0)
            {
                list.Sort(new InternalSorter(from));

                from.SendGump(new TrackWhoGump(from, list, range));
                from.SendLocalizedMessage(1018093);                 // Select the one you would like to track.
            }
            else
            {
                if (type == 0)
                {
                    from.SendLocalizedMessage(502991);                     // You see no evidence of animals in the area.
                }
                else if (type == 1)
                {
                    from.SendLocalizedMessage(502993);                     // You see no evidence of creatures in the area.
                }
                else
                {
                    from.SendLocalizedMessage(502995);                     // You see no evidence of people in the area.
                }
            }
        }