示例#1
0
        public static bool HasSchool(Mobile m)
        {
            if (m == null || !m.Alive || m.Backpack == null)
            {
                return(false);
            }

            if (m.Backpack.FindItemByType <MagicalFishFinder>() != null && Schools.ContainsKey(m.Map))
            {
                SchoolEntry entry = null;

                for (var index = 0; index < Schools[m.Map].Count; index++)
                {
                    var e = Schools[m.Map][index];

                    if (m.InRange(e.Location, SchoolRange))
                    {
                        entry = e;
                        break;
                    }
                }

                if (entry != null)
                {
                    entry.OnFish();
                    return(true);
                }
            }

            return(false);
        }
示例#2
0
        public static bool HasSchool(Mobile m)
        {
            if (m == null || !m.Alive || m.Backpack == null)
            {
                return(false);
            }

            if (m.Backpack.FindItemByType <MagicalFishFinder>() != null && Schools.ContainsKey(m.Map))
            {
                SchoolEntry entry = Schools[m.Map].FirstOrDefault(e => m.InRange(e.Location, SchoolRange));

                if (entry != null)
                {
                    entry.OnFish();
                    return(true);
                }
            }

            return(false);
        }