public static bool HasAnyAura(this WoWUnit unit, IEnumerable <int> ids) { var auras = unit.AuraCache(); var hashes = new HashSet <int>(ids); return(auras.Any(a => hashes.Contains(a.SpellId))); }
public static TimeSpan AuraTimeLeft(this WoWUnit unit, int auraId) { if (unit == null) { return(TimeSpan.Zero); } var aura = unit.AuraCache().FirstOrDefault(a => a.SpellId == auraId && a.TimeLeft > TimeSpan.Zero); return((aura == null) ? TimeSpan.Zero : aura.TimeLeft); }
public static TimeSpan AuraTimeLeft(this WoWUnit unit, string auraName) { if (unit == null) { return(TimeSpan.Zero); } var aura = unit.AuraCache().FirstOrDefault(a => a.Name == auraName && a.TimeLeft > TimeSpan.Zero); return((aura == null) ? TimeSpan.Zero : aura.TimeLeft); }
public static int AuraWithMechanicCount(this WoWUnit unit, params WoWSpellMechanic[] mechanics) { if (unit == null) { return(0); } var auras = unit.AuraCache(); return(auras.Count(a => mechanics.Contains(a.Spell.Mechanic))); }
public static bool HasAuraWithMechanic(this WoWUnit unit, params WoWSpellMechanic[] mechanics) { if (unit == null) { return(false); } var auras = unit.AuraCache(); return(auras.Any(a => mechanics.Contains(a.Spell.Mechanic))); }
public static WoWAura GetAuraWithMechanic(this WoWUnit unit, params WoWSpellMechanic[] mechanics) { if (unit == null) { return(null); } var auras = unit.AuraCache(); return(auras.FirstOrDefault(a => mechanics.Contains(a.Spell.Mechanic))); }
public static uint GetAuraStacks(this WoWUnit unit, int auraId) { if (unit == null) { return(0); } var aura = unit.AuraCache().FirstOrDefault(a => a.SpellId == auraId && a.TimeLeft > TimeSpan.Zero); return((aura == null) ? 0 : aura.StackCount); }
private static bool HasAuraWithEffect(this WoWUnit unit, params WoWApplyAuraType[] applyType) { var hashes = new HashSet <WoWApplyAuraType>(applyType); return(unit.AuraCache().Any(a => a.Spell != null && a.Spell.SpellEffects.Any(se => hashes.Contains(se.AuraType)))); }
public static bool HasStatsBuff(this WoWUnit unit) { return(unit.AuraCache().Any(u => Stats.Contains(u.SpellId))); }
public static bool HasMasteryBuff(this WoWUnit unit) { return(unit.AuraCache().Any(u => Mastery.Contains(u.SpellId))); }