public static async Task <bool> CastGroundOnMe(int Spell, System.Windows.Media.Color newColor, bool reqs = true, string addLog = "") { foreach (var item in GroundSpellBlacklist) { if (item.SpellId == Spell && item.IsBlacklisted()) { return(false); } } if (!reqs) { return(false); } //L.combatLog("Trying to cast: " + WoWSpell.FromId(Spell).Name + (String.IsNullOrEmpty(addLog) ? "" : " - " + addLog)); if (!SpellManager.CanCast(WoWSpell.FromId(Spell))) { return(false); } if (await GCD(Spell, newColor, true, "CastGround") && !await Coroutine.Wait(1000, () => Me.CurrentPendingCursorSpell != null)) { AddSpellToBlacklist(Spell); L.diagnosticsLog("No Cursor Detected"); return(false); } lastSpellCast = Spell; if (SpellManager.ClickRemoteLocation(Me.Location) == false) { AddSpellToBlacklist(Spell); } await CommonCoroutines.SleepForLagDuration(); return(true); }
public static uint luaGetMaxPower() { try { using (StyxWoW.Memory.AcquireFrame()) { return(Lua.GetReturnVal <uint>("return UnitPowerMax(\"player\");", 0)); } } catch (Exception xException) { L.diagnosticsLog("Exception in luaGetMaxPower(); ", xException); return(Me.CurrentPower); } }
/// <summary> /// How much time (in milliseconds) is left on the cooldown of a spell /// </summary> /// <param name="Spell">The integer based spell id</param> /// <returns></returns> public static double CooldownTimeLeft(int Spell) { try { SpellFindResults Results; return(SpellManager.FindSpell(Spell, out Results) ? (Results.Override != null ? Results.Override.CooldownTimeLeft.TotalMilliseconds : Results.Original.CooldownTimeLeft.TotalMilliseconds) : 9999); } catch (Exception xException) { L.diagnosticsLog("Exception in cooldownTimeLeft(); ", xException); return(0000); } }
public static SpellChargeInfo GetSpellChargeInfo(int Spell) { try { SpellFindResults Results; SpellManager.FindSpell(Spell, out Results); return(Results.Override != null ? Results.Override.GetChargeInfo() : Results.Original.GetChargeInfo()); } catch (Exception xException) { L.diagnosticsLog("Exception in cooldownTimeLeft(); ", xException); return(null); } }
/// <summary> /// Determine from SPellFindResults if the spell is on cooldown or not. /// </summary> /// <param name="Spell"></param> /// <returns></returns> public static bool OnCooldown(int Spell) { try { SpellFindResults Results; if (SpellManager.FindSpell(Spell, out Results)) { return(Results.Override != null ? Results.Override.Cooldown : Results.Original.Cooldown); } return(false); } catch (Exception xException) { L.diagnosticsLog("Exception in cooldownTimeLeft(); ", xException); return(false); } }
public static double auraTimeLeft(WoWUnit Unit, int auraID, bool isMyAura = false) { try { if (Unit == null || !Unit.IsValid) { return(0); } WoWAura Aura = isMyAura ? Unit.GetAllAuras().FirstOrDefault(A => A.SpellId == auraID && A.CreatorGuid == Me.Guid) : Unit.GetAllAuras().FirstOrDefault(A => A.SpellId == auraID); return(Aura != null ? Aura.TimeLeft.TotalMilliseconds : 0); } catch (Exception xException) { L.diagnosticsLog("Exception in auraExists(); ", xException); return(9999); } }
public static uint auraStacks(WoWUnit Unit, int auraID, bool isMyAura = false) { try { if (Unit == null || !Unit.IsValid) { return(0); } WoWAura Aura = isMyAura ? Unit.GetAllAuras().FirstOrDefault(A => A.SpellId == auraID && A.CreatorGuid == Me.Guid) : Unit.GetAllAuras().FirstOrDefault(A => A.SpellId == auraID); return(Aura != null ? Aura.StackCount : 0); } catch (Exception xException) { L.diagnosticsLog("Exception in auraStacks(); ", xException); return(0); } }