コード例 #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
ファイル: MagicFishFinder.cs プロジェクト: adverserath/TrueUO
        public void CheckUpdate(Mobile m)
        {
            if (Schools.ContainsKey(m.Map))
            {
                SchoolEntry entry = Schools[m.Map].FirstOrDefault(e => m.InRange(e.Location, SchoolRange));

                if (entry != null)
                {
                    m.SendLocalizedMessage(1152647); // Fish are schooling right here!
                    return;
                }

                entry = Schools[m.Map].FirstOrDefault(e => m.InRange(e.Location, MessageRange));

                if (entry != null)
                {
                    m.SendLocalizedMessage(1152638, GetDirectionString(Utility.GetDirection(m, entry.Location))); // The fish finder pulls you to the ~1_DIRECTION~.
                }
                else
                {
                    m.SendLocalizedMessage(1152637); // The fish finder shows you nothing.
                }
            }
            else
            {
                m.SendLocalizedMessage(1152637); // The fish finder shows you nothing.
            }
        }
コード例 #3
0
        public void CheckUpdate(Mobile m)
        {
            if (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)
                {
                    m.SendLocalizedMessage(1152647); // Fish are schooling right here!
                    return;
                }

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

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

                if (entry != null)
                {
                    m.SendLocalizedMessage(1152638, GetDirectionString(Utility.GetDirection(m, entry.Location))); // The fish finder pulls you to the ~1_DIRECTION~.
                }
                else
                {
                    m.SendLocalizedMessage(1152637); // The fish finder shows you nothing.
                }
            }
            else
            {
                m.SendLocalizedMessage(1152637); // The fish finder shows you nothing.
            }
        }
コード例 #4
0
ファイル: MagicFishFinder.cs プロジェクト: adverserath/TrueUO
        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);
        }