I have some code from a WA
Currently it only shows when the character panel is open. Can some one modify this so that it always shows regardless of the character panel being opened or closed ?
Lua Code:
--CREATE FRAME
if not aura_env.AvoidanceFrame then
local f = CreateFrame("Frame", nil, aura_env.region)
f:SetAllPoints()
f.text = f:CreateFontString(nil, "OVERLAY")
f.text:SetFontObject("GameFontHighlight")
f.text:SetPoint("TOP", 0, -5)
f.text:SetText(avoidance(GetDodgeChance()))
f:RegisterEvent("COMBAT_RATING_UPDATE")
f:RegisterEvent("PLAYER_ENTERING_WORLD")
f:RegisterEvent("PLAYER_DAMAGE_DONE_MODS")
f:SetScript("OnEvent", function(self)
f.text:SetText(avoidance(GetDodgeChance()))
end)
GameTooltip:SetOwner(self, "ANCHOR_BOTTOM", 0, -10)
GameTooltip:AddLine("|cffffffffDefensive Stats|r")
GameTooltip:AddLine("Miss: " .. string.format("%.2f", missChance(getDefense())).."%")
GameTooltip:AddLine("Dodge: " .. string.format("%.2f", GetDodgeChance()).."%")
-- dont put block chance on tooltip if bear
if class == 1 or class == 2 then
GameTooltip:AddLine("Parry: " .. string.format("%.2f", GetParryChance()).."%")
GameTooltip:AddLine("---\n")
GameTooltip:AddLine("Block: " .. string.format("%.2f", GetBlockChance()).."%")
GameTooltip:AddLine("Block val: " .. GetShieldBlock())
GameTooltip:AddLine("---\n")
else
GameTooltip:AddLine("---\n")
end
GameTooltip:AddLine("With MotW & Kings:")
GameTooltip:AddLine(getAvoidance(getBuffedDodge()) .. "% / 102.4%")
GameTooltip:AddLine("---\n")
GameTooltip:AddLine("Illidan Shear:")
GameTooltip:AddLine("Unbuffed: " .. getAvoidance(GetDodgeChance()) - missChance(getDefense()) .. " / 102.4%")
GameTooltip:AddLine("Buffed: " .. getAvoidance(getBuffedDodge()) - missChance(getDefense()) .. " / 102.4%")
GameTooltip:Show()
end)
f:SetScript("OnLeave", function()
GameTooltip:Hide()
end)
aura_env.AvoidanceFrame = f
end