Exemplo n.º 1
0
        public static Ability FindSpell322(this Unit unit, AbilityId abilityId, bool cache = false)
        {
            if (!cache)
            {
                return(unit.Spellbook.Spells.FirstOrDefault(x => x.GetAbilityId() == abilityId));
            }

            Ability ability;
            var     n = unit.Handle + abilityId.ToString();

            if (!AbilityDictionary.TryGetValue(n, out ability) || ability == null || !ability.IsValid ||
                Utils.SleepCheck("Common.FindSpell322." + abilityId))
            {
                ability = unit.Spellbook.Spells.FirstOrDefault(x => x.GetAbilityId() == abilityId);
                if (AbilityDictionary.ContainsKey(n))
                {
                    AbilityDictionary[n] = ability;
                }
                else
                {
                    AbilityDictionary.TryAdd(n, ability);
                }

                Utils.Sleep(1000, "Common.FindSpell322." + abilityId);
            }

            if (ability == null || !ability.IsValid)
            {
                return(null);
            }

            return(ability);
        }
Exemplo n.º 2
0
 public static bool IsAbilityEnabled(AbilityId id) => GetToggle("spellHero", id.ToString());
Exemplo n.º 3
0
 public static bool IsAbilityEnabledTempest(AbilityId id) => GetToggle("spellTempest", id.ToString());
Exemplo n.º 4
0
 private static bool GetToggle(string name, AbilityId item)
 {
     return(Menu.Item(name).GetValue <AbilityToggler>().IsEnabled(item.ToString()));
 }
Exemplo n.º 5
0
 public static bool HasAbility(this Unit unit, AbilityId classId)
 {
     return(unit.Spellbook.Spells.Any(item => item.GetAbilityId() == classId));
 }
Exemplo n.º 6
0
 public static bool HasAbility(this Unit unit, AbilityId classId)
 {
     return(false);
     //return unit.HasAbility(classId);
     //return unit.Spellbook.Spells.Any(item => item.Id == classId);
 }