Exemplo n.º 1
0
        /// <summary>
        /// check if a specific totem (ie Mana Tide Totem) exists
        /// </summary>
        /// <param name="wtcheck"></param>
        /// <returns></returns>
        public static bool Exist(WoWTotem wtcheck)
        {
            WoWTotemInfo tiexist = GetTotem(wtcheck);
            WoWTotem     wtexist = tiexist.WoWTotem;

            return(wtcheck == wtexist && IsRealTotem(wtcheck));
        }
Exemplo n.º 2
0
        /// <summary>
        /// gets reference to array element in Me.Totems[] corresponding to WoWTotemType of wt.  Return is always non-null and does not indicate totem existance
        /// </summary>
        /// <param name="wt">WoWTotem of slot to reference</param>
        /// <returns>WoWTotemInfo reference</returns>
        public static WoWTotemInfo GetTotem(WoWTotem wt)
        {
            WoWTotemInfo ti = GetTotem(wt.ToType());

            if (ti.WoWTotem != wt)
            {
                return(null);
            }
            return(ti);
        }
Exemplo n.º 3
0
        /// <summary>
        /// check if a specific totem exists within its max range of a given location
        /// </summary>
        /// <param name="pt"></param>
        /// <param name="tt"></param>
        /// <returns></returns>
        public static bool ExistInRange(WoWPoint pt, WoWTotem tt)
        {
            if (!Exist(tt))
            {
                return(false);
            }

            WoWTotemInfo ti = GetTotem(tt);

            return(ti.Unit != null && ti.Unit.Location.Distance(pt) < GetTotemRange(tt));
        }
Exemplo n.º 4
0
        private static bool IsMagmaTotemNeeded()
        {
            if (Spell.UseAOE && Me.GotTarget() && TotemIsKnown(WoWTotem.Magma) && AllowDpsTotems)
            {
                WoWTotemInfo ti = GetTotem(WoWTotemType.Fire);

                if (ti.WoWTotem == WoWTotem.FireElemental)
                {
                    return(false);
                }

                // for existing magma return no cast needed if it has enough mobs
                float rangeCheck = rangeCheck = Totems.GetTotemRange(WoWTotem.Magma);
                if (ti.WoWTotem == WoWTotem.Magma)
                {
                    int existcount = Unit.NearbyUnitsInCombatWithUsOrOurStuff.Count(u => ti.Unit.SpellDistance(u) < rangeCheck);
                    if (existcount >= 3)
                    {
                        return(false);
                    }
                }

                // so no good magma in range, so now check if we want one to be
                int nearcount = Unit.NearbyUnitsInCombatWithUsOrOurStuff.Count(u => u.SpellDistance() < rangeCheck);
                if (nearcount < 3)
                {
                    return(false);
                }

                if (ti.WoWTotem == WoWTotem.Magma)
                {
                    Logger.WriteDebug("IsMagmaTotemNeeded: existing Magma out of range, resetting since {0} mobs near me", nearcount);
                }
                else
                {
                    Logger.WriteDebug("IsMagmaTotemNeeded: found {0} mobs near me, setting Magma", nearcount);
                }

                return(true);
            }

            return(false);
        }
Exemplo n.º 5
0
        private static bool IsSearingTotemNeeded()
        {
            if (Me.GotTarget() && TotemIsKnown(WoWTotem.Searing) && AllowDpsTotems)
            {
                WoWTotemInfo ti = GetTotem(WoWTotemType.Fire);
                if (!Exist(ti))
                {
                    Logger.WriteDebug("IsSearingTotemNeeded: no Fire Totem so setting Searing Totem");
                    return(true);
                }

                if (ti.WoWTotem == WoWTotem.Searing)
                {
                    /*
                     * if (ti.Unit != null && ti.Expires < (DateTime.UtcNow + TimeSpan.FromSeconds(2)))
                     * {
                     *  Logger.WriteDebug("IsSearingTotemNeeded: Searing Totem expired! expires={0}, current={1}, refreshing", ti.Expires.ToString("MM/dd/yyyy hh:mm:ss.fff"), DateTime.UtcNow.ToString("MM/dd/yyyy hh:mm:ss.fff"));
                     *  return true;
                     * }
                     */
                    float currDist = ti.Unit.SpellDistance(Me.CurrentTarget);
                    if (currDist > GetTotemRange(WoWTotem.Searing))
                    {
                        Logger.WriteDebug("IsSearingTotemNeeded: Searing Totem is {0:F1} yds from CurrentTarget, refreshing", currDist);
                        return(true);
                    }
                }

                if (ti.WoWTotem == WoWTotem.Magma)
                {
                    int count = Unit.NearbyUnitsInCombatWithUsOrOurStuff.Count(u => u.DistanceSqr < 15 * 15);
                    if (count < 3)
                    {
                        Logger.WriteDebug("IsSearingTotemNeeded: only {0} mobs nearby, replacing Magma Totem with Searing Totem", count);
                        return(true);
                    }
                }
            }
            return(false);
        }
Exemplo n.º 6
0
 /// <summary>
 /// check if a WoWTotemInfo object references a real totem (other than None or Dummies)
 /// </summary>
 /// <param name="ti"></param>
 /// <returns></returns>
 public static bool Exist(WoWTotemInfo ti)
 {
     return IsRealTotem(ti.WoWTotem);
 }
Exemplo n.º 7
0
        /// <summary>
        /// check if type of totem (ie Air Totem) exists in range
        /// </summary>
        /// <param name="pt"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        public static bool ExistInRange(WoWPoint pt, WoWTotemType type)
        {
            WoWTotemInfo ti = GetTotem(type);

            return(Exist(ti) && ti.Unit != null && ti.Unit.Location.Distance(pt) < GetTotemRange(ti.WoWTotem));
        }
Exemplo n.º 8
0
 /// <summary>
 /// check if a WoWTotemInfo object references a real totem (other than None or Dummies)
 /// </summary>
 /// <param name="ti"></param>
 /// <returns></returns>
 public static bool Exist(WoWTotemInfo ti)
 {
     return(IsRealTotem(ti.WoWTotem));
 }
Exemplo n.º 9
0
 public static bool Exist(WoWTotemInfo ti)
 {
     return Exist(ti.WoWTotem);
 }
Exemplo n.º 10
0
        /// <summary>
        /// check if a specific totem (ie Mana Tide Totem) exists
        /// </summary>
        /// <param name="wtcheck"></param>
        /// <returns></returns>
        public static bool Exist(WoWTotem wtcheck)
        {
            WoWTotemInfo tiexist = GetTotem(wtcheck);

            return(tiexist != null);
        }
Exemplo n.º 11
0
 public static bool Exist(WoWTotemInfo ti)
 {
     return(Exist(ti.WoWTotem));
 }