Ejemplo n.º 1
0
        /// <summary>Gets a dispellable types on unit. </summary>
        /// <remarks>Created 5/3/2011.</remarks>
        /// <param name="unit">The unit.</param>
        /// <returns>The dispellable types on unit.</returns>
        public static DispelCapabilities GetDispellableTypesOnUnit(WoWUnit unit)
        {
            DispelCapabilities ret = DispelCapabilities.None;

            foreach (var debuff in unit.Debuffs.Values)
            {
                // abort if target has one of the auras we should be sure to leave alone
                if (CleanseBlacklist.Instance.SpellList.Contains(debuff.SpellId))
                {
                    return(DispelCapabilities.None);
                }

                switch (debuff.Spell.DispelType)
                {
                case WoWDispelType.Magic:
                    ret |= DispelCapabilities.Magic;
                    break;

                case WoWDispelType.Curse:
                    ret |= DispelCapabilities.Curse;
                    break;

                case WoWDispelType.Disease:
                    ret |= DispelCapabilities.Disease;
                    break;

                case WoWDispelType.Poison:
                    ret |= DispelCapabilities.Poison;
                    break;
                }
            }
            return(ret);
        }
Ejemplo n.º 2
0
 public static void Init()
 {
     SingularRoutine.OnWoWContextChanged += (orig, ne) =>
     {
         _cachedCapabilities = Capabilities;
     };
 }
Ejemplo n.º 3
0
        /// <summary>Gets a dispellable types on unit. </summary>
        /// <remarks>Created 5/3/2011.</remarks>
        /// <param name="unit">The unit.</param>
        /// <returns>The dispellable types on unit.</returns>
        public static DispelCapabilities GetDispellableTypesOnUnit(WoWUnit unit)
        {
            DispelCapabilities ret = DispelCapabilities.None;

            foreach (var debuff in unit.Debuffs.Values)
            {
                switch (debuff.Spell.DispelType)
                {
                case WoWDispelType.Magic:
                    ret |= DispelCapabilities.Magic;
                    break;

                case WoWDispelType.Curse:
                    ret |= DispelCapabilities.Curse;
                    break;

                case WoWDispelType.Disease:
                    ret |= DispelCapabilities.Disease;
                    break;

                case WoWDispelType.Poison:
                    ret |= DispelCapabilities.Poison;
                    break;
                }
            }
            return(ret);
        }
Ejemplo n.º 4
0
 public static void Init()
 {
     AdvancedAI.OnWoWContextChanged += (orig, ne) =>
     {
         _cachedCapabilities = Capabilities;
     };
 }
Ejemplo n.º 5
0
 public static void Init()
 {
     SingularRoutine.OnWoWContextChanged += (orig, ne) =>
     {
         _cachedCapabilities = Capabilities;
     };
 }
Ejemplo n.º 6
0
 public static bool CanDispel(WoWUnit unit, DispelCapabilities chk)
 {
     return (chk & GetDispellableTypesOnUnit(unit)) != 0;
 }
Ejemplo n.º 7
0
 public static bool CanDispel(WoWUnit unit, DispelCapabilities chk)
 {
     return(SingularRoutine.IsAllowed(CapabilityFlags.DefensiveDispel) && (chk & GetDispellableTypesOnUnit(unit)) != 0);
 }
Ejemplo n.º 8
0
 public static bool CanDispel(WoWUnit unit, DispelCapabilities chk)
 {
     return((chk & GetDispellableTypesOnUnit(unit)) != 0);
 }
Ejemplo n.º 9
0
 public static bool CanDispel(WoWUnit unit, DispelCapabilities chk)
 {
     return SingularRoutine.IsAllowed(CapabilityFlags.DefensiveDispel) && (chk & GetDispellableTypesOnUnit(unit)) != 0;
 }