Code:
function()
-- BLOOD SHIELD VALUE FUNCTION
WA_GetBS = WA_GetBS or function()
-- Check for Blood Shield
local name = select(1, UnitAura("player", "Blood Shield"));
-- If exists then check value
if name then
-- Query stack count and scan tooltip for "size" info
local count = select(4, UnitAura("player", "Blood Shield"));
local size = select(3, WeakAuras.GetAuraTooltipInfo("player", name, nil))
-- Return either size, count, or 0
return size and size ~= 0 and size or count or 0;
-- No buff
else
return 0;
end
end
-- ***************************
-- POWER WORD: SHIELD VALUE FUNCTION
WA_GetPWS = WA_GetPWS or function()
-- Check for Power Word: Shield
local name = select(1, UnitAura("player", "Power Word: Shield"));
-- If exists then check value
if name then
-- Query stack count and scan tooltip for "size" info
local count = select(4, UnitAura("player", "Power Word: Shield"));
local size = select(3, WeakAuras.GetAuraTooltipInfo("player", name, nil))
-- Return either size, count, or 0
return size and size ~= 0 and size or count or 0;
-- No buff
else
return 0;
end
end
-- *********************************
-- DIVINE AEGIS VALUE FUNCTION
WA_GetDA = WA_GetDA or function()
-- Check for Divine Aegis
local name = select(1, UnitAura("player", "Divine Aegis"));
-- If exists then check value
if name then
-- Query stack count and scan tooltip for "size" info
local count = select(4, UnitAura("player", "Divine Aegis"));
local size = select(3, WeakAuras.GetAuraTooltipInfo("player", name, nil))
-- Return either size, count, or 0
return size and size ~= 0 and size or count or 0;
-- No buff
else
return 0;
end
end
-- ***************************
-- ILLUMINATED HEALING VALUE FUNCTION
WA_GetIH = WA_GetIH or function()
-- Check for Illuminated Healing
local name = select(1, UnitAura("player", "Illuminated Healing" ));
-- If exists then check value
if name then
-- Query stack count and scan tooltip for "size" info
local count = select(4, UnitAura("player", "Illuminated Healing" ));
local size = select(3, WeakAuras.GetAuraTooltipInfo("player", name, nil))
-- Return either size, count, or 0
return size and size ~= 0 and size or count or 0;
-- No buff
else
return 0;
end
end
-- ***************************
-- SPIRIT SHELL VALUE FUNCTION
WA_GetSS = WA_GetSS or function()
-- Check for Spirit Shell
local name = select(1, UnitAura("player", "Spirit Shell"));
-- If exists then check value
if name then
-- Query stack count and scan tooltip for "size" info
local count = select(4, UnitAura("player", "Spirit Shell"));
local size = select(3, WeakAuras.GetAuraTooltipInfo("player", name, nil))
-- Return either size, count, or 0
return size and size ~= 0 and size or count or 0;
-- No buff
else
return 0;
end
end
-- ***************************
-- SACRED SHIELD SHIELD VALUE FUNCTION
WA_GetSAS = WA_GetSAS or function()
-- Check for Sacred Shield
local spellId = select(11, UnitAura("player","Sacred Shield"))
-- since two auras exist, specify spellid
if spellId == 65148 then
-- If exists then check value
if spellId then
-- Query stack count and scan tooltip for "size" info
local count = select(4, UnitAura("player", spellId ));
local size = select(3, WeakAuras.GetAuraTooltipInfo("player", spellId , nil))
-- Return either size, count, or 0
return size and size ~= 0 and size or count or 0;
-- No buff
else
return 0;
end
else end
end
-- ***************************
-- Create local value variables
local bs = WA_GetBS();
local pws = WA_GetPWS();
local da = WA_GetDA();
local ih = WA_GetIH();
local ss = WA_GetSS();
local sas = WA_GetSAS();
-- Add all variables into total
local total = bs+pws+da+ss+ih+sas
-- Divide by 1k
local totalK = total/1000
-- Format return text
WA_BS_Return = string.format("%.0fK", totalK);
-- Return the text!
return WA_BS_Return or "0";
end