Пример #1
0
        /// <summary>
        ///   Destroys the totem described by type.
        /// </summary>
        /// <remarks>
        ///   Created 3/26/2011.
        /// </remarks>
        /// <param name = "type">The type.</param>
        public static void DestroyTotem(WoWTotemType type)
        {
            if (type == WoWTotemType.None)
            {
                return;
            }

            Lua.DoString("DestroyTotem({0})", (int)type);
        }
Пример #2
0
        /// <summary>
        ///   Destroys the totem described by type.
        /// </summary>
        /// <remarks>
        ///   Created 3/26/2011.
        /// </remarks>
        /// <param name = "type">The type.</param>
        public static void DestroyTotem(WoWTotemType type)
        {
            if (type == WoWTotemType.None)
            {
                return;
            }

            Logger.Write("^Destroy Totem Type: {0}", type.ToString());
            Lua.DoString("DestroyTotem({0})", (int)type);
        }
Пример #3
0
        public static float GetTotemDistance(WoWUnit from, WoWTotemType type)
        {
            var info = GetTotemInfo(type);

            if (info == null)
            {
                return(-1);
            }

            return(info.Unit.Location.Distance(from.Location));
        }
Пример #4
0
        /// <summary>
        ///   Destroys the totem described by type.
        /// </summary>
        /// <remarks>
        ///   Created 3/26/2011.
        /// </remarks>
        /// <param name = "type">The type.</param>
        public static void DestroyTotem(WoWTotemType type)
        {
            if (type == WoWTotemType.None)
            {
                return;
            }

            try
            {
                Lua.DoString("DestroyTotem({0})", (int)type);
            }
            catch
            {
                CLULogger.DiagnosticLog("Lua failed in DestroyTotem");
            }
        }
Пример #5
0
 public ElementalTotem(WoWTotemType type)
 {
     this.type = type;
 }
Пример #6
0
 /// <summary>
 /// gets reference to array element in Me.Totems[] corresponding to type.  Return is always non-null and does not indicate totem existance
 /// </summary>
 /// <param name="type">WoWTotemType of slot to reference</param>
 /// <returns>WoWTotemInfo reference</returns>
 public static WoWTotemInfo GetTotem(WoWTotemType type)
 {
     return(Me.Totems[(int)type - 1]);
 }
Пример #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));
        }
Пример #8
0
        /// <summary>
        /// check if a type of totem (ie Air Totem) exists
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public static bool Exist(WoWTotemType type)
        {
            WoWTotem wt = GetTotem(type).WoWTotem;

            return(IsRealTotem(wt));
        }
Пример #9
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);
 }
Пример #10
0
 /// <summary>Gets a totem information for the specified type of totem.</summary>
 /// <remarks>Created 3/26/2011.</remarks>
 /// <param name="type">The type.</param>
 /// <returns>The totem information.</returns>
 public static WoWTotemInfo GetTotemInfo(WoWTotemType type)
 {
     return StyxWoW.Me.Totems.FirstOrDefault(t => t.Type == type && t.Unit != null);
 }
Пример #11
0
        private static WoWTotem GetTotemForSpec(WoWTotemType type)
        {
            switch (TalentManager.CurrentSpec)
            {
                case TalentSpec.ElementalShaman:
                    switch (type)
                    {
                        case WoWTotemType.Fire:
                            if (CanPlaceTotem(WoWTotem.Searing))
                                return WoWTotem.Searing;
                            break;

                        case WoWTotemType.Earth:
                            if (CanPlaceTotem(WoWTotem.Stoneskin))
                                return WoWTotem.Stoneskin;
                            break;

                        case WoWTotemType.Water:
                            if (Battlegrounds.IsInsideBattleground)
                            {
                                if (CanPlaceTotem(WoWTotem.HealingStream) && TalentManager.HasGlyph("Healing Stream Totem"))
                                    return WoWTotem.HealingStream;
                                if (CanPlaceTotem(WoWTotem.ElementalResistance))
                                    return WoWTotem.ElementalResistance;
                            }
                            if (CanPlaceTotem(WoWTotem.HealingStream))
                                return WoWTotem.HealingStream;
                            if (CanPlaceTotem(WoWTotem.ManaSpring))
                                return WoWTotem.ManaSpring;
                            break;

                        case WoWTotemType.Air:
                            if (CanPlaceTotem(WoWTotem.WrathOfAir))
                                return WoWTotem.WrathOfAir;
                            break;
                    }
                    break;

                case TalentSpec.RestorationShaman:
                    switch (type)
                    {
                        case WoWTotemType.Fire:
                            if (CanPlaceTotem(WoWTotem.Flametongue))
                                return WoWTotem.Flametongue;
                            break;

                        case WoWTotemType.Earth:
                            if (CanPlaceTotem(WoWTotem.Stoneskin))
                                return WoWTotem.Stoneskin;
                            break;

                        case WoWTotemType.Water:
                            if (CanPlaceTotem(WoWTotem.HealingStream))
                                return WoWTotem.HealingStream;
                            if (CanPlaceTotem(WoWTotem.ManaSpring))
                                return WoWTotem.ManaSpring;
                            break;

                        case WoWTotemType.Air:
                            if (CanPlaceTotem(WoWTotem.Grounding))
                                return WoWTotem.Grounding;
                            if (CanPlaceTotem(WoWTotem.WrathOfAir))
                                return WoWTotem.WrathOfAir;
                            break;
                    }
                    break;

                case TalentSpec.EnhancementShaman:
                    switch (type)
                    {
                        case WoWTotemType.Fire:
                            if (CanPlaceTotem(WoWTotem.Searing))
                                return WoWTotem.Grounding;
                            break;

                        case WoWTotemType.Earth:

                            if (CanPlaceTotem(WoWTotem.StrengthOfEarth))
                                return WoWTotem.StrengthOfEarth;
                            if (CanPlaceTotem(WoWTotem.Stoneskin))
                                return WoWTotem.Stoneskin;
                            break;

                        case WoWTotemType.Water:
                            if (Battlegrounds.IsInsideBattleground)
                            {
                                if (CanPlaceTotem(WoWTotem.HealingStream) && TalentManager.HasGlyph("Healing Stream Totem"))
                                    return WoWTotem.HealingStream;
                                if (CanPlaceTotem(WoWTotem.ElementalResistance))
                                    return WoWTotem.ElementalResistance;
                            }
                            if (CanPlaceTotem(WoWTotem.HealingStream))
                                return WoWTotem.HealingStream;
                            if (CanPlaceTotem(WoWTotem.ManaSpring))
                                return WoWTotem.ManaSpring;
                            break;

                        case WoWTotemType.Air:
                            if (CanPlaceTotem(WoWTotem.Windfury))
                                return WoWTotem.Windfury;
                            break;
                    }
                    break;
            }
            return WoWTotem.None;
        }
Пример #12
0
        public static float GetTotemDistance(WoWUnit from, WoWTotemType type)
        {
            var info = GetTotemInfo(type);
            if (info == null)
                return -1;

            return info.Unit.Location.Distance(from.Location);
        }
Пример #13
0
 /// <summary>Gets a totem information for the specified type of totem.</summary>
 /// <remarks>Created 3/26/2011.</remarks>
 /// <param name="type">The type.</param>
 /// <returns>The totem information.</returns>
 public static WoWTotemInfo GetTotemInfo(WoWTotemType type)
 {
     return(StyxWoW.Me.Totems.FirstOrDefault(t => t.Type == type && t.Unit != null));
 }
Пример #14
0
        private static WoWTotem GetTotemForSpec(WoWTotemType type)
        {
            switch (TalentManager.CurrentSpec)
            {
            case TalentSpec.ElementalShaman:
                switch (type)
                {
                case WoWTotemType.Fire:
                    if (CanPlaceTotem(WoWTotem.Searing))
                    {
                        return(WoWTotem.Searing);
                    }
                    break;

                case WoWTotemType.Earth:
                    if (CanPlaceTotem(WoWTotem.Stoneskin))
                    {
                        return(WoWTotem.Stoneskin);
                    }
                    break;

                case WoWTotemType.Water:
                    if (Battlegrounds.IsInsideBattleground)
                    {
                        if (CanPlaceTotem(WoWTotem.HealingStream) && TalentManager.HasGlyph("Healing Stream Totem"))
                        {
                            return(WoWTotem.HealingStream);
                        }
                        if (CanPlaceTotem(WoWTotem.ElementalResistance))
                        {
                            return(WoWTotem.ElementalResistance);
                        }
                    }
                    if (CanPlaceTotem(WoWTotem.HealingStream))
                    {
                        return(WoWTotem.HealingStream);
                    }
                    if (CanPlaceTotem(WoWTotem.ManaSpring))
                    {
                        return(WoWTotem.ManaSpring);
                    }
                    break;

                case WoWTotemType.Air:
                    if (CanPlaceTotem(WoWTotem.WrathOfAir))
                    {
                        return(WoWTotem.WrathOfAir);
                    }
                    break;
                }
                break;

            case TalentSpec.RestorationShaman:
                switch (type)
                {
                case WoWTotemType.Fire:
                    if (CanPlaceTotem(WoWTotem.Flametongue))
                    {
                        return(WoWTotem.Flametongue);
                    }
                    break;

                case WoWTotemType.Earth:
                    if (CanPlaceTotem(WoWTotem.Stoneskin))
                    {
                        return(WoWTotem.Stoneskin);
                    }
                    break;

                case WoWTotemType.Water:
                    if (CanPlaceTotem(WoWTotem.HealingStream))
                    {
                        return(WoWTotem.HealingStream);
                    }
                    if (CanPlaceTotem(WoWTotem.ManaSpring))
                    {
                        return(WoWTotem.ManaSpring);
                    }
                    break;

                case WoWTotemType.Air:
                    if (CanPlaceTotem(WoWTotem.Grounding))
                    {
                        return(WoWTotem.Grounding);
                    }
                    if (CanPlaceTotem(WoWTotem.WrathOfAir))
                    {
                        return(WoWTotem.WrathOfAir);
                    }
                    break;
                }
                break;

            case TalentSpec.EnhancementShaman:
                switch (type)
                {
                case WoWTotemType.Fire:
                    if (CanPlaceTotem(WoWTotem.Searing))
                    {
                        return(WoWTotem.Grounding);
                    }
                    break;

                case WoWTotemType.Earth:

                    if (CanPlaceTotem(WoWTotem.StrengthOfEarth))
                    {
                        return(WoWTotem.StrengthOfEarth);
                    }
                    if (CanPlaceTotem(WoWTotem.Stoneskin))
                    {
                        return(WoWTotem.Stoneskin);
                    }
                    break;

                case WoWTotemType.Water:
                    if (Battlegrounds.IsInsideBattleground)
                    {
                        if (CanPlaceTotem(WoWTotem.HealingStream) && TalentManager.HasGlyph("Healing Stream Totem"))
                        {
                            return(WoWTotem.HealingStream);
                        }
                        if (CanPlaceTotem(WoWTotem.ElementalResistance))
                        {
                            return(WoWTotem.ElementalResistance);
                        }
                    }
                    if (CanPlaceTotem(WoWTotem.HealingStream))
                    {
                        return(WoWTotem.HealingStream);
                    }
                    if (CanPlaceTotem(WoWTotem.ManaSpring))
                    {
                        return(WoWTotem.ManaSpring);
                    }
                    break;

                case WoWTotemType.Air:
                    if (CanPlaceTotem(WoWTotem.Windfury))
                    {
                        return(WoWTotem.Windfury);
                    }
                    break;
                }
                break;
            }
            return(WoWTotem.None);
        }
Пример #15
0
        /// <summary>
        ///   Destroys the totem described by type.
        /// </summary>
        /// <remarks>
        ///   Created 3/26/2011.
        /// </remarks>
        /// <param name = "type">The type.</param>
        public static void DestroyTotem(WoWTotemType type)
        {
            if (type == WoWTotemType.None)
            {
                return;
            }

            Logger.Write("^Destroy Totem Type: {0}", type.ToString());
            Lua.DoString("DestroyTotem({0})", (int)type);
        }
Пример #16
0
 /// <summary>
 /// check if a type of totem (ie Air Totem) exists
 /// </summary>
 /// <param name="type"></param>
 /// <returns></returns>
 public static bool Exist(WoWTotemType type)
 {
     WoWTotem wt = GetTotem(type).WoWTotem;
     return IsRealTotem(wt);
 }
Пример #17
0
        /// <summary>
        ///   Destroys the totem described by type.
        /// </summary>
        /// <remarks>
        ///   Created 3/26/2011.
        /// </remarks>
        /// <param name = "type">The type.</param>
        public static void DestroyTotem(WoWTotemType type)
        {
            if (type == WoWTotemType.None)
            {
                return;
            }

            try
            {
                Lua.DoString("DestroyTotem({0})", (int)type);
            }
            catch
            {
                CLULogger.DiagnosticLog("Lua failed in DestroyTotem");
            }
        }
Пример #18
0
 /// <summary>
 /// gets reference to array element in Me.Totems[] corresponding to type.  Return is always non-null and does not indicate totem existance
 /// </summary>
 /// <param name="type">WoWTotemType of slot to reference</param>
 /// <returns>WoWTotemInfo reference</returns>
 public static WoWTotemInfo GetTotem(WoWTotemType type)
 {
     return Me.Totems[(int)type - 1];
 }
Пример #19
0
        /// <summary>
        ///   Destroys the totem described by type.
        /// </summary>
        /// <remarks>
        ///   Created 3/26/2011.
        /// </remarks>
        /// <param name = "type">The type.</param>
        public static void DestroyTotem(WoWTotemType type)
        {
            if (type == WoWTotemType.None)
            {
                return;
            }

            Lua.DoString("DestroyTotem({0})", (int)type);
        }