public bool HasUnitStealableBuffs(WowLuaUnit luaUnit) { LuaDoString($"abIsStealableStuffThere=0;local y=0;for i=1,40 do local n,_,_,_,_,_,_,_,isStealable=UnitAura(\"{luaUnit}\",i);if isStealable==1 then abIsStealableStuffThere=1;end end"); string rawValue = GetLocalizedText("abIsStealableStuffThere"); return(int.TryParse(rawValue, out int result) ? result == 1 : false); }
/// <summary> /// Check if the WowLuaUnit is casting or channeling a spell /// </summary> /// <param name="luaunit">player, target, party1...</param> /// <returns>(Spellname, duration)</returns> public (string, int) GetUnitCastingInfo(WowLuaUnit luaunit) { string command = $"abCastingInfo = \"none,0\"; abSpellName, x, x, x, x, abSpellEndTime = UnitCastingInfo(\"{luaunit.ToString()}\"); abDuration = ((abSpellEndTime/1000) - GetTime()) * 1000; abCastingInfo = abSpellName..\",\"..abDuration;"; LuaDoString(command); string str = GetLocalizedText("abCastingInfo"); if (double.TryParse(str.Split(',')[1], out double timeRemaining)) { return(str.Split(',')[0], (int)Math.Round(timeRemaining, 0)); } return(string.Empty, 0); }
public List <string> GetDebuffs(WowLuaUnit luaunit) => ReadAuras(luaunit, "UnitDebuff");
public List <string> GetAuras(WowLuaUnit luaunit) => ReadAuras(luaunit, "UnitAura");