Skip to content

Commit

Permalink
Rip Nost
Browse files Browse the repository at this point in the history
-fixed [reactcolor]
-Aimed Shot now shows up on castbar
-fixed debuff tracking
  • Loading branch information
Aviana committed Apr 7, 2016
1 parent 4389435 commit 8515c9f
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 8 deletions.
2 changes: 1 addition & 1 deletion LunaUnitFrames.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions libs/CastLib-1.0/CastLib-1.0.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions modules/Tags.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
44 changes: 44 additions & 0 deletions modules/cast.lua
Original file line number Diff line number Diff line change
@@ -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 = {}
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion modules/squares.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

1 comment on commit 8515c9f

@jaxx56
Copy link

@jaxx56 jaxx56 commented on 8515c9f Apr 13, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addon! I like it 👍 :)

Please sign in to comment.