if select(2,UnitClass("player")) == "DEATHKNIGHT" then |
local f = CreateFrame("Frame",nil,UIParent) |
local foo = 18 |
local cross = "|TInterface\\TargetingFrame\\UI-RaidTargetingIcon_7.blp:0|t" |
|
local r,g,b = DebuffTypeColor["Disease"].r,DebuffTypeColor["Disease"].g,DebuffTypeColor["Disease"].b |
local GTBLib = LibStub:GetLibrary("GTB-1.0") |
local IF = select(3,GetSpellInfo(48792)) |
local LB = select(3,GetSpellInfo(49039)) |
local UA = select(3,GetSpellInfo(51271)) |
local BB = select(3,GetSpellInfo(49182)) |
local HoW = select(3,GetSpellInfo(57330)) |
local UB = select(3,GetSpellInfo(49194)) |
local BS = select(3,GetSpellInfo(49222)) |
local BP = "Interface\\Icons\\Spell_DeathKnight_BloodPlague" |
local FF = "Interface\\Icons\\Spell_DeathKnight_FrostFever" |
local EB = "Interface\\Icons\\Ability_Creature_Cursed_03" |
local BloodPlague = f:CreateTexture(nil,"HIGH") |
BloodPlague:SetWidth(foo) |
BloodPlague:SetHeight(foo) |
BloodPlague:SetTexture("Interface\\Icons\\Spell_DeathKnight_BloodPlague") |
BloodPlague:SetPoint("TOPLEFT",TargetFrame,"TOPRIGHT",-35,-17) |
local BloodPlagueText = f:CreateFontString(nil,"OVERLAY") |
BloodPlagueText:SetFontObject("GameFontNormalLarge") |
BloodPlagueText:SetPoint("LEFT",BloodPlague,"RIGHT",5,0) |
BloodPlague:SetAlpha(0) |
|
local anchor1 = GTBLib:RegisterGroup("Death Knight Diseases","Interface\\TargetingFrame\\UI-StatusBar") |
anchor1:EnableGradient(false) |
anchor1:SetBarGrowth("UP") |
anchor1:SetAnchorVisible(false) |
anchor1:SetBaseColor(0,1,0) |
anchor1:SetPoint("CENTER",UIParent,"BOTTOM",0,170) |
local FrostFever = f:CreateTexture(nil,"HIGH") |
FrostFever:SetWidth(foo) |
FrostFever:SetHeight(foo) |
FrostFever:SetTexture("Interface\\Icons\\Spell_DeathKnight_FrostFever") |
FrostFever:SetPoint("TOP",BloodPlague,"BOTTOM",0,0) |
local FrostFeverText = f:CreateFontString(nil,"OVERLAY") |
FrostFeverText:SetFontObject("GameFontNormalLarge") |
FrostFeverText:SetPoint("LEFT",FrostFever,"RIGHT",5,0) |
FrostFever:SetAlpha(0) |
|
local anchor2 = GTBLib:RegisterGroup("Death Knight Buffs","Interface\\TargetingFrame\\UI-StatusBar") |
anchor2:SetBarGrowth("UP") |
anchor2:SetAnchorVisible(false) |
anchor2:SetBaseColor(0,1,0) |
anchor2:SetPoint("CENTER",UIParent,"BOTTOM",0,220) |
local EbonPlague = f:CreateTexture(nil,"HIGH") |
EbonPlague:SetWidth(foo) |
EbonPlague:SetHeight(foo) |
EbonPlague:SetTexture("Interface\\Icons\\Ability_Creature_Cursed_03") |
EbonPlague:SetPoint("TOP",FrostFever,"BOTTOM",0,0) |
local EbonPlagueText = f:CreateFontString(nil,"OVERLAY") |
EbonPlagueText:SetFontObject("GameFontNormalLarge") |
EbonPlagueText:SetPoint("LEFT",EbonPlague,"RIGHT",5,0) |
EbonPlague:SetAlpha(0) |
|
local function checkbuffs() |
if UnitAura("player","Icebound Fortitude") then |
anchor2:RegisterBar("Icebound Fortitude", "Icebound Fortitude", select(7,UnitAura("player","Icebound Fortitude"))-GetTime(), select(6,UnitAura("player","Icebound Fortitude")), IF) |
local r,g,b = 0,1,0 |
f:RegisterEvent("PLAYER_TARGET_CHANGED") |
f:SetScript("OnEvent",function(self) |
if UnitExists("target") and not UnitIsFriend("player","target") then |
self:SetScript("OnUpdate", function() |
if select(8,UnitDebuff("target","Blood Plague")) == "player" then |
local lenght = select(6,UnitDebuff("target","Blood Plague")) |
local remaining = select(7,UnitDebuff("target","Blood Plague"))-GetTime() |
local percent = remaining / lenght |
if ( percent > 0.5 ) then r,g,b = 2 * (1 - percent), 1, 0 |
else r,g,b = 1, 2 * percent, 0 end |
if remaining > 0 then |
BloodPlague:SetAlpha(1) |
BloodPlagueText:SetTextColor(r,g,b) |
BloodPlagueText:SetFormattedText("%.1f", remaining) |
end |
else |
BloodPlague:SetAlpha(0.5) |
BloodPlagueText:SetText(cross) |
end |
if select(8,UnitDebuff("target","Frost Fever")) == "player" then |
local lenght = select(6,UnitDebuff("target","Frost Fever")) |
local remaining = select(7,UnitDebuff("target","Frost Fever"))-GetTime() |
local percent = remaining / lenght |
if ( percent > 0.5 ) then r,g,b = 2 * (1 - percent), 1, 0 |
else r,g,b = 1, 2 * percent, 0 end |
if remaining > 0 then |
FrostFever:SetAlpha(1) |
FrostFeverText:SetTextColor(r,g,b) |
FrostFeverText:SetFormattedText("%.1f", remaining) |
end |
else |
FrostFever:SetAlpha(0.5) |
FrostFeverText:SetText(cross) |
end |
if select(8,UnitDebuff("target","Ebon Plague")) == "player" then |
local lenght = select(6,UnitDebuff("target","Ebon Plague")) |
local remaining = select(7,UnitDebuff("target","Ebon Plague"))-GetTime() |
local percent = remaining / lenght |
if ( percent > 0.5 ) then r,g,b = 2 * (1 - percent), 1, 0 |
else r,g,b = 1, 2 * percent, 0 end |
if remaining > 0 then |
EbonPlague:SetAlpha(1) |
EbonPlagueText:SetTextColor(r,g,b) |
EbonPlagueText:SetFormattedText("%.1f", remaining) |
end |
else |
EbonPlague:SetAlpha(0.5) |
EbonPlagueText:SetText(cross) |
end |
end) |
else |
anchor2:UnregisterBar("Icebound Fortitude") |
self:SetScript("OnUpdate",nil) |
BloodPlague:SetAlpha(0) |
BloodPlagueText:SetText("") |
FrostFever:SetAlpha(0) |
FrostFeverText:SetText("") |
EbonPlague:SetAlpha(0) |
EbonPlagueText:SetText("") |
end |
if UnitAura("player","Lichborne") then |
anchor2:RegisterBar("Lichborne", "Lichborne", select(7,UnitAura("player","Lichborne"))-GetTime(), select(6,UnitAura("player","Lichborne")), LB) |
else |
anchor2:UnregisterBar("Lichborne") |
end |
if UnitAura("player","Unbreakable Armor") then |
anchor2:RegisterBar("Unbreakable Armor", "Unbreakable Armor", select(7,UnitAura("player","Unbreakable Armor"))-GetTime(), select(6,UnitAura("player","Unbreakable Armor")), UA) |
else |
anchor2:UnregisterBar("Unbreakable Armor") |
end |
if UnitAura("player","Blade Barrier") then |
anchor2:RegisterBar("Blade Barrier", "Blade Barrier", select(7,UnitAura("player","Blade Barrier"))-GetTime(), select(6,UnitAura("player","Blade Barrier")), BB) |
else |
anchor2:UnregisterBar("Blade Barrier") |
end |
if UnitAura("player","Horn of Winter") then |
anchor2:RegisterBar("Horn of Winter", "Horn of Winter", select(7,UnitAura("player","Horn of Winter"))-GetTime(), select(6,UnitAura("player","Horn of Winter")), HoW) |
else |
anchor2:UnregisterBar("Horn of Winter") |
end |
if UnitAura("player","Unholy Blight") then |
anchor2:RegisterBar("Unholy Blight", "Unholy Blight", select(7,UnitAura("player","Unholy Blight"))-GetTime(), select(6,UnitAura("player","Unholy Blight")), UB) |
else |
anchor2:UnregisterBar("Unholy Blight") |
end |
if UnitAura("player","Bone Shield") then |
anchor2:RegisterBar("Bone Shield", "Bone Shield ("..select(4,UnitAura("player","Bone Shield"))..")",select(7,UnitAura("player","Bone Shield"))-GetTime(), select(6,UnitAura("player","Bone Shield")), BS) |
else |
anchor2:UnregisterBar("Bone Shield") |
end |
end |
|
local function checkdiseases() |
if UnitExists("target") and select(8,UnitDebuff("target","Blood Plague")) == "player" then |
anchor1:RegisterBar("Blood Plague", "Blood Plague", select(7,UnitDebuff("target","Blood Plague"))-GetTime(), select(6,UnitDebuff("target","Blood Plague")), BP, 0.6, 0.4, 0) |
else |
anchor1:UnregisterBar("Blood Plague") |
end |
if UnitExists("target") and select(8,UnitDebuff("target","Frost Fever")) == "player" then |
anchor1:RegisterBar("Frost Fever", "Frost Fever", select(7,UnitDebuff("target","Frost Fever"))-GetTime(), select(6,UnitDebuff("target","Frost Fever")), FF, 0.6, 0.4, 0) |
else |
anchor1:UnregisterBar("Frost Fever") |
end |
if UnitExists("target") and select(8,UnitDebuff("target","Ebon Plague")) == "player" then |
anchor1:RegisterBar("Ebon Plague", "Ebon Plague", select(7,UnitDebuff("target","Ebon Plague"))-GetTime(), select(6,UnitDebuff("target","Ebon Plague")), EB, 0.6, 0.4, 0) |
else |
anchor1:UnregisterBar("Ebon Plague") |
end |
end |
|
|
local frame = CreateFrame("frame") |
frame:RegisterEvent("PLAYER_ENTERING_WORLD") |
frame:RegisterEvent("PLAYER_TARGET_CHANGED") |
frame:RegisterEvent("UNIT_AURA") |
frame:SetScript("OnEvent", function(self,event,id) |
if event == "PLAYER_ENTERING_WORLD" then |
checkbuffs() |
self:UnregisterEvent("PLAYER_ENTERING_WORLD") |
elseif event == "PLAYER_TARGET_CHANGED" then |
checkdiseases() |
else |
if id == "target" then |
checkdiseases() |
elseif id == "player" then |
checkbuffs() |
end |
end |
end) |
|
end |