diff --git a/LunaUnitFrames.lua b/LunaUnitFrames.lua index 90bfd90c..35691140 100644 --- a/LunaUnitFrames.lua +++ b/LunaUnitFrames.lua @@ -2,7 +2,7 @@ LunaUF = AceLibrary("AceAddon-2.0"):new("AceEvent-2.0", "AceConsole-2.0", "AceDB LunaUF:RegisterDB("LunaDB") -- Assets ---------------------------------------------------------------------------------- -LunaUF.Version = 2006 +LunaUF.Version = 2007 LunaUF.BS = AceLibrary("Babble-Spell-2.2") LunaUF.Banzai = AceLibrary("Banzai-1.0") LunaUF.HealComm = AceLibrary("HealComm-1.0") diff --git a/libs/CastLib-1.0/CastLib-1.0.lua b/libs/CastLib-1.0/CastLib-1.0.lua index a2d8fa7e..74fd1e99 100644 --- a/libs/CastLib-1.0/CastLib-1.0.lua +++ b/libs/CastLib-1.0/CastLib-1.0.lua @@ -86,8 +86,8 @@ end function CastLib.instantCast(SpellCast) if CastLib_SpellCast_backup[1] == "Tranquilizing Shot" then - SendChatMessage("Tranq out!" ,"YELL" ,"COMMON") - SendChatMessage("Tranq out!" ,"CHANNEL" ,"COMMON", GetChannelName("insomniahunters")) + --SendChatMessage("Tranq out!" ,"YELL" ,"COMMON") + --SendChatMessage("Tranq out!" ,"CHANNEL" ,"COMMON", GetChannelName("insomniahunters")) end end diff --git a/modules/Tags.lua b/modules/Tags.lua index 65774849..8ab4bfc5 100644 --- a/modules/Tags.lua +++ b/modules/Tags.lua @@ -458,14 +458,14 @@ local defaultTags = { end; ["reactcolor"] = function(unit) local reaction = UnitReaction("player",unit) - if reaction == 4 then + if not reaction then + return "" + elseif reaction == 4 then return Hex(LunaUF.db.profile.healthColors["neutral"]) elseif reaction < 4 then return Hex(LunaUF.db.profile.healthColors["hostile"]) - elseif reaction then - return Hex(LunaUF.db.profile.healthColors["friendly"]) else - return "" + return Hex(LunaUF.db.profile.healthColors["friendly"]) end end; ["pvpcolor"] = function(unit) diff --git a/modules/cast.lua b/modules/cast.lua index e481ad24..6efd006f 100644 --- a/modules/cast.lua +++ b/modules/cast.lua @@ -1,6 +1,7 @@ local Cast = CreateFrame("Frame") local L = LunaUF.L local BS = LunaUF.BS +local AceEvent = LunaUF.AceEvent LunaUF:RegisterModule(Cast, "castBar", L["Cast bar"], true) local CasterDB = {} @@ -552,6 +553,46 @@ local function OnEvent() end end +local function OnAimed(cast) + if cast == "Aimed Shot" then + local frame + local _,_, latency = GetNetStats() + local casttime = 3 + for i=1,32 do + if UnitBuff("player",i) == "Interface\\Icons\\Ability_Warrior_InnerRage" then + casttime = casttime/1.3 + end + if UnitBuff("player",i) == "Interface\\Icons\\Ability_Hunter_RunningShot" then + casttime = casttime/1.4 + end + if UnitBuff("player",i) == "Interface\\Icons\\Racial_Troll_Berserk" then + casttime = casttime/ (1 + berserkValue) + end + if UnitBuff("player",i) == "Interface\\Icons\\Inv_Trinket_Naxxramas04" then + casttime = casttime/1.2 + end + if UnitDebuff("player",i) == "Interface\\Icons\\Spell_Shadow_CurseOfTounges" then + casttime = casttime/0.5 + end + end + for _,uframe in pairs(LunaUF.Units.frameList) do + if uframe.castBar and LunaUF.db.profile.units[uframe.unitGroup].castBar.enabled and UnitIsUnit(uframe.unit,"player") then + frame = uframe + end + end + frame.castBar.startTime = GetTime() + frame.castBar.maxValue = frame.castBar.startTime + casttime + (latency/1000) + frame.castBar.holdTime = 0 + frame.castBar.casting = true + frame.castBar.delaySum = 0 + frame.castBar.Text:SetText(BS["Aimed Shot"]) + frame.castBar:SetMinMaxValues(frame.castBar.startTime, frame.castBar.maxValue) + frame.castBar:SetValue(frame.castBar.startTime) + frame.castBar:SetScript("OnUpdate", OnUpdatePlayer) + Cast:FullUpdate(frame) + end +end + function Cast:OnEnable(frame) if not frame.castBar then frame.castBar = CreateFrame("Statusbar", nil, frame) @@ -574,6 +615,9 @@ function Cast:OnEnable(frame) frame.castBar:RegisterEvent("SPELLCAST_INTERRUPTED") frame.castBar:RegisterEvent("SPELLCAST_START") frame.castBar:RegisterEvent("SPELLCAST_STOP") + if not AceEvent:IsEventRegistered("CASTLIB_STARTCAST") then + AceEvent:RegisterEvent("CASTLIB_STARTCAST", OnAimed) + end end function Cast:OnDisable(frame) diff --git a/modules/squares.lua b/modules/squares.lua index 65dd1932..b720c01d 100644 --- a/modules/squares.lua +++ b/modules/squares.lua @@ -58,7 +58,7 @@ function Squares:OnEnable(frame) frame.squares.trackdebuffs[i] = CreateFrame("Frame", nil, frame.squares) frame.squares.trackdebuffs[i]:SetBackdrop(LunaUF.constants.backdrop) frame.squares.trackdebuffs[i]:SetBackdropColor(0,0,0) - frame.squares.trackdebuffs[i].texture = frame.squares:CreateTexture(nil, "ARTWORK") + frame.squares.trackdebuffs[i].texture = frame.squares.trackdebuffs[i]:CreateTexture(nil, "ARTWORK") frame.squares.trackdebuffs[i].texture:SetAllPoints(frame.squares.trackdebuffs[i]) frame.squares.centericons[i] = frame.squares:CreateTexture(nil, "ARTWORK")