Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ()
- local show_allExterns = true;
- local show_allCDs = true;
- local show_allUtility = true;
- local show_aoeCCs = true;
- local show_allRezzes = true;
- local show_allInterrupts = true;
- --The following affects whether or not certain sections are displayed in a raid instance
- local show_raidBattleRezTimer = true; --If true, will display how many Battle Rez charges are available, and how long until a new charge becomes ready
- local show_allInterrupts_inRaid = false; --If false, will hide if you're in a raid instance or there are more than 20 players in your group
- local show_aoeCCs_inRaid = false; --If false, will hide if you're in a raid instance or there are more than 20 players in your group
- local show_Ankh_inRaid = true; --If true, Ankh CD will be displayed in addition to your Battle Rez timer
- local raidCDsIndentAmount = " " --Indents players' names under the title of their respective sections
- if (_raidCDs_textPoll == nil) then _raidCDs_textPoll = GetTime() end
- if (_raidCDs_namesText == nil) then _raidCDs_namesText = "" end
- if (GetTime() - _raidCDs_textPoll < 0.5) then
- return _raidCDs_namesText;
- else
- _raidCDs_textPoll = GetTime();
- end
- local _, instanceType = IsInInstance();
- _raidCDs_namesText = "";
- _raidCDs_cdText = "";
- _raidCDs_timeText = "";
- if WeakAuras.IsOptionsOpen() then
- if (GetNumGroupMembers() > 0) then
- _raidCDs_namesText = _raidCDs_namesText.."|cFF00A2E8Made by Tehr of Sargeras (US) |r"
- _raidCDs_cdText = _raidCDs_cdText..""
- _raidCDs_timeText = _raidCDs_timeText..""
- else
- _raidCDs_namesText = _raidCDs_namesText.."\n|cFF00A2E8Made by Tehr |r\n\n"..raidCDsIndentAmount.."|cFFC41F3BTehr (US)|r\n".."\n|cFF00A2E8Battle.net |r\n\n"..raidCDsIndentAmount.."|cFFFF7D0ATehr|r\n".."\n|cFF00A2E8Discord |r\n\n"..raidCDsIndentAmount.."|cFFC79C6ETehr|r\n".."\n|cFF00A2E8Stream |r\n\n"..raidCDsIndentAmount.."|cFFF58CBAtwitch.tv/tehrible|r\n".."\n|cFF00A2E8PayPal |r\n\n"..raidCDsIndentAmount.."|cFFFFFFFFtehrible@gmail.com|r\n".."\n|cFF00A2E8Latest updates available from: |r\n\n"..raidCDsIndentAmount.."|cFF00FF96wago.io/NyJLsr8PW|r\n"
- _raidCDs_cdText = _raidCDs_cdText.."\n\n\n|cFFC41F3BSargeras|r\n\n\n\n|cFFFF7D0A#1477|r\n\n\n\n|cFFC79C6E#5246|r\n\n\n\n\n\n\n\n\n\n\n\n\n";
- _raidCDs_timeText = _raidCDs_timeText.."\n\n\n|cFF00FF00READY|r\n\n\n\n|cFFFFCC0000:09|r\n\n\n\n|cFFFF660000:59|r\n\n\n\n|cFFFF000001:59|r\n\n\n\n|cFFFF660059|r\n\n\n\n|cFF555555READY|r\n";
- end
- end
- if (GetNumGroupMembers() > 0) then
- if (show_allExterns) then
- _raidCDs_namesText = _raidCDs_namesText.."\n|cFF00A2E8External CDs |r\n\n";
- _raidCDs_cdText = _raidCDs_cdText.."\n\n\n";
- _raidCDs_timeText = _raidCDs_timeText.."\n\n\n";
- local allExterns = {};
- allExterns["|cFFFF7D0A"] = _externCDs_druids;
- allExterns["|cFF00FF96"] = _externCDs_monks;
- allExterns["|cFFF58CBA"] = _externCDs_paladins;
- allExterns["|cFFFFFFFF"] = _externCDs_priests;
- allExterns["|cFFC79C6E"] = _externCDs_warriors;
- allExterns["|cFFA330C9"] = _externCDs_dhs;
- for theCDGroupColor, theCDGroup in pairs(allExterns) do
- if (theCDGroup ~= nil) then
- for name, cdData in pairs(theCDGroup) do
- for cdName, cdTime in pairs(cdData) do
- local timeColor;
- local cdDTime = cdTime - GetTime();
- if (UnitHealth(name) <= 0) then
- nameColor = "|cFF555555";
- timeColor = "|cFF555555";
- else
- if (cdDTime <= 0) then
- timeColor = "|cFF00FF00";
- elseif (cdDTime <= 10) then
- timeColor = "|cFFFFCC00";
- elseif (cdDTime <= 60) then
- timeColor = "|cFFFF6600";
- else
- timeColor = "|cFFFF0000";
- end
- end
- if (cdDTime <= 0) then
- cdDTime = timeColor.."READY|r";
- else
- cdDTime = timeColor..string.format("%02d:%02d", math.floor(cdDTime/60), math.floor(cdDTime - 60*math.floor(cdDTime/60))).."|r"
- end
- dashpos = string.find(name,"-");
- if (dashpos ~= nil) then name = string.sub(name, 0, dashpos - 1) end
- newName = string.sub(name, 0, 8);
- if (string.len(newName) < string.len(name)) then newName = newName..".." end
- _raidCDs_namesText = _raidCDs_namesText..raidCDsIndentAmount..theCDGroupColor..newName.."\n"
- _raidCDs_cdText = _raidCDs_cdText..theCDGroupColor..cdName.."\n";
- _raidCDs_timeText = _raidCDs_timeText..cdDTime.."\n";
- end
- end
- end
- end
- end
- if (show_allCDs) then
- _raidCDs_namesText = _raidCDs_namesText.."\n|cFF00A2E8Raid CDs |r\n\n";
- _raidCDs_cdText = _raidCDs_cdText.."\n\n\n";
- _raidCDs_timeText = _raidCDs_timeText.."\n\n\n";
- local allCDs = { };
- allCDs["|cFFFF7D0A"] = _raidCDs_druids;
- allCDs["|cFF00FF96"] = _raidCDs_monks;
- allCDs["|cFFF58CBA"] = _raidCDs_paladins;
- allCDs["|cFFFFFFFF"] = _raidCDs_priests;
- allCDs["|cFF0070DE"] = _raidCDs_shamans;
- allCDs["|cFFC79C6E"] = _raidCDs_warriors;
- allCDs["|cFFA330C9"] = _raidCDs_dhs;
- for theCDGroupColor, theCDGroup in pairs(allCDs) do
- if (theCDGroup ~= nil) then
- for name, cdData in pairs(theCDGroup) do
- for cdName, cdTime in pairs(cdData) do
- local timeColor;
- local cdDTime = cdTime - GetTime();
- if (UnitHealth(name) <= 0) then
- nameColor = "|cFF555555";
- timeColor = "|cFF555555";
- else
- if (cdDTime <= 0) then
- timeColor = "|cFF00FF00";
- elseif (cdDTime <= 10) then
- timeColor = "|cFFFFCC00";
- elseif (cdDTime <= 60) then
- timeColor = "|cFFFF6600";
- else
- timeColor = "|cFFFF0000";
- end
- end
- if (cdDTime <= 0) then
- cdDTime = timeColor.."READY|r";
- else
- cdDTime = timeColor..string.format("%02d:%02d", math.floor(cdDTime/60), math.floor(cdDTime - 60*math.floor(cdDTime/60))).."|r"
- end
- dashpos = string.find(name,"-");
- if (dashpos ~= nil) then name = string.sub(name, 0, dashpos - 1) end
- newName = string.sub(name, 0, 8);
- if (string.len(newName) < string.len(name)) then newName = newName..".." end
- _raidCDs_namesText = _raidCDs_namesText..raidCDsIndentAmount..theCDGroupColor..newName.."\n"
- _raidCDs_cdText = _raidCDs_cdText..theCDGroupColor..cdName.."\n";
- _raidCDs_timeText = _raidCDs_timeText..cdDTime.."\n";
- end
- end
- end
- end
- end
- if (show_allUtility) then
- _raidCDs_namesText = _raidCDs_namesText.."\n|cFF00A2E8Utility CDs |r\n\n";
- _raidCDs_cdText = _raidCDs_cdText.."\n\n\n";
- _raidCDs_timeText = _raidCDs_timeText.."\n\n\n";
- local allCDs = { };
- allCDs["|cFFC41F3B"] = _utilityCDs_dks;
- allCDs["|cFFA330C9"] = _utilityCDs_dhs;
- allCDs["|cFFFF7D0A"] = _utilityCDs_druids;
- allCDs["|cFFF58CBA"] = _utilityCDs_paladins;
- allCDs["|cFFFFFFFF"] = _utilityCDs_priests;
- allCDs["|cFF0070DE"] = _utilityCDs_shamans;
- for theCDGroupColor, theCDGroup in pairs(allCDs) do
- if (theCDGroup ~= nil) then
- for name, cdData in pairs(theCDGroup) do
- for cdName, cdTime in pairs(cdData) do
- local timeColor;
- local cdDTime = cdTime - GetTime();
- if (UnitHealth(name) <= 0) then
- nameColor = "|cFF555555";
- timeColor = "|cFF555555";
- else
- if (cdDTime <= 0) then
- timeColor = "|cFF00FF00";
- elseif (cdDTime <= 10) then
- timeColor = "|cFFFFCC00";
- elseif (cdDTime <= 60) then
- timeColor = "|cFFFF6600";
- else
- timeColor = "|cFFFF0000";
- end
- end
- if (cdDTime <= 0) then
- cdDTime = timeColor.."READY|r";
- else
- cdDTime = timeColor..string.format("%02d:%02d", math.floor(cdDTime/60), math.floor(cdDTime - 60*math.floor(cdDTime/60))).."|r"
- end
- dashpos = string.find(name,"-");
- if (dashpos ~= nil) then name = string.sub(name, 0, dashpos - 1) end
- newName = string.sub(name, 0, 8);
- if (string.len(newName) < string.len(name)) then newName = newName..".." end
- _raidCDs_namesText = _raidCDs_namesText..raidCDsIndentAmount..theCDGroupColor..newName.."\n"
- _raidCDs_cdText = _raidCDs_cdText..theCDGroupColor..cdName.."\n";
- _raidCDs_timeText = _raidCDs_timeText..cdDTime.."\n";
- end
- end
- end
- end
- end
- if (show_aoeCCs) then
- if ((instanceType ~= "raid") and GetNumGroupMembers()<21) or (show_aoeCCs_inRaid == true) then
- _raidCDs_namesText = _raidCDs_namesText.."\n|cFF00A2E8Crowd Control |r\n\n";
- _raidCDs_cdText = _raidCDs_cdText.."\n\n\n";
- _raidCDs_timeText = _raidCDs_timeText.."\n\n\n";
- local allCDs = { };
- allCDs["|cFFFF7D0A"] = _aoeCCs_druids;
- allCDs["|cFFFFFFFF"] = _aoeCCs_priests;
- allCDs["|cFFABD473"] = _aoeCCs_hunters;
- allCDs["|cFF69CCF0"] = _aoeCCs_mages;
- allCDs["|cFF00FF96"] = _aoeCCs_monks;
- allCDs["|cFF0070DE"] = _aoeCCs_shamans;
- allCDs["|cFFC79C6E"] = _aoeCCs_warriors;
- allCDs["|cFFA330C9"] = _aoeCCs_dhs;
- allCDs["|cFF9482C9"] = _aoeCCs_warlocks;
- allCDs["|cFFC41F3B"] = _aoeCCs_dks;
- allCDs["|cFFB4B4B4"] = _aoeCCs_tauren;
- for theCDGroupColor, theCDGroup in pairs(allCDs) do
- if (theCDGroup ~= nil) then
- for name, cdData in pairs(theCDGroup) do
- for cdName, cdTime in pairs(cdData) do
- local timeColor;
- local cdDTime = cdTime - GetTime();
- if (UnitHealth(name) <= 0) then
- nameColor = "|cFF555555";
- timeColor = "|cFF555555";
- else
- if (cdDTime <= 0) then
- timeColor = "|cFF00FF00";
- elseif (cdDTime <= 10) then
- timeColor = "|cFFFFCC00";
- elseif (cdDTime <= 60) then
- timeColor = "|cFFFF6600";
- else
- timeColor = "|cFFFF0000";
- end
- end
- if (cdDTime <= 0) then
- cdDTime = timeColor.."READY|r";
- else
- cdDTime = timeColor..string.format("%02d:%02d", math.floor(cdDTime/60), math.floor(cdDTime - 60*math.floor(cdDTime/60))).."|r"
- end
- dashpos = string.find(name,"-");
- if (dashpos ~= nil) then name = string.sub(name, 0, dashpos - 1) end
- newName = string.sub(name, 0, 8);
- if (string.len(newName) < string.len(name)) then newName = newName..".." end
- _raidCDs_namesText = _raidCDs_namesText..raidCDsIndentAmount..theCDGroupColor..newName.."\n"
- _raidCDs_cdText = _raidCDs_cdText..theCDGroupColor..cdName.."\n";
- _raidCDs_timeText = _raidCDs_timeText..cdDTime.."\n";
- end
- end
- end
- end
- end
- end
- if (show_allInterrupts) then
- if ((instanceType ~= "raid") and GetNumGroupMembers()<21) or (show_allInterrupts_inRaid == true) then
- _raidCDs_namesText = _raidCDs_namesText.."\n|cFF00A2E8Interrupts |r\n\n";
- _raidCDs_cdText = _raidCDs_cdText.."\n\n\n";
- _raidCDs_timeText = _raidCDs_timeText.."\n\n\n";
- local allinterrupts = { };
- allinterrupts["|cFFFF7D0A"] = _interrupts_druids;
- allinterrupts["|cFFFFFFFF"] = _interrupts_priests;
- allinterrupts["|cFFABD473"] = _interrupts_hunters;
- allinterrupts["|cFF69CCF0"] = _interrupts_mages;
- allinterrupts["|cFF00FF96"] = _interrupts_monks;
- allinterrupts["|cFFF58CBA"] = _interrupts_paladins;
- allinterrupts["|cFF0070DE"] = _interrupts_shamans;
- allinterrupts["|cFFC41F3B"] = _interrupts_dks;
- allinterrupts["|cFFFFF569"] = _interrupts_rogues;
- allinterrupts["|cFFC79C6E"] = _interrupts_warriors;
- allinterrupts["|cFFA330C9"] = _interrupts_dhs;
- allinterrupts["|cFF9482C9"] = _interrupts_warlocks;
- allinterrupts["|cFFB4B4B4"] = _interrupts_belfs;
- for theCDGroupColor, theCDGroup in pairs(allinterrupts) do
- if (theCDGroup ~= nil) then
- for name, cdData in pairs(theCDGroup) do
- for cdName, cdTime in pairs(cdData) do
- local timeColor;
- local cdDTime = cdTime - GetTime();
- if (UnitHealth(name) <= 0) then
- nameColor = "|cFF555555";
- timeColor = "|cFF555555";
- else
- if (cdDTime <= 0) then
- timeColor = "|cFF00FF00";
- elseif (cdDTime <= 10) then
- timeColor = "|cFFFFCC00";
- elseif (cdDTime <= 60) then
- timeColor = "|cFFFF6600";
- else
- timeColor = "|cFFFF0000";
- end
- end
- if (cdDTime <= 0) then
- cdDTime = timeColor.."READY|r";
- else
- cdDTime = timeColor..math.floor(cdDTime).."|r";
- end
- dashpos = string.find(name,"-");
- if (dashpos ~= nil) then name = string.sub(name, 0, dashpos - 1) end
- newName = string.sub(name, 0, 8);
- if (string.len(newName) < string.len(name)) then newName = newName..".." end
- _raidCDs_namesText = _raidCDs_namesText..raidCDsIndentAmount..theCDGroupColor..newName.."\n"
- _raidCDs_cdText = _raidCDs_cdText..theCDGroupColor..cdName.."\n";
- _raidCDs_timeText = _raidCDs_timeText..cdDTime.."\n";
- end
- end
- end
- end
- end
- end
- if (show_allRezzes) then
- if (instanceType ~= "raid") or (show_Ankh_inRaid == true) then
- local allCDs = { };
- local rezType = "Battle Rezzes"
- if (instanceType ~= "raid") then
- allCDs["|cFFC41F3B"] = _rezCDs_dks;
- allCDs["|cFFFF7D0A"] = _rezCDs_druids;
- allCDs["|cFFABD473"] = _rezCDs_hunters;
- allCDs["|cFF9482C9"] = _rezCDs_warlocks;
- allCDs["|cFF0070DE"] = _rezCDs_shamans;
- else
- allCDs["|cFF0070DE"] = _rezCDs_shamans;
- end
- _raidCDs_namesText = _raidCDs_namesText.."\n|cFF00A2E8"..rezType.." |r\n\n";
- _raidCDs_cdText = _raidCDs_cdText.."\n\n\n";
- _raidCDs_timeText = _raidCDs_timeText.."\n\n\n";
- for theCDGroupColor, theCDGroup in pairs(allCDs) do
- if (theCDGroup ~= nil) then
- for name, cdData in pairs(theCDGroup) do
- for cdName, cdTime in pairs(cdData) do
- local timeColor;
- local cdDTime = cdTime - GetTime();
- if (UnitHealth(name) <= 0) then
- nameColor = "|cFF555555";
- timeColor = "|cFF555555";
- else
- if (cdDTime <= 0) then
- timeColor = "|cFF00FF00";
- elseif (cdDTime <= 10) then
- timeColor = "|cFFFFCC00";
- elseif (cdDTime <= 60) then
- timeColor = "|cFFFF6600";
- else
- timeColor = "|cFFFF0000";
- end
- end
- if (cdDTime <= 0) then
- cdDTime = timeColor.."READY|r";
- else
- cdDTime = timeColor..string.format("%02d:%02d", math.floor(cdDTime/60), math.floor(cdDTime - 60*math.floor(cdDTime/60))).."|r"
- end
- dashpos = string.find(name,"-");
- if (dashpos ~= nil) then name = string.sub(name, 0, dashpos - 1) end
- newName = string.sub(name, 0, 8);
- if (string.len(newName) < string.len(name)) then newName = newName..".." end
- _raidCDs_namesText = _raidCDs_namesText..raidCDsIndentAmount..theCDGroupColor..newName.."\n"
- _raidCDs_cdText = _raidCDs_cdText..theCDGroupColor..cdName.."\n";
- _raidCDs_timeText = _raidCDs_timeText..cdDTime.."\n";
- end
- end
- end
- end
- end
- end
- if (show_raidBattleRezTimer) then
- if (instanceType == "raid") then
- -- BIG THANKS to Krazyito for this code and his help http://www.mmo-champion.com/threads/1686033-Weak-Auras-Battle-Res-Monitor-Looking-for-feedback
- if TehrsCDs_encounterStart then
- local rezCharges, _, started, duration = GetSpellCharges(20484)
- local timerString = ""
- if started then
- local brezTimer = duration - (GetTime() - started)
- local m = floor(brezTimer/60)
- local s = mod(brezTimer, 60)
- timerString = string.format("%02d:%02d", m, s)
- end
- if rezCharges == nil then
- rezCharges = 0
- end
- if rezCharges == 0 then
- rezCharges = "|cFF555555"..rezCharges.."|r"
- else
- rezCharges ="|cFF00FF00"..rezCharges.."|r"
- end
- _raidCDs_namesText = _raidCDs_namesText..raidCDsIndentAmount.."|cFFFFFFFFCharges|r:\n"
- _raidCDs_cdText = _raidCDs_cdText..rezCharges.."\n";
- _raidCDs_timeText = _raidCDs_timeText..timerString.."\n";
- end
- end
- end
- end
- local _, lineCount = string.gsub(_raidCDs_namesText, "\n", "");
- lineCount = lineCount + 1;
- if WeakAuras.regions["RaidCDs_Background"] then
- --
- WeakAuras.regions["RaidCDs_Background"].region:SetHeight( (lineCount * 11) - 10 );
- end
- return _raidCDs_namesText;
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement