Merge branch 'release/v2.20' into main
This commit is contained in:
		
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -6,4 +6,5 @@ BuffLib
 | 
			
		||||
Ace-Libs
 | 
			
		||||
Images_Raw
 | 
			
		||||
Gladdy_old
 | 
			
		||||
untracked
 | 
			
		||||
Gladdy_TW
 | 
			
		||||
@@ -2,44 +2,14 @@ local tbl_sort, select, string_lower = table.sort, select, string.lower
 | 
			
		||||
 | 
			
		||||
local GetSpellInfo = GetSpellInfo
 | 
			
		||||
local GetItemInfo = GetItemInfo
 | 
			
		||||
local GetLocale = GetLocale
 | 
			
		||||
 | 
			
		||||
local Gladdy = LibStub("Gladdy")
 | 
			
		||||
local L = Gladdy.L
 | 
			
		||||
local AURA_TYPE_DEBUFF, AURA_TYPE_BUFF = AURA_TYPE_DEBUFF, AURA_TYPE_BUFF
 | 
			
		||||
 | 
			
		||||
Gladdy.expansion = "BCC"
 | 
			
		||||
Gladdy.CLASSES = {"MAGE", "PRIEST", "DRUID", "SHAMAN", "PALADIN", "WARLOCK", "WARRIOR", "HUNTER", "ROGUE"}
 | 
			
		||||
tbl_sort(Gladdy.CLASSES)
 | 
			
		||||
Gladdy.RACES = {"Scourge", "BloodElf", "Tauren", "Orc", "Troll", "NightElf", "Draenei", "Human", "Gnome", "Dwarf"}
 | 
			
		||||
tbl_sort(Gladdy.RACES)
 | 
			
		||||
 | 
			
		||||
local RACE_ICON_TCOORDS = {
 | 
			
		||||
    ["HUMAN_MALE"]		= {0, 0.125, 0, 0.25},
 | 
			
		||||
    ["DWARF_MALE"]		= {0.125, 0.25, 0, 0.25},
 | 
			
		||||
    ["GNOME_MALE"]		= {0.25, 0.375, 0, 0.25},
 | 
			
		||||
    ["NIGHTELF_MALE"]	= {0.375, 0.5, 0, 0.25},
 | 
			
		||||
 | 
			
		||||
    ["TAUREN_MALE"]		= {0, 0.125, 0.25, 0.5},
 | 
			
		||||
    ["SCOURGE_MALE"]	= {0.125, 0.25, 0.25, 0.5},
 | 
			
		||||
    ["TROLL_MALE"]		= {0.25, 0.375, 0.25, 0.5},
 | 
			
		||||
    ["ORC_MALE"]		= {0.375, 0.5, 0.25, 0.5},
 | 
			
		||||
 | 
			
		||||
    ["HUMAN_FEMALE"]	= {0, 0.125, 0.5, 0.75},
 | 
			
		||||
    ["DWARF_FEMALE"]	= {0.125, 0.25, 0.5, 0.75},
 | 
			
		||||
    ["GNOME_FEMALE"]	= {0.25, 0.375, 0.5, 0.75},
 | 
			
		||||
    ["NIGHTELF_FEMALE"]	= {0.375, 0.5, 0.5, 0.75},
 | 
			
		||||
 | 
			
		||||
    ["TAUREN_FEMALE"]	= {0, 0.125, 0.75, 1.0},
 | 
			
		||||
    ["SCOURGE_FEMALE"]	= {0.125, 0.25, 0.75, 1.0},
 | 
			
		||||
    ["TROLL_FEMALE"]	= {0.25, 0.375, 0.75, 1.0},
 | 
			
		||||
    ["ORC_FEMALE"]		= {0.375, 0.5, 0.75, 1.0},
 | 
			
		||||
 | 
			
		||||
    ["BLOODELF_MALE"]	= {0.5, 0.625, 0.25, 0.5},
 | 
			
		||||
    ["BLOODELF_FEMALE"]	= {0.5, 0.625, 0.75, 1.0},
 | 
			
		||||
 | 
			
		||||
    ["DRAENEI_MALE"]	= {0.5, 0.625, 0, 0.25},
 | 
			
		||||
    ["DRAENEI_FEMALE"]	= {0.5, 0.625, 0.5, 0.75},
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
local specBuffs = {
 | 
			
		||||
    -- DRUID
 | 
			
		||||
@@ -51,7 +21,7 @@ local specBuffs = {
 | 
			
		||||
    [GetSpellInfo(33891)] = L["Restoration"], -- Tree of Life
 | 
			
		||||
 | 
			
		||||
    -- HUNTER
 | 
			
		||||
    [GetSpellInfo(34692)] = L["Beast Mastery"], -- The Beast Within
 | 
			
		||||
    [GetSpellInfo(34471)] = L["Beast Mastery"], -- The Beast Within
 | 
			
		||||
    [GetSpellInfo(20895)] = L["Beast Mastery"], -- Spirit Bond
 | 
			
		||||
    [GetSpellInfo(34455)] = L["Beast Mastery"], -- Ferocious Inspiration
 | 
			
		||||
    [GetSpellInfo(27066)] = L["Marksmanship"], -- Trueshot Aura
 | 
			
		||||
@@ -108,8 +78,8 @@ local specBuffs = {
 | 
			
		||||
    [GetSpellInfo(19028)] = L["Demonology"], -- Soul Link
 | 
			
		||||
    [GetSpellInfo(23759)] = L["Demonology"], -- Master Demonologist
 | 
			
		||||
    [GetSpellInfo(35696)] = L["Demonology"], -- Demonic Knowledge
 | 
			
		||||
    [GetSpellInfo(30302)] = L["Destruction"], -- Nether Protection
 | 
			
		||||
    [GetSpellInfo(34935)] = L["Destruction"], -- Backlash
 | 
			
		||||
    [GetSpellInfo(30300)] = L["Destruction"], -- Nether Protection
 | 
			
		||||
    [GetSpellInfo(34936)] = L["Destruction"], -- Backlash
 | 
			
		||||
 | 
			
		||||
    -- WARRIOR
 | 
			
		||||
    [GetSpellInfo(29838)] = L["Arms"], -- Second Wind
 | 
			
		||||
@@ -338,11 +308,11 @@ local importantAuras = {
 | 
			
		||||
        spellID = 19577,
 | 
			
		||||
    },
 | 
			
		||||
    -- The Beast Within
 | 
			
		||||
    [GetSpellInfo(34692)] = {
 | 
			
		||||
    [GetSpellInfo(34471)] = {
 | 
			
		||||
        track = AURA_TYPE_BUFF,
 | 
			
		||||
        duration = 18,
 | 
			
		||||
        priority = 20,
 | 
			
		||||
        spellID = 34692,
 | 
			
		||||
        spellID = 34471,
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -399,6 +369,11 @@ local importantAuras = {
 | 
			
		||||
        priority = 20,
 | 
			
		||||
        spellID = 45438,
 | 
			
		||||
    },
 | 
			
		||||
    [GetSpellInfo(41425)] = { -- Hypothermia (Ice Block Immune
 | 
			
		||||
        track = AURA_TYPE_DEBUFF,
 | 
			
		||||
        priority = 8,
 | 
			
		||||
        spellID = 41425,
 | 
			
		||||
    },
 | 
			
		||||
    -- Impact
 | 
			
		||||
    [GetSpellInfo(12355)] = {
 | 
			
		||||
        track = AURA_TYPE_DEBUFF,
 | 
			
		||||
@@ -846,35 +821,6 @@ function Gladdy:GetInterrupts()
 | 
			
		||||
    return interrupts
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local auraTypeColor = {}
 | 
			
		||||
auraTypeColor["none"]     = { r = 0.80, g = 0, b = 0 , a = 1}
 | 
			
		||||
auraTypeColor["magic"]    = { r = 0.20, g = 0.60, b = 1.00, a = 1}
 | 
			
		||||
auraTypeColor["curse"]    = { r = 0.60, g = 0.00, b = 1.00, a = 1 }
 | 
			
		||||
auraTypeColor["disease"]  = { r = 0.60, g = 0.40, b = 0, a = 1 }
 | 
			
		||||
auraTypeColor["poison"]   = { r = 0.00, g = 0.60, b = 0, a = 1 }
 | 
			
		||||
auraTypeColor["immune"]   = { r = 1.00, g = 0.02, b = 0.99, a = 1 }
 | 
			
		||||
auraTypeColor["form"]     = auraTypeColor["none"]
 | 
			
		||||
auraTypeColor["aura"]     = auraTypeColor["none"]
 | 
			
		||||
auraTypeColor[""]         = auraTypeColor["none"]
 | 
			
		||||
 | 
			
		||||
function Gladdy:GetAuraTypeColor()
 | 
			
		||||
    return auraTypeColor
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local spellSchoolColors = {}
 | 
			
		||||
spellSchoolColors[1] = {r = 1, g = 1, b = 0, a =  1, type = "Physical"} --- "physical" 255, 255, 0
 | 
			
		||||
spellSchoolColors[2] = {r = 1, g = 0.901, b = 0.501, a =  1, type = "Holy"} ---"holy" -- 255, 230, 128
 | 
			
		||||
spellSchoolColors[4] = {r = 1, g = 0.501, b = 0, a =  1, type = "Fire"} ---"fire" --  255, 128, 0
 | 
			
		||||
spellSchoolColors[8] = {r = 0.302, g = 1, b = 0.302, a =  1, type = "Nature"} ---"nature" --  77, 255, 77
 | 
			
		||||
spellSchoolColors[16] = {r = 0.501, g = 1, b = 1, a =  1, type = "Frost"} ---"frost" -- 128, 255, 255
 | 
			
		||||
spellSchoolColors[32] = {r = 0.501, g = 0.501, b = 1, a =  1, type = "Shadow"} ---"shadow" --128, 128, 255
 | 
			
		||||
spellSchoolColors[64] = {r = 1, g = 0.501, b = 1, a =  1, type = "Arcane"} ---"arcane" -- 255, 128, 255
 | 
			
		||||
spellSchoolColors["unknown"] = {r = 0, g = 0, b = 0, a =  1, type = "Unknown"} ---"unknown spell school"
 | 
			
		||||
 | 
			
		||||
function Gladdy:GetSpellSchoolColors()
 | 
			
		||||
    return spellSchoolColors
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local cooldownList = {
 | 
			
		||||
    -- Spell Name			   Cooldown[, Spec]
 | 
			
		||||
    -- Mage
 | 
			
		||||
@@ -1034,7 +980,7 @@ local cooldownList = {
 | 
			
		||||
        [34490] = { cd = 20, spec = L["Marksmanship"], }, -- Silencing Shot
 | 
			
		||||
        [19386] = { cd = 60, spec = L["Survival"], }, -- Wyvern Sting
 | 
			
		||||
        [19577] = { cd = 60, spec = L["Beast Mastery"], }, -- Intimidation
 | 
			
		||||
        [38373] = { cd = 120, spec = L["Beast Mastery"], }, -- The Beast Within
 | 
			
		||||
        [34471] = { cd = 120, spec = L["Beast Mastery"], }, -- The Beast Within
 | 
			
		||||
        [5384] = 30, -- Feign Death
 | 
			
		||||
        [3034] = 15, -- Viper Sting
 | 
			
		||||
        [1543] = 20, -- Flare
 | 
			
		||||
@@ -1168,154 +1114,6 @@ function Gladdy:Racials()
 | 
			
		||||
    return racials
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local arenaTimer = {
 | 
			
		||||
    ["default"] = {
 | 
			
		||||
        [61] = "One minute until the Arena battle begins!",
 | 
			
		||||
        [31] = "Thirty seconds until the Arena battle begins!",
 | 
			
		||||
        [16] = "Fifteen seconds until the Arena battle begins!",
 | 
			
		||||
        [0] = "The Arena battle has begun!",
 | 
			
		||||
    },
 | 
			
		||||
    ["esES"] = {
 | 
			
		||||
        [61] = "¡Un minuto hasta que dé comienzo la batalla en arena!",
 | 
			
		||||
        [31] = "¡Treinta segundos hasta que comience la batalla en arena!",
 | 
			
		||||
        [16] = "¡Quince segundos hasta que comience la batalla en arena!",
 | 
			
		||||
        [0] = "¡La batalla en arena ha comenzado!",
 | 
			
		||||
    },
 | 
			
		||||
    ["ptBR"] = {
 | 
			
		||||
        [61] = "Um minuto até a batalha na Arena começar!",
 | 
			
		||||
        [31] = "Trinta segundos até a batalha na Arena começar!",
 | 
			
		||||
        [16] = "Quinze segundos até a batalha na Arena começar!",
 | 
			
		||||
        [0] = "A batalha na Arena começou!",
 | 
			
		||||
    },
 | 
			
		||||
    ["deDE"] = {
 | 
			
		||||
        [61] = "Noch eine Minute bis der Arenakampf beginnt!",
 | 
			
		||||
        [31] = "Noch dreißig Sekunden bis der Arenakampf beginnt!",
 | 
			
		||||
        [16] = "Noch fünfzehn Sekunden bis der Arenakampf beginnt!",
 | 
			
		||||
        [0] = "Der Arenakampf hat begonnen!",
 | 
			
		||||
    },
 | 
			
		||||
    ["frFR"] = {
 | 
			
		||||
        [61] = "Le combat d'arène commence dans une minute\194\160!",
 | 
			
		||||
        [31] = "Le combat d'arène commence dans trente secondes\194\160!",
 | 
			
		||||
        [16] = "Le combat d'arène commence dans quinze secondes\194\160!",
 | 
			
		||||
        [0] = "Le combat d'arène commence\194\160!",
 | 
			
		||||
    },
 | 
			
		||||
    ["ruRU"] = {
 | 
			
		||||
        [61] = "Одна минута до начала боя на арене!",
 | 
			
		||||
        [31] = "Тридцать секунд до начала боя на арене!",
 | 
			
		||||
        [16] = "До начала боя на арене осталось 15 секунд.",
 | 
			
		||||
        [0] = "Бой начался!",
 | 
			
		||||
    },
 | 
			
		||||
    ["itIT"] = { -- TODO
 | 
			
		||||
        -- Beta has no itIT version available?
 | 
			
		||||
    },
 | 
			
		||||
    ["koKR"] = {
 | 
			
		||||
        [61] = "투기장 전투 시작 1분 전입니다!",
 | 
			
		||||
        [31] = "투기장 전투 시작 30초 전입니다!",
 | 
			
		||||
        [16] = "투기장 전투 시작 15초 전입니다!",
 | 
			
		||||
        [0] = "투기장 전투가 시작되었습니다!",
 | 
			
		||||
    },
 | 
			
		||||
    ["zhCN"] = {
 | 
			
		||||
        [61] = "竞技场战斗将在一分钟后开始!",
 | 
			
		||||
        [31] = "竞技场战斗将在三十秒后开始!",
 | 
			
		||||
        [16] = "竞技场战斗将在十五秒后开始!",
 | 
			
		||||
        [0] = "竞技场的战斗开始了!",
 | 
			
		||||
    },
 | 
			
		||||
    ["zhTW"] = {
 | 
			
		||||
        [61] = "1分鐘後競技場戰鬥開始!",
 | 
			
		||||
        [31] = "30秒後競技場戰鬥開始!",
 | 
			
		||||
        [16] = "15秒後競技場戰鬥開始!",
 | 
			
		||||
        [0] = "競技場戰鬥開始了!",
 | 
			
		||||
    },
 | 
			
		||||
}
 | 
			
		||||
arenaTimer["esMX"] = arenaTimer["esES"]
 | 
			
		||||
arenaTimer["ptPT"] = arenaTimer["ptBR"]
 | 
			
		||||
 | 
			
		||||
function Gladdy:GetArenaTimer()
 | 
			
		||||
    if arenaTimer[GetLocale()] then
 | 
			
		||||
        return arenaTimer[GetLocale()]
 | 
			
		||||
    else
 | 
			
		||||
        return arenaTimer["default"]
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
Gladdy.legacy = {
 | 
			
		||||
    castBarPos = "LEFT",
 | 
			
		||||
    buffsCooldownPos = "TOP",
 | 
			
		||||
    buffsBuffsCooldownPos = "BOTTOM",
 | 
			
		||||
    classIconPos = "LEFT",
 | 
			
		||||
    ciAnchor = "healthBar",
 | 
			
		||||
    ciPos = "TOP",
 | 
			
		||||
    cooldownYPos = "TOP",
 | 
			
		||||
    cooldownXPos = "LEFT",
 | 
			
		||||
    drCooldownPos = "RIGHT",
 | 
			
		||||
    racialAnchor = "trinket",
 | 
			
		||||
    racialPos = "RIGHT",
 | 
			
		||||
    trinketPos = "RIGHT",
 | 
			
		||||
    padding = 1,
 | 
			
		||||
    growUp = false,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Gladdy.newDefaults = {
 | 
			
		||||
    ["bottomMargin"] = 94.99996948242188,
 | 
			
		||||
    ["newLayout"] = true,
 | 
			
		||||
    Pets = {
 | 
			
		||||
        ["petYOffset"] = -81.99993896484375,
 | 
			
		||||
        ["petXOffset"] = 181,
 | 
			
		||||
    },
 | 
			
		||||
    ClassIcon = {
 | 
			
		||||
        ["classIconXOffset"] = -74.90008544921875,
 | 
			
		||||
    },
 | 
			
		||||
    Racial = {
 | 
			
		||||
        ["racialXOffset"] = 255.9000244140625,
 | 
			
		||||
    },
 | 
			
		||||
    Trinket = {
 | 
			
		||||
        ["trinketXOffset"] = 182,
 | 
			
		||||
    },
 | 
			
		||||
    ["Combat Indicator"] = {
 | 
			
		||||
        ["ciXOffset"] = 79.99993896484375,
 | 
			
		||||
        ["ciYOffset"] = -10.99993896484375,
 | 
			
		||||
    },
 | 
			
		||||
    Cooldowns = {
 | 
			
		||||
        ["cooldownYOffset"] = 31,
 | 
			
		||||
    },
 | 
			
		||||
    ["Buffs and Debuffs"] = {
 | 
			
		||||
        ["buffsBuffsXOffset"] = 29,
 | 
			
		||||
        ["buffsBuffsYOffset"] = -82.99993896484375,
 | 
			
		||||
        ["buffsXOffset"] = 29,
 | 
			
		||||
        ["buffsYOffset"] = 62.00006103515625,
 | 
			
		||||
    },
 | 
			
		||||
    Diminishings = {
 | 
			
		||||
        ["drXOffset"] = 329.7999877929688,
 | 
			
		||||
        ["drYOffset"] = -22.5,
 | 
			
		||||
    },
 | 
			
		||||
    ["Cast Bar"] = {
 | 
			
		||||
        ["castBarXOffset"] = -235.900146484375,
 | 
			
		||||
        ["castBarYOffset"] = -30.5,
 | 
			
		||||
    },
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Gladdy.frameStrata = {
 | 
			
		||||
    BACKGROUND = L["Background"] .. "(0)",
 | 
			
		||||
    LOW = L["Low"] .. "(1)",
 | 
			
		||||
    MEDIUM = L["Medium"] .. "(2)",
 | 
			
		||||
    HIGH = L["High"] .. "(3)",
 | 
			
		||||
    DIALOG = L["Dialog"] .. "(4)",
 | 
			
		||||
    FULLSCREEN = L["Fullscreen"] .. "(5)",
 | 
			
		||||
    FULLSCREEN_DIALOG = L["Fullscreen Dialog"] .. "(6)",
 | 
			
		||||
    TOOLTIP = L["Tooltip"] .. "(7)",
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Gladdy.frameStrataSorting = {
 | 
			
		||||
    [1] = "BACKGROUND",
 | 
			
		||||
    [2] = "LOW",
 | 
			
		||||
    [3] = "MEDIUM",
 | 
			
		||||
    [4] = "HIGH",
 | 
			
		||||
    [5] = "DIALOG",
 | 
			
		||||
    [6] = "FULLSCREEN",
 | 
			
		||||
    [7] = "FULLSCREEN_DIALOG",
 | 
			
		||||
    [8] = "TOOLTIP",
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
---------------------
 | 
			
		||||
-- TOTEM STUFF
 | 
			
		||||
@@ -1427,6 +1225,7 @@ local totemNpcIdsToTotemData = {
 | 
			
		||||
    [84519] = totemData[string_lower("Searing Totem")],
 | 
			
		||||
    [110730] = totemData[string_lower("Searing Totem")],
 | 
			
		||||
    [132178] = totemData[string_lower("Searing Totem")],
 | 
			
		||||
    [9637] = totemData[string_lower("Searing Totem")],
 | 
			
		||||
 | 
			
		||||
    [5950] = totemData[string_lower("Flametongue Totem")],
 | 
			
		||||
    [6012] = totemData[string_lower("Flametongue Totem")],
 | 
			
		||||
@@ -1652,4 +1451,3 @@ local totemNpcIdsToTotemData = {
 | 
			
		||||
function Gladdy:GetTotemData()
 | 
			
		||||
    return totemData, totemNpcIdsToTotemData, totemSpellIdToPulse
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										1383
									
								
								Constants_Wrath.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1383
									
								
								Constants_Wrath.lua
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										295
									
								
								Constants_shared.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										295
									
								
								Constants_shared.lua
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,295 @@
 | 
			
		||||
local tbl_sort, select, string_lower = table.sort, select, string.lower
 | 
			
		||||
local GetLocale = GetLocale
 | 
			
		||||
 | 
			
		||||
local Gladdy = LibStub("Gladdy")
 | 
			
		||||
local L = Gladdy.L
 | 
			
		||||
 | 
			
		||||
Gladdy.RACES = {"Scourge", "BloodElf", "Tauren", "Orc", "Troll", "NightElf", "Draenei", "Human", "Gnome", "Dwarf"}
 | 
			
		||||
tbl_sort(Gladdy.RACES)
 | 
			
		||||
 | 
			
		||||
local RACE_ICON_TCOORDS = {
 | 
			
		||||
    ["HUMAN_MALE"] = { 0, 0.125, 0, 0.25 },
 | 
			
		||||
    ["DWARF_MALE"] = { 0.125, 0.25, 0, 0.25 },
 | 
			
		||||
    ["GNOME_MALE"] = { 0.25, 0.375, 0, 0.25 },
 | 
			
		||||
    ["NIGHTELF_MALE"] = { 0.375, 0.5, 0, 0.25 },
 | 
			
		||||
 | 
			
		||||
    ["TAUREN_MALE"] = { 0, 0.125, 0.25, 0.5 },
 | 
			
		||||
    ["SCOURGE_MALE"] = { 0.125, 0.25, 0.25, 0.5 },
 | 
			
		||||
    ["TROLL_MALE"] = { 0.25, 0.375, 0.25, 0.5 },
 | 
			
		||||
    ["ORC_MALE"] = { 0.375, 0.5, 0.25, 0.5 },
 | 
			
		||||
 | 
			
		||||
    ["HUMAN_FEMALE"] = { 0, 0.125, 0.5, 0.75 },
 | 
			
		||||
    ["DWARF_FEMALE"] = { 0.125, 0.25, 0.5, 0.75 },
 | 
			
		||||
    ["GNOME_FEMALE"] = { 0.25, 0.375, 0.5, 0.75 },
 | 
			
		||||
    ["NIGHTELF_FEMALE"] = { 0.375, 0.5, 0.5, 0.75 },
 | 
			
		||||
 | 
			
		||||
    ["TAUREN_FEMALE"] = { 0, 0.125, 0.75, 1.0 },
 | 
			
		||||
    ["SCOURGE_FEMALE"] = { 0.125, 0.25, 0.75, 1.0 },
 | 
			
		||||
    ["TROLL_FEMALE"] = { 0.25, 0.375, 0.75, 1.0 },
 | 
			
		||||
    ["ORC_FEMALE"] = { 0.375, 0.5, 0.75, 1.0 },
 | 
			
		||||
 | 
			
		||||
    ["BLOODELF_MALE"] = { 0.5, 0.625, 0.25, 0.5 },
 | 
			
		||||
    ["BLOODELF_FEMALE"] = { 0.5, 0.625, 0.75, 1.0 },
 | 
			
		||||
 | 
			
		||||
    ["DRAENEI_MALE"] = { 0.5, 0.625, 0, 0.25 },
 | 
			
		||||
    ["DRAENEI_FEMALE"] = { 0.5, 0.625, 0.5, 0.75 },
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
local arenaTimer = {
 | 
			
		||||
    ["default"] = {
 | 
			
		||||
        [60] = "One minute until the Arena battle begins!",
 | 
			
		||||
        [30] = "Thirty seconds until the Arena battle begins!",
 | 
			
		||||
        [15] = "Fifteen seconds until the Arena battle begins!",
 | 
			
		||||
        [0] = "The Arena battle has begun!",
 | 
			
		||||
    },
 | 
			
		||||
    ["esES"] = {
 | 
			
		||||
        [60] = "¡Un minuto hasta que dé comienzo la batalla en arena!",
 | 
			
		||||
        [30] = "¡Treinta segundos hasta que comience la batalla en arena!",
 | 
			
		||||
        [15] = "¡Quince segundos hasta que comience la batalla en arena!",
 | 
			
		||||
        [0] = "¡La batalla en arena ha comenzado!",
 | 
			
		||||
    },
 | 
			
		||||
    ["ptBR"] = {
 | 
			
		||||
        [60] = "Um minuto até a batalha na Arena começar!",
 | 
			
		||||
        [30] = "Trinta segundos até a batalha na Arena começar!",
 | 
			
		||||
        [15] = "Quinze segundos até a batalha na Arena começar!",
 | 
			
		||||
        [0] = "A batalha na Arena começou!",
 | 
			
		||||
    },
 | 
			
		||||
    ["deDE"] = {
 | 
			
		||||
        [60] = "Noch eine Minute bis der Arenakampf beginnt!",
 | 
			
		||||
        [30] = "Noch dreißig Sekunden bis der Arenakampf beginnt!",
 | 
			
		||||
        [15] = "Noch fünfzehn Sekunden bis der Arenakampf beginnt!",
 | 
			
		||||
        [0] = "Der Arenakampf hat begonnen!",
 | 
			
		||||
    },
 | 
			
		||||
    ["frFR"] = {
 | 
			
		||||
        [60] = "Le combat d'arène commence dans une minute\194\160!",
 | 
			
		||||
        [30] = "Le combat d'arène commence dans trente secondes\194\160!",
 | 
			
		||||
        [15] = "Le combat d'arène commence dans quinze secondes\194\160!",
 | 
			
		||||
        [0] = "Le combat d'arène commence\194\160!",
 | 
			
		||||
    },
 | 
			
		||||
    ["ruRU"] = {
 | 
			
		||||
        [60] = "Одна минута до начала боя на арене!",
 | 
			
		||||
        [30] = "Тридцать секунд до начала боя на арене!",
 | 
			
		||||
        [15] = "До начала боя на арене осталось 15 секунд.",
 | 
			
		||||
        [0] = "Бой начался!",
 | 
			
		||||
    },
 | 
			
		||||
    ["itIT"] = { -- TODO
 | 
			
		||||
        -- Beta has no itIT version available?
 | 
			
		||||
    },
 | 
			
		||||
    ["koKR"] = {
 | 
			
		||||
        [60] = "투기장 전투 시작 1분 전입니다!",
 | 
			
		||||
        [30] = "투기장 전투 시작 30초 전입니다!",
 | 
			
		||||
        [15] = "투기장 전투 시작 15초 전입니다!",
 | 
			
		||||
        [0] = "투기장 전투가 시작되었습니다!",
 | 
			
		||||
    },
 | 
			
		||||
    ["zhCN"] = {
 | 
			
		||||
        [60] = "竞技场战斗将在一分钟后开始!",
 | 
			
		||||
        [30] = "竞技场战斗将在三十秒后开始!",
 | 
			
		||||
        [15] = "竞技场战斗将在十五秒后开始!",
 | 
			
		||||
        [0] = "竞技场的战斗开始了!",
 | 
			
		||||
    },
 | 
			
		||||
    ["zhTW"] = {
 | 
			
		||||
        [60] = "1分鐘後競技場戰鬥開始!",
 | 
			
		||||
        [30] = "30秒後競技場戰鬥開始!",
 | 
			
		||||
        [15] = "15秒後競技場戰鬥開始!",
 | 
			
		||||
        [0] = "競技場戰鬥開始了!",
 | 
			
		||||
    },
 | 
			
		||||
}
 | 
			
		||||
arenaTimer["esMX"] = arenaTimer["esES"]
 | 
			
		||||
arenaTimer["ptPT"] = arenaTimer["ptBR"]
 | 
			
		||||
 | 
			
		||||
function Gladdy:GetArenaTimer()
 | 
			
		||||
    if arenaTimer[GetLocale()] then
 | 
			
		||||
        return arenaTimer[GetLocale()]
 | 
			
		||||
    else
 | 
			
		||||
        return arenaTimer["default"]
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
Gladdy.legacy = {
 | 
			
		||||
    castBarPos = "LEFT",
 | 
			
		||||
    buffsCooldownPos = "TOP",
 | 
			
		||||
    buffsBuffsCooldownPos = "BOTTOM",
 | 
			
		||||
    classIconPos = "LEFT",
 | 
			
		||||
    ciAnchor = "healthBar",
 | 
			
		||||
    ciPos = "TOP",
 | 
			
		||||
    cooldownYPos = "TOP",
 | 
			
		||||
    cooldownXPos = "LEFT",
 | 
			
		||||
    drCooldownPos = "RIGHT",
 | 
			
		||||
    racialAnchor = "trinket",
 | 
			
		||||
    racialPos = "RIGHT",
 | 
			
		||||
    trinketPos = "RIGHT",
 | 
			
		||||
    padding = 1,
 | 
			
		||||
    growUp = false,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Gladdy.newDefaults = {
 | 
			
		||||
    ["bottomMargin"] = 94.99996948242188,
 | 
			
		||||
    ["newLayout"] = true,
 | 
			
		||||
    Pets = {
 | 
			
		||||
        ["petYOffset"] = -81.99993896484375,
 | 
			
		||||
        ["petXOffset"] = 181,
 | 
			
		||||
    },
 | 
			
		||||
    ClassIcon = {
 | 
			
		||||
        ["classIconXOffset"] = -74.90008544921875,
 | 
			
		||||
    },
 | 
			
		||||
    Racial = {
 | 
			
		||||
        ["racialXOffset"] = 255.9000244140625,
 | 
			
		||||
    },
 | 
			
		||||
    Trinket = {
 | 
			
		||||
        ["trinketXOffset"] = 182,
 | 
			
		||||
    },
 | 
			
		||||
    ["Combat Indicator"] = {
 | 
			
		||||
        ["ciXOffset"] = 79.99993896484375,
 | 
			
		||||
        ["ciYOffset"] = -10.99993896484375,
 | 
			
		||||
    },
 | 
			
		||||
    Cooldowns = {
 | 
			
		||||
        ["cooldownYOffset"] = 31,
 | 
			
		||||
    },
 | 
			
		||||
    ["Buffs and Debuffs"] = {
 | 
			
		||||
        ["buffsBuffsXOffset"] = 29,
 | 
			
		||||
        ["buffsBuffsYOffset"] = -82.99993896484375,
 | 
			
		||||
        ["buffsXOffset"] = 29,
 | 
			
		||||
        ["buffsYOffset"] = 62.00006103515625,
 | 
			
		||||
    },
 | 
			
		||||
    Diminishings = {
 | 
			
		||||
        ["drXOffset"] = 329.7999877929688,
 | 
			
		||||
        ["drYOffset"] = -22.5,
 | 
			
		||||
    },
 | 
			
		||||
    ["Cast Bar"] = {
 | 
			
		||||
        ["castBarXOffset"] = -235.900146484375,
 | 
			
		||||
        ["castBarYOffset"] = -30.5,
 | 
			
		||||
    },
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Gladdy.frameStrata = {
 | 
			
		||||
    BACKGROUND = L["Background"] .. "(0)",
 | 
			
		||||
    LOW = L["Low"] .. "(1)",
 | 
			
		||||
    MEDIUM = L["Medium"] .. "(2)",
 | 
			
		||||
    HIGH = L["High"] .. "(3)",
 | 
			
		||||
    DIALOG = L["Dialog"] .. "(4)",
 | 
			
		||||
    FULLSCREEN = L["Fullscreen"] .. "(5)",
 | 
			
		||||
    FULLSCREEN_DIALOG = L["Fullscreen Dialog"] .. "(6)",
 | 
			
		||||
    TOOLTIP = L["Tooltip"] .. "(7)",
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Gladdy.frameStrataSorting = {
 | 
			
		||||
    [1] = "BACKGROUND",
 | 
			
		||||
    [2] = "LOW",
 | 
			
		||||
    [3] = "MEDIUM",
 | 
			
		||||
    [4] = "HIGH",
 | 
			
		||||
    [5] = "DIALOG",
 | 
			
		||||
    [6] = "FULLSCREEN",
 | 
			
		||||
    [7] = "FULLSCREEN_DIALOG",
 | 
			
		||||
    [8] = "TOOLTIP",
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
local dispelTypeColors = {}
 | 
			
		||||
dispelTypeColors["none"] = { r = 0.80, g = 0, b = 0, a = 1 }
 | 
			
		||||
dispelTypeColors["magic"] = { r = 0.20, g = 0.60, b = 1.00, a = 1 }
 | 
			
		||||
dispelTypeColors["curse"] = { r = 0.60, g = 0.00, b = 1.00, a = 1 }
 | 
			
		||||
dispelTypeColors["disease"] = { r = 0.60, g = 0.40, b = 0, a = 1 }
 | 
			
		||||
dispelTypeColors["poison"] = { r = 0.00, g = 0.60, b = 0, a = 1 }
 | 
			
		||||
dispelTypeColors["immune"] = { r = 1.00, g = 0.02, b = 0.99, a = 1 }
 | 
			
		||||
dispelTypeColors["enrage"] = dispelTypeColors["none"]
 | 
			
		||||
dispelTypeColors["form"] = dispelTypeColors["none"]
 | 
			
		||||
dispelTypeColors["aura"] = dispelTypeColors["none"]
 | 
			
		||||
dispelTypeColors[""] = dispelTypeColors["none"]
 | 
			
		||||
 | 
			
		||||
function Gladdy:GetDispelTypeColors()
 | 
			
		||||
    return dispelTypeColors
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
--[[schoolColoring = {
 | 
			
		||||
    [SCHOOL_MASK_NONE]	= {a=1.0,r=1.00,g=1.00,b=1.00};
 | 
			
		||||
    [SCHOOL_MASK_PHYSICAL]	= {a=1.0,r=1.00,g=1.00,b=0.00};
 | 
			
		||||
    [SCHOOL_MASK_HOLY] 	= {a=1.0,r=1.00,g=0.90,b=0.50};
 | 
			
		||||
    [SCHOOL_MASK_FIRE] 	= {a=1.0,r=1.00,g=0.50,b=0.00};
 | 
			
		||||
    [SCHOOL_MASK_NATURE] 	= {a=1.0,r=0.30,g=1.00,b=0.30};
 | 
			
		||||
    [SCHOOL_MASK_FROST] 	= {a=1.0,r=0.50,g=1.00,b=1.00};
 | 
			
		||||
    [SCHOOL_MASK_SHADOW] 	= {a=1.0,r=0.50,g=0.50,b=1.00};
 | 
			
		||||
    [SCHOOL_MASK_ARCANE] 	= {a=1.0,r=1.00,g=0.50,b=1.00};
 | 
			
		||||
 | 
			
		||||
SCHOOL_MASK_NONE		= 0x00;
 | 
			
		||||
SCHOOL_MASK_PHYSICAL	= 0x01;
 | 
			
		||||
SCHOOL_MASK_HOLY		= 0x02;
 | 
			
		||||
SCHOOL_MASK_FIRE		= 0x04;
 | 
			
		||||
SCHOOL_MASK_NATURE		= 0x08;
 | 
			
		||||
SCHOOL_MASK_FROST		= 0x10;
 | 
			
		||||
SCHOOL_MASK_SHADOW		= 0x20;
 | 
			
		||||
SCHOOL_MASK_ARCANE		= 0x40;
 | 
			
		||||
--]]
 | 
			
		||||
local spellSchoolColors = {}
 | 
			
		||||
spellSchoolColors[1] = { r = 1, g = 1, b = 0, a = 1, type = "Physical" } -- "physical" 255, 255, 0
 | 
			
		||||
spellSchoolColors[2] = { r = 1, g = 0.901, b = 0.501, a = 1, type = "Holy" } --"holy" -- 255, 230, 128
 | 
			
		||||
spellSchoolColors[4] = { r = 1, g = 0.501, b = 0, a = 1, type = "Fire" } --"fire" --  255, 128, 0
 | 
			
		||||
spellSchoolColors[8] = { r = 0.302, g = 1, b = 0.302, a = 1, type = "Nature" } --"nature" --  77, 255, 77
 | 
			
		||||
spellSchoolColors[16] = { r = 0.501, g = 1, b = 1, a = 1, type = "Frost" } --"frost" -- 128, 255, 255
 | 
			
		||||
spellSchoolColors[32] = { r = 0.501, g = 0.501, b = 1, a = 1, type = "Shadow" } --"shadow" --128, 128, 255
 | 
			
		||||
spellSchoolColors[64] = { r = 1, g = 0.501, b = 1, a = 1, type = "Arcane" } --"arcane" -- 255, 128, 255
 | 
			
		||||
spellSchoolColors["unknown"] = { r = 0, g = 0, b = 0, a = 1, type = "Unknown" } --"unknown spell school"
 | 
			
		||||
 | 
			
		||||
function Gladdy:GetSpellSchoolColors()
 | 
			
		||||
    return spellSchoolColors
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
---------------------
 | 
			
		||||
-- TRINKET STUFF
 | 
			
		||||
---------------------
 | 
			
		||||
 | 
			
		||||
local pvpTrinkets = { -- [itemID] = cd in ms
 | 
			
		||||
    --wotlk
 | 
			
		||||
    [59752] = 120000,
 | 
			
		||||
    [51377] = 120000,
 | 
			
		||||
    [51378] = 120000,
 | 
			
		||||
    [46083] = 120000,
 | 
			
		||||
    [46085] = 120000,
 | 
			
		||||
    [46081] = 120000,
 | 
			
		||||
    [46084] = 120000,
 | 
			
		||||
    [46082] = 120000,
 | 
			
		||||
    [42122] = 120000,
 | 
			
		||||
    [42123] = 120000,
 | 
			
		||||
    --tbc
 | 
			
		||||
    [37864] = 120000,
 | 
			
		||||
    [37865] = 120000,
 | 
			
		||||
    [28235] = 120000,
 | 
			
		||||
    [30348] = 120000,
 | 
			
		||||
    [28238] = 120000,
 | 
			
		||||
    [30351] = 120000,
 | 
			
		||||
    [28236] = 120000,
 | 
			
		||||
    [30349] = 120000,
 | 
			
		||||
    [28234] = 120000,
 | 
			
		||||
    [28237] = 120000,
 | 
			
		||||
    [30350] = 120000,
 | 
			
		||||
    [28240] = 120000,
 | 
			
		||||
    [28243] = 120000,
 | 
			
		||||
    [30345] = 120000,
 | 
			
		||||
    [28241] = 120000,
 | 
			
		||||
    [30343] = 120000,
 | 
			
		||||
    [28239] = 120000,
 | 
			
		||||
    [30346] = 120000,
 | 
			
		||||
    [28242] = 120000,
 | 
			
		||||
    [30344] = 120000,
 | 
			
		||||
    [29593] = 120000,
 | 
			
		||||
    [29593] = 300000,
 | 
			
		||||
    [18859] = 300000,
 | 
			
		||||
    [18857] = 300000,
 | 
			
		||||
    [18864] = 300000,
 | 
			
		||||
    [18854] = 300000,
 | 
			
		||||
    [18862] = 300000,
 | 
			
		||||
    [18858] = 300000,
 | 
			
		||||
    [18856] = 300000,
 | 
			
		||||
    [18863] = 300000,
 | 
			
		||||
    [18834] = 300000,
 | 
			
		||||
    [18851] = 300000,
 | 
			
		||||
    [18845] = 300000,
 | 
			
		||||
    [18852] = 300000,
 | 
			
		||||
    [29592] = 300000,
 | 
			
		||||
    [18850] = 300000,
 | 
			
		||||
    [18846] = 300000,
 | 
			
		||||
    [18853] = 300000,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function Gladdy:GetPvpTrinkets()
 | 
			
		||||
    return pvpTrinkets
 | 
			
		||||
end
 | 
			
		||||
@@ -70,9 +70,11 @@ function Gladdy:SpotEnemy(unit, auraScan)
 | 
			
		||||
        Gladdy:SendMessage("ENEMY_SPOTTED", unit)
 | 
			
		||||
    end
 | 
			
		||||
    if auraScan and not button.spec then
 | 
			
		||||
        Gladdy:SendMessage("AURA_FADE", unit, "HELPFUL")
 | 
			
		||||
        for n = 1, 30 do
 | 
			
		||||
            local spellName,_,_,_,_,expirationTime,unitCaster = UnitAura(unit, n, "HELPFUL")
 | 
			
		||||
            local spellName, texture, count, dispelType, duration, expirationTime, unitCaster, _, _, spellID = UnitAura(unit, n, "HELPFUL")
 | 
			
		||||
            if ( not spellName ) then
 | 
			
		||||
                Gladdy:SendMessage("AURA_GAIN_LIMIT", unit, AURA_TYPE_BUFF, n - 1)
 | 
			
		||||
                break
 | 
			
		||||
            end
 | 
			
		||||
            if Gladdy.specBuffs[spellName] and unitCaster then -- Check for auras that detect a spec
 | 
			
		||||
@@ -92,6 +94,7 @@ function Gladdy:SpotEnemy(unit, auraScan)
 | 
			
		||||
            if Gladdy.cooldownBuffs.racials[spellName] and Gladdy.cooldownBuffs.racials[spellName] then
 | 
			
		||||
                Gladdy:SendMessage("RACIAL_USED", unit, spellName, Gladdy.cooldownBuffs.racials[spellName].cd(expirationTime - GetTime()), spellName)
 | 
			
		||||
            end
 | 
			
		||||
            Gladdy:SendMessage("AURA_GAIN", unit, AURA_TYPE_BUFF, spellID, spellName, texture, duration, expirationTime, count, dispelType, n, unitCaster)
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
@@ -106,13 +109,32 @@ function EventListener:COMBAT_LOG_EVENT_UNFILTERED()
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    if destUnit then
 | 
			
		||||
        -- cooldown
 | 
			
		||||
        if (Gladdy.db.cooldown and Cooldowns.cooldownSpellIds[spellName]) then
 | 
			
		||||
            local spellId = Cooldowns.cooldownSpellIds[spellName] -- don't use spellId from combatlog, in case of different spellrank
 | 
			
		||||
            if spellID == 16188 or spellID == 17116 then -- Nature's Swiftness (same name for druid and shaman)
 | 
			
		||||
                spellId = spellID
 | 
			
		||||
            end
 | 
			
		||||
            Cooldowns:AURA_FADE(destUnit, spellID)
 | 
			
		||||
        end
 | 
			
		||||
        -- diminish tracker
 | 
			
		||||
        if Gladdy.buttons[destUnit] and (Gladdy.db.drEnabled and (eventType == "SPELL_AURA_REMOVED" or eventType == "SPELL_AURA_REFRESH")) then
 | 
			
		||||
            Diminishings:AuraFade(destUnit, spellID)
 | 
			
		||||
        if Gladdy.buttons[destUnit] and Gladdy.db.drEnabled and extraSpellId == AURA_TYPE_DEBUFF then
 | 
			
		||||
            if (eventType == "SPELL_AURA_REMOVED") then
 | 
			
		||||
                Diminishings:AuraFade(destUnit, spellID)
 | 
			
		||||
            end
 | 
			
		||||
            if (eventType == "SPELL_AURA_REFRESH") then
 | 
			
		||||
                Diminishings:AuraGain(destUnit, spellID)
 | 
			
		||||
                --Diminishings:AuraFade(destUnit, spellID)
 | 
			
		||||
            end
 | 
			
		||||
            if (eventType == "SPELL_AURA_APPLIED") then
 | 
			
		||||
                Diminishings:AuraGain(destUnit, spellID)
 | 
			
		||||
            end
 | 
			
		||||
        end
 | 
			
		||||
        -- death detection
 | 
			
		||||
        if (Gladdy.buttons[destUnit] and eventType == "UNIT_DIED" or eventType == "PARTY_KILL" or eventType == "SPELL_INSTAKILL") then
 | 
			
		||||
            Gladdy:SendMessage("UNIT_DEATH", destUnit)
 | 
			
		||||
            if not Gladdy:isFeignDeath(destUnit) then
 | 
			
		||||
                Gladdy:SendMessage("UNIT_DEATH", destUnit)
 | 
			
		||||
            end
 | 
			
		||||
        end
 | 
			
		||||
        -- spec detection
 | 
			
		||||
        if Gladdy.buttons[destUnit] and (not Gladdy.buttons[destUnit].class or not Gladdy.buttons[destUnit].race) then
 | 
			
		||||
@@ -134,8 +156,8 @@ function EventListener:COMBAT_LOG_EVENT_UNFILTERED()
 | 
			
		||||
        if not Gladdy.buttons[srcUnit].spec then
 | 
			
		||||
            self:DetectSpec(srcUnit, Gladdy.specSpells[spellName])
 | 
			
		||||
        end
 | 
			
		||||
        if (eventType == "SPELL_CAST_SUCCESS" or eventType == "SPELL_AURA_APPLIED") then
 | 
			
		||||
            local unitRace = Gladdy.buttons[srcUnit].race
 | 
			
		||||
        if (eventType == "SPELL_CAST_SUCCESS" or eventType == "SPELL_AURA_APPLIED" or eventType == "SPELL_MISSED") then
 | 
			
		||||
            self:DetectSpec(srcUnit, Gladdy.specSpells[spellName])
 | 
			
		||||
            -- cooldown tracker
 | 
			
		||||
            if Gladdy.db.cooldown and Cooldowns.cooldownSpellIds[spellName] then
 | 
			
		||||
                local unitClass
 | 
			
		||||
@@ -149,18 +171,15 @@ function EventListener:COMBAT_LOG_EVENT_UNFILTERED()
 | 
			
		||||
                    else
 | 
			
		||||
                        unitClass = Gladdy.buttons[srcUnit].race
 | 
			
		||||
                    end
 | 
			
		||||
                    self:DetectSpec(srcUnit, Gladdy.specSpells[spellName])
 | 
			
		||||
                    if spellID ~= 16188 and spellID ~= 17116 then -- Nature's Swiftness CD starts when buff fades
 | 
			
		||||
                        Gladdy:Debug("INFO", "SPELL_CAST_SUCCESS - CooldownUsed", srcUnit, "spellID:", spellID)
 | 
			
		||||
                        Cooldowns:CooldownUsed(srcUnit, unitClass, spellId)
 | 
			
		||||
                    end
 | 
			
		||||
                end
 | 
			
		||||
            end
 | 
			
		||||
 | 
			
		||||
            if Gladdy.db.racialEnabled and Gladdy:Racials()[unitRace].spellName == spellName and Gladdy:Racials()[unitRace][spellID] then
 | 
			
		||||
                Gladdy:SendMessage("RACIAL_USED", srcUnit)
 | 
			
		||||
            end
 | 
			
		||||
        end
 | 
			
		||||
        if (eventType == "SPELL_AURA_REMOVED" and (spellID == 16188 or spellID == 17116) and Gladdy.buttons[srcUnit].class) then
 | 
			
		||||
            Gladdy:Debug("INFO", "SPELL_AURA_REMOVED - CooldownUsed", srcUnit, "spellID:", spellID)
 | 
			
		||||
            Cooldowns:CooldownUsed(srcUnit, Gladdy.buttons[srcUnit].class, spellID)
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
@@ -169,8 +188,10 @@ end
 | 
			
		||||
function EventListener:ARENA_OPPONENT_UPDATE(unit, updateReason)
 | 
			
		||||
    --[[ updateReason: seen, unseen, destroyed, cleared ]]
 | 
			
		||||
 | 
			
		||||
    unit = Gladdy:GetArenaUnit(unit)
 | 
			
		||||
    local button = Gladdy.buttons[unit]
 | 
			
		||||
    local pet = Gladdy.modules["Pets"].frames[unit]
 | 
			
		||||
    Gladdy:Debug("INFO", "ARENA_OPPONENT_UPDATE", unit, updateReason)
 | 
			
		||||
    if button or pet then
 | 
			
		||||
        if updateReason == "seen" then
 | 
			
		||||
            -- ENEMY_SPOTTED
 | 
			
		||||
@@ -212,6 +233,8 @@ Gladdy.exceptionNames = { -- TODO MOVE ME TO CLASSBUFFS LIB
 | 
			
		||||
    [24134] = select(1, GetSpellInfo(19386)) .. " Dot",
 | 
			
		||||
    [24135] = select(1, GetSpellInfo(19386)) .. " Dot",
 | 
			
		||||
    [27069] = select(1, GetSpellInfo(19386)) .. " Dot",
 | 
			
		||||
    [49009] = select(1, GetSpellInfo(19386)) .. " Dot",
 | 
			
		||||
    [49010] = select(1, GetSpellInfo(19386)) .. " Dot",
 | 
			
		||||
    [19975] = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)), -- Entangling Roots Nature's Grasp
 | 
			
		||||
    [19974] = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)),
 | 
			
		||||
    [19973] = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)),
 | 
			
		||||
@@ -219,6 +242,7 @@ Gladdy.exceptionNames = { -- TODO MOVE ME TO CLASSBUFFS LIB
 | 
			
		||||
    [19971] = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)),
 | 
			
		||||
    [19971] = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)),
 | 
			
		||||
    [27010] = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)),
 | 
			
		||||
    [53312] = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)),
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Gladdy.cooldownBuffs = {
 | 
			
		||||
@@ -243,8 +267,10 @@ Gladdy.cooldownBuffs = {
 | 
			
		||||
        end, spellId = 20600 }, -- Perception
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function EventListener:UNIT_AURA(unit)
 | 
			
		||||
--[[
 | 
			
		||||
/run local f,sn,dt for i=1,2 do f=(i==1 and "HELPFUL"or"HARMFUL")for n=1,30 do sn,_,_,dt=UnitAura("player",n,f) if(not sn)then break end print(sn,dt,dt and dt:len())end end
 | 
			
		||||
--]]
 | 
			
		||||
function EventListener:UNIT_AURA(unit, isFullUpdate, updatedAuras)
 | 
			
		||||
    local button = Gladdy.buttons[unit]
 | 
			
		||||
    if not button then
 | 
			
		||||
        return
 | 
			
		||||
@@ -257,7 +283,7 @@ function EventListener:UNIT_AURA(unit)
 | 
			
		||||
        local auraType = i == 1 and AURA_TYPE_BUFF or AURA_TYPE_DEBUFF
 | 
			
		||||
        Gladdy:SendMessage("AURA_FADE", unit, auraType)
 | 
			
		||||
        for n = 1, 30 do
 | 
			
		||||
            local spellName, texture, count, debuffType, duration, expirationTime, unitCaster, _, shouldConsolidate, spellID = UnitAura(unit, n, filter)
 | 
			
		||||
            local spellName, texture, count, dispelType, duration, expirationTime, unitCaster, _, shouldConsolidate, spellID = UnitAura(unit, n, filter)
 | 
			
		||||
            if ( not spellID ) then
 | 
			
		||||
                Gladdy:SendMessage("AURA_GAIN_LIMIT", unit, auraType, n - 1)
 | 
			
		||||
                break
 | 
			
		||||
@@ -276,13 +302,13 @@ function EventListener:UNIT_AURA(unit)
 | 
			
		||||
                    end
 | 
			
		||||
                end
 | 
			
		||||
            end
 | 
			
		||||
            if Gladdy.cooldownBuffs.racials[spellName] and Gladdy.cooldownBuffs.racials[spellName] then
 | 
			
		||||
            if Gladdy.cooldownBuffs.racials[spellName] then
 | 
			
		||||
                Gladdy:SendMessage("RACIAL_USED", unit, spellName, Gladdy.cooldownBuffs.racials[spellName].cd(expirationTime - GetTime()), spellName)
 | 
			
		||||
            end
 | 
			
		||||
            if Gladdy.exceptionNames[spellID] then
 | 
			
		||||
                spellName = Gladdy.exceptionNames[spellID]
 | 
			
		||||
            end
 | 
			
		||||
            Gladdy:SendMessage("AURA_GAIN", unit, auraType, spellID, spellName, texture, duration, expirationTime, count, debuffType, i)
 | 
			
		||||
            Gladdy:SendMessage("AURA_GAIN", unit, auraType, spellID, spellName, texture, duration, expirationTime, count, dispelType, i, unitCaster)
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
@@ -305,22 +331,30 @@ function EventListener:UNIT_SPELLCAST_CHANNEL_START(unit)
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function EventListener:UNIT_SPELLCAST_SUCCEEDED(unit)
 | 
			
		||||
function EventListener:UNIT_SPELLCAST_SUCCEEDED(...)
 | 
			
		||||
    local unit, castGUID, spellID = ...
 | 
			
		||||
    unit = Gladdy:GetArenaUnit(unit, true)
 | 
			
		||||
    if Gladdy.buttons[unit] then
 | 
			
		||||
        local spellName = UnitCastingInfo(unit)
 | 
			
		||||
        local unitRace = Gladdy.buttons[unit].race
 | 
			
		||||
        local spellName = GetSpellInfo(spellID)
 | 
			
		||||
 | 
			
		||||
        -- spec detection
 | 
			
		||||
        if Gladdy.specSpells[spellName] and not Gladdy.buttons[unit].spec then
 | 
			
		||||
            self:DetectSpec(unit, Gladdy.specSpells[spellName])
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local function notIn(spec, list)
 | 
			
		||||
    for _,v in ipairs(list) do
 | 
			
		||||
        if spec == v then
 | 
			
		||||
            return false
 | 
			
		||||
        -- trinket
 | 
			
		||||
        if spellID == 42292 or spellID == 59752 then
 | 
			
		||||
            Gladdy:Debug("INFO", "UNIT_SPELLCAST_SUCCEEDED - TRINKET_USED", unit, spellID)
 | 
			
		||||
            Gladdy:SendMessage("TRINKET_USED", unit)
 | 
			
		||||
        end
 | 
			
		||||
 | 
			
		||||
        -- racial
 | 
			
		||||
        if Gladdy:Racials()[unitRace].spellName == spellName and Gladdy:Racials()[unitRace][spellID] then
 | 
			
		||||
            Gladdy:Debug("INFO", "UNIT_SPELLCAST_SUCCEEDED - RACIAL_USED", unit, spellID)
 | 
			
		||||
            Gladdy:SendMessage("RACIAL_USED", unit)
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
    return true
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function EventListener:DetectSpec(unit, spec)
 | 
			
		||||
@@ -328,15 +362,16 @@ function EventListener:DetectSpec(unit, spec)
 | 
			
		||||
    if (not button or not spec or button.spec) then
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
    if button.class == "PALADIN" and notIn(spec, {L["Holy"], L["Retribution"], L["Protection"]})
 | 
			
		||||
            or button.class == "SHAMAN" and notIn(spec, {L["Restoration"], L["Enhancement"], L["Elemental"]})
 | 
			
		||||
            or button.class == "ROGUE" and notIn(spec, {L["Subtlety"], L["Assassination"], L["Combat"]})
 | 
			
		||||
            or button.class == "WARLOCK" and notIn(spec, {L["Demonology"], L["Destruction"], L["Affliction"]})
 | 
			
		||||
            or button.class == "PRIEST" and notIn(spec, {L["Shadow"], L["Discipline"], L["Holy"]})
 | 
			
		||||
            or button.class == "MAGE" and notIn(spec, {L["Frost"], L["Fire"], L["Arcane"]})
 | 
			
		||||
            or button.class == "DRUID" and notIn(spec, {L["Restoration"], L["Feral"], L["Balance"]})
 | 
			
		||||
            or button.class == "HUNTER" and notIn(spec, {L["Beast Mastery"], L["Marksmanship"], L["Survival"]})
 | 
			
		||||
            or button.class == "WARRIOR" and notIn(spec, {L["Arms"], L["Protection"], L["Fury"]}) then
 | 
			
		||||
    if button.class == "PALADIN" and Gladdy:contains(spec, {L["Holy"], L["Retribution"], L["Protection"]})
 | 
			
		||||
            or button.class == "SHAMAN" and not Gladdy:contains(spec, {L["Restoration"], L["Enhancement"], L["Elemental"]})
 | 
			
		||||
            or button.class == "ROGUE" and not Gladdy:contains(spec, {L["Subtlety"], L["Assassination"], L["Combat"]})
 | 
			
		||||
            or button.class == "WARLOCK" and not Gladdy:contains(spec, {L["Demonology"], L["Destruction"], L["Affliction"]})
 | 
			
		||||
            or button.class == "PRIEST" and not Gladdy:contains(spec, {L["Shadow"], L["Discipline"], L["Holy"]})
 | 
			
		||||
            or button.class == "MAGE" and not Gladdy:contains(spec, {L["Frost"], L["Fire"], L["Arcane"]})
 | 
			
		||||
            or button.class == "DRUID" and not Gladdy:contains(spec, {L["Restoration"], L["Feral"], L["Balance"]})
 | 
			
		||||
            or button.class == "HUNTER" and not Gladdy:contains(spec, {L["Beast Mastery"], L["Marksmanship"], L["Survival"]})
 | 
			
		||||
            or button.class == "WARRIOR" and not Gladdy:contains(spec, {L["Arms"], L["Protection"], L["Fury"]})
 | 
			
		||||
            or button.class == "DEATHKNIGHT" and not Gladdy:contains(spec, {L["Unholy"], L["Blood"], L["Frost"]}) then
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
    if not button.spec then
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										12
									
								
								Gladdy.lua
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								Gladdy.lua
									
									
									
									
									
								
							@@ -27,13 +27,13 @@ local LibStub = LibStub
 | 
			
		||||
 | 
			
		||||
---------------------------
 | 
			
		||||
 | 
			
		||||
local MAJOR, MINOR = "Gladdy", 7
 | 
			
		||||
local MAJOR, MINOR = "Gladdy", 8
 | 
			
		||||
local Gladdy = LibStub:NewLibrary(MAJOR, MINOR)
 | 
			
		||||
local L
 | 
			
		||||
Gladdy.version_major_num = 2
 | 
			
		||||
Gladdy.version_minor_num = 0.11
 | 
			
		||||
Gladdy.version_minor_num = 0.20
 | 
			
		||||
Gladdy.version_num = Gladdy.version_major_num + Gladdy.version_minor_num
 | 
			
		||||
Gladdy.version_releaseType = RELEASE_TYPES.release
 | 
			
		||||
Gladdy.version_releaseType = RELEASE_TYPES.beta
 | 
			
		||||
Gladdy.version = PREFIX .. string.format("%.2f", Gladdy.version_num) .. "-" .. Gladdy.version_releaseType
 | 
			
		||||
Gladdy.VERSION_REGEX = VERSION_REGEX
 | 
			
		||||
 | 
			
		||||
@@ -84,11 +84,11 @@ end
 | 
			
		||||
function Gladdy:Debug(lvl, ...)
 | 
			
		||||
    if Gladdy.debug then
 | 
			
		||||
        if lvl == "INFO" then
 | 
			
		||||
            Gladdy:Print(...)
 | 
			
		||||
            Gladdy:Print("[INFO]", ...)
 | 
			
		||||
        elseif lvl == "WARN" then
 | 
			
		||||
            Gladdy:Warn(...)
 | 
			
		||||
            Gladdy:Warn("[WARN]", ...)
 | 
			
		||||
        elseif lvl == "ERROR" then
 | 
			
		||||
            Gladdy:Error(...)
 | 
			
		||||
            Gladdy:Error("[ERROR]", ...)
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										47
									
								
								Gladdy.toc
									
									
									
									
									
								
							
							
						
						
									
										47
									
								
								Gladdy.toc
									
									
									
									
									
								
							@@ -1,43 +1,8 @@
 | 
			
		||||
## Interface: 20504
 | 
			
		||||
## Title: Gladdy - TBC
 | 
			
		||||
## Version: 2.11-Release
 | 
			
		||||
## Notes: The most powerful arena AddOn for WoW 2.5.4
 | 
			
		||||
## Title: Gladdy |cFFFF0000 game client not supported|r
 | 
			
		||||
## Version: 2.2-Beta
 | 
			
		||||
## Notes: The most powerful arena AddOn for WoW Classic TBC/WotLK
 | 
			
		||||
## Author: XiconQoo, DnB_Junkee, Knall
 | 
			
		||||
## X-Email: contact me on discord Knall#1751
 | 
			
		||||
## SavedVariables: GladdyXZ
 | 
			
		||||
## OptionalDeps: SharedMedia, Blizzard_CombatLog, Blizzard_ArenaUI, Blizzard_CombatText, Plater, Kui_Nameplates, NeatPlates, TidyPlates_ThreatPlates, Tukui, ElvUI
 | 
			
		||||
 | 
			
		||||
embeds.xml
 | 
			
		||||
 | 
			
		||||
Gladdy.lua
 | 
			
		||||
Lang.lua
 | 
			
		||||
Frame.lua
 | 
			
		||||
Options.lua
 | 
			
		||||
Constants.lua
 | 
			
		||||
ImportStrings.lua
 | 
			
		||||
Util.lua
 | 
			
		||||
 | 
			
		||||
Modules\Announcements.lua
 | 
			
		||||
Modules\Healthbar.lua
 | 
			
		||||
Modules\Powerbar.lua
 | 
			
		||||
Modules\Auras.lua
 | 
			
		||||
Modules\Castbar.lua
 | 
			
		||||
Modules\Classicon.lua
 | 
			
		||||
Modules\Clicks.lua
 | 
			
		||||
Modules\Diminishings.lua
 | 
			
		||||
Modules\Highlight.lua
 | 
			
		||||
Modules\TotemPlates.lua
 | 
			
		||||
Modules\TotemPulse.lua
 | 
			
		||||
Modules\Trinket.lua
 | 
			
		||||
Modules\Racial.lua
 | 
			
		||||
Modules\Cooldowns.lua
 | 
			
		||||
Modules\ArenaCountDown.lua
 | 
			
		||||
Modules\BuffsDebuffs.lua
 | 
			
		||||
Modules\VersionCheck.lua
 | 
			
		||||
Modules\XiconProfiles.lua
 | 
			
		||||
Modules\Pets.lua
 | 
			
		||||
Modules\ExportImport.lua
 | 
			
		||||
Modules\CombatIndicator.lua
 | 
			
		||||
Modules\RangeCheck.lua
 | 
			
		||||
Modules\ShadowsightTimer.lua
 | 
			
		||||
EventListener.lua
 | 
			
		||||
## X-Curse-Project-ID: 482332
 | 
			
		||||
## X-WoWI-ID: 26350
 | 
			
		||||
## Notes: Gladdy only supports Classic TBC and Classic WotLK.
 | 
			
		||||
							
								
								
									
										46
									
								
								Gladdy_BCC.toc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								Gladdy_BCC.toc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,46 @@
 | 
			
		||||
## Interface: 20504
 | 
			
		||||
## Title: Gladdy - TBC
 | 
			
		||||
## Version: 2.2-Beta
 | 
			
		||||
## Notes: The most powerful arena AddOn for WoW 2.5.4
 | 
			
		||||
## Author: XiconQoo, DnB_Junkee, Knall
 | 
			
		||||
## X-Email: contact me on discord Knall#1751
 | 
			
		||||
## X-Curse-Project-ID: 482332
 | 
			
		||||
## X-WoWI-ID: 26350
 | 
			
		||||
## SavedVariables: GladdyXZ
 | 
			
		||||
## OptionalDeps: SharedMedia, Blizzard_CombatLog, Blizzard_ArenaUI, Blizzard_CombatText, Plater, Kui_Nameplates, NeatPlates, TidyPlates_ThreatPlates, Tukui, ElvUI
 | 
			
		||||
 | 
			
		||||
embeds.xml
 | 
			
		||||
 | 
			
		||||
Gladdy.lua
 | 
			
		||||
Lang.lua
 | 
			
		||||
Frame.lua
 | 
			
		||||
Options.lua
 | 
			
		||||
Constants_shared.lua
 | 
			
		||||
Constants_BCC.lua
 | 
			
		||||
ImportStrings.lua
 | 
			
		||||
Util.lua
 | 
			
		||||
 | 
			
		||||
Modules\Announcements.lua
 | 
			
		||||
Modules\Healthbar.lua
 | 
			
		||||
Modules\Powerbar.lua
 | 
			
		||||
Modules\Auras.lua
 | 
			
		||||
Modules\Castbar.lua
 | 
			
		||||
Modules\Classicon.lua
 | 
			
		||||
Modules\Clicks.lua
 | 
			
		||||
Modules\Diminishings.lua
 | 
			
		||||
Modules\Highlight.lua
 | 
			
		||||
Modules\TotemPlates.lua
 | 
			
		||||
Modules\TotemPulse.lua
 | 
			
		||||
Modules\Trinket.lua
 | 
			
		||||
Modules\Racial.lua
 | 
			
		||||
Modules\Cooldowns.lua
 | 
			
		||||
Modules\ArenaCountDown.lua
 | 
			
		||||
Modules\BuffsDebuffs.lua
 | 
			
		||||
Modules\VersionCheck.lua
 | 
			
		||||
Modules\XiconProfiles.lua
 | 
			
		||||
Modules\Pets.lua
 | 
			
		||||
Modules\ExportImport.lua
 | 
			
		||||
Modules\CombatIndicator.lua
 | 
			
		||||
Modules\RangeCheck.lua
 | 
			
		||||
Modules\ShadowsightTimer.lua
 | 
			
		||||
EventListener.lua
 | 
			
		||||
							
								
								
									
										46
									
								
								Gladdy_Wrath.toc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								Gladdy_Wrath.toc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,46 @@
 | 
			
		||||
## Interface: 30400
 | 
			
		||||
## Title: Gladdy - WotLK
 | 
			
		||||
## Version: 2.2-Beta
 | 
			
		||||
## Notes: The most powerful arena AddOn for WoW 3.4.0
 | 
			
		||||
## Author: XiconQoo, DnB_Junkee, Knall
 | 
			
		||||
## X-Email: contact me on discord Knall#1751
 | 
			
		||||
## X-Curse-Project-ID: 482332
 | 
			
		||||
## X-WoWI-ID: 26350
 | 
			
		||||
## SavedVariables: GladdyXZ
 | 
			
		||||
## OptionalDeps: SharedMedia, Blizzard_CombatLog, Blizzard_ArenaUI, Blizzard_CombatText, Plater, Kui_Nameplates, NeatPlates, TidyPlates_ThreatPlates, Tukui, ElvUI
 | 
			
		||||
 | 
			
		||||
embeds.xml
 | 
			
		||||
 | 
			
		||||
Gladdy.lua
 | 
			
		||||
Lang.lua
 | 
			
		||||
Frame.lua
 | 
			
		||||
Options.lua
 | 
			
		||||
Constants_shared.lua
 | 
			
		||||
Constants_Wrath.lua
 | 
			
		||||
ImportStrings.lua
 | 
			
		||||
Util.lua
 | 
			
		||||
 | 
			
		||||
Modules\Announcements.lua
 | 
			
		||||
Modules\Healthbar.lua
 | 
			
		||||
Modules\Powerbar.lua
 | 
			
		||||
Modules\Auras.lua
 | 
			
		||||
Modules\Castbar.lua
 | 
			
		||||
Modules\Classicon.lua
 | 
			
		||||
Modules\Clicks.lua
 | 
			
		||||
Modules\Diminishings.lua
 | 
			
		||||
Modules\Highlight.lua
 | 
			
		||||
Modules\TotemPlates.lua
 | 
			
		||||
Modules\TotemPulse.lua
 | 
			
		||||
Modules\Trinket.lua
 | 
			
		||||
Modules\Racial.lua
 | 
			
		||||
Modules\Cooldowns.lua
 | 
			
		||||
Modules\ArenaCountDown.lua
 | 
			
		||||
Modules\BuffsDebuffs.lua
 | 
			
		||||
Modules\VersionCheck.lua
 | 
			
		||||
Modules\XiconProfiles.lua
 | 
			
		||||
Modules\Pets.lua
 | 
			
		||||
Modules\ExportImport.lua
 | 
			
		||||
Modules\CombatIndicator.lua
 | 
			
		||||
Modules\RangeCheck.lua
 | 
			
		||||
Modules\ShadowsightTimer.lua
 | 
			
		||||
EventListener.lua
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								Images/castbar-shield.blp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Images/castbar-shield.blp
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										1
									
								
								Lang.lua
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								Lang.lua
									
									
									
									
									
								
							@@ -7,6 +7,7 @@ local L = {}
 | 
			
		||||
 | 
			
		||||
-- Classes
 | 
			
		||||
L["Druid"] = C_CreatureInfo.GetClassInfo(11).className
 | 
			
		||||
L["Deathknight"] = C_CreatureInfo.GetClassInfo(6) and C_CreatureInfo.GetClassInfo(6).className
 | 
			
		||||
L["Hunter"] = C_CreatureInfo.GetClassInfo(3).className
 | 
			
		||||
L["Mage"] = C_CreatureInfo.GetClassInfo(8).className
 | 
			
		||||
L["Paladin"] = C_CreatureInfo.GetClassInfo(2).className
 | 
			
		||||
 
 | 
			
		||||
@@ -1,416 +0,0 @@
 | 
			
		||||
local major = "DRData-1.0-BCC"
 | 
			
		||||
local minor = tonumber(string.match("$Revision: 793$", "(%d+)") or 1)
 | 
			
		||||
 | 
			
		||||
assert(LibStub, string.format("%s requires LibStub.", major))
 | 
			
		||||
 | 
			
		||||
local Data = LibStub:NewLibrary(major, minor)
 | 
			
		||||
if( not Data ) then return end
 | 
			
		||||
 | 
			
		||||
-- How long before DR resets
 | 
			
		||||
Data.RESET_TIME = 18
 | 
			
		||||
 | 
			
		||||
-- List of spellID -> DR category
 | 
			
		||||
Data.spells = {
 | 
			
		||||
	--[[ DISORIENTS ]]--
 | 
			
		||||
	-- Maim
 | 
			
		||||
	[22570] = "disorient",
 | 
			
		||||
 | 
			
		||||
	-- Sap
 | 
			
		||||
	[6770] = "disorient",
 | 
			
		||||
	[2070] = "disorient",
 | 
			
		||||
	[11297] = "disorient",
 | 
			
		||||
	
 | 
			
		||||
	-- Gouge (Remove all except 1776 come WoTLK)
 | 
			
		||||
	[1776] = "disorient",
 | 
			
		||||
	[1777] = "disorient",
 | 
			
		||||
	[8629] = "disorient",
 | 
			
		||||
	[11285] = "disorient",
 | 
			
		||||
	[11286] = "disorient",
 | 
			
		||||
	[38764] = "disorient",
 | 
			
		||||
		
 | 
			
		||||
	-- Polymorph
 | 
			
		||||
	[118] = "disorient",
 | 
			
		||||
	[12824] = "disorient",
 | 
			
		||||
	[12825] = "disorient",
 | 
			
		||||
	[28272] = "disorient",
 | 
			
		||||
	[28271] = "disorient",
 | 
			
		||||
	[12826] = "disorient",
 | 
			
		||||
 | 
			
		||||
	--[[ FEARS ]]--
 | 
			
		||||
	-- Fear (Warlock)
 | 
			
		||||
	[5782] = "fear",
 | 
			
		||||
	[6213] = "fear",
 | 
			
		||||
	[6215] = "fear",
 | 
			
		||||
	
 | 
			
		||||
	-- Seduction (Pet)
 | 
			
		||||
	[6358] = "fear",
 | 
			
		||||
	
 | 
			
		||||
	-- Howl of Terror
 | 
			
		||||
	[5484] = "fear",
 | 
			
		||||
	[17928] = "fear",
 | 
			
		||||
 | 
			
		||||
	-- Psychic scream
 | 
			
		||||
	[8122] = "fear",
 | 
			
		||||
	[8124] = "fear",
 | 
			
		||||
	[10888] = "fear",
 | 
			
		||||
	[10890] = "fear",
 | 
			
		||||
	
 | 
			
		||||
	-- Scare Beast
 | 
			
		||||
	[1513] = "fear",
 | 
			
		||||
	[14326] = "fear",
 | 
			
		||||
	[14327] = "fear",
 | 
			
		||||
	
 | 
			
		||||
	-- Turn Evil
 | 
			
		||||
	[10326] = "fear",
 | 
			
		||||
	
 | 
			
		||||
	-- Intimidating Shout
 | 
			
		||||
	[5246] = "fear",
 | 
			
		||||
			
 | 
			
		||||
	--[[ CONTROL STUNS ]]--
 | 
			
		||||
	-- Hammer of Justice
 | 
			
		||||
	[853] = "ctrlstun",
 | 
			
		||||
	[5588] = "ctrlstun",
 | 
			
		||||
	[5589] = "ctrlstun",
 | 
			
		||||
	[10308] = "ctrlstun",
 | 
			
		||||
 | 
			
		||||
	-- Bash
 | 
			
		||||
	[5211] = "ctrlstun",
 | 
			
		||||
	[6798] = "ctrlstun",
 | 
			
		||||
	[8983] = "ctrlstun",
 | 
			
		||||
	
 | 
			
		||||
	-- Pounce
 | 
			
		||||
	[9005] = "ctrlstun",
 | 
			
		||||
	[9823] = "ctrlstun",
 | 
			
		||||
	[9827] = "ctrlstun",
 | 
			
		||||
	[27006] = "ctrlstun",
 | 
			
		||||
	
 | 
			
		||||
	-- Intimidation
 | 
			
		||||
	[19577] = "ctrlstun",
 | 
			
		||||
 | 
			
		||||
	-- Charge
 | 
			
		||||
	[7922] = "ctrlstun",
 | 
			
		||||
 | 
			
		||||
	-- Cheap Shot
 | 
			
		||||
	[1833] = "ctrlstun",
 | 
			
		||||
 | 
			
		||||
	-- War Stomp
 | 
			
		||||
	[20549] = "ctrlstun",
 | 
			
		||||
 | 
			
		||||
	-- Intercept
 | 
			
		||||
	[20253] = "ctrlstun",
 | 
			
		||||
	[20614] = "ctrlstun",
 | 
			
		||||
	[20615] = "ctrlstun",
 | 
			
		||||
	[25273] = "ctrlstun",
 | 
			
		||||
	[25274] = "ctrlstun",
 | 
			
		||||
 | 
			
		||||
	-- Concussion Blow
 | 
			
		||||
	[12809] = "ctrlstun",
 | 
			
		||||
	
 | 
			
		||||
	-- Shadowfury
 | 
			
		||||
	[30283] = "ctrlstun", 
 | 
			
		||||
	[30413] = "ctrlstun",
 | 
			
		||||
	[30414] = "ctrlstun",
 | 
			
		||||
 | 
			
		||||
	-- Unstable Affliction (Silence)
 | 
			
		||||
	[43523] = "ua",
 | 
			
		||||
	[31117] = "ua",
 | 
			
		||||
 | 
			
		||||
	-- Impact
 | 
			
		||||
	[12355] = "rndstun",
 | 
			
		||||
 | 
			
		||||
	--[[ RANDOM STUNS ]]--
 | 
			
		||||
	-- Stoneclaw Stun
 | 
			
		||||
	[39796] = "rndstun",
 | 
			
		||||
	
 | 
			
		||||
	-- Starfire Stun
 | 
			
		||||
	[16922] = "rndstun",
 | 
			
		||||
	
 | 
			
		||||
	-- Mace Stun
 | 
			
		||||
	[5530] = "rndstun",
 | 
			
		||||
	
 | 
			
		||||
	-- Stormherald/Deep Thunder
 | 
			
		||||
	[34510] = "rndstun",
 | 
			
		||||
	
 | 
			
		||||
	-- Seal of Justice
 | 
			
		||||
	[20170] = "rndstun",
 | 
			
		||||
	
 | 
			
		||||
	-- Blackout
 | 
			
		||||
	[15269] = "rndstun",
 | 
			
		||||
	
 | 
			
		||||
	-- Revenge Stun
 | 
			
		||||
	[12798] = "rndstun",
 | 
			
		||||
 | 
			
		||||
	-- Pyroclasm
 | 
			
		||||
	[18093] = "rndstun",
 | 
			
		||||
	
 | 
			
		||||
	--[[ CYCLONE ]]--
 | 
			
		||||
	-- Blind
 | 
			
		||||
	[2094] = "cyclone",
 | 
			
		||||
	
 | 
			
		||||
	-- Cyclone
 | 
			
		||||
	[33786] = "cyclone",
 | 
			
		||||
	
 | 
			
		||||
	--[[ ROOTS ]]--
 | 
			
		||||
	-- Freeze (Water Elemental)
 | 
			
		||||
	[33395] = "root",
 | 
			
		||||
	
 | 
			
		||||
	-- Frost Nova
 | 
			
		||||
	[122] = "root",
 | 
			
		||||
	[865] = "root",
 | 
			
		||||
	[6131] = "root",
 | 
			
		||||
	[10230] = "root",
 | 
			
		||||
	[27088] = "root",
 | 
			
		||||
	
 | 
			
		||||
	-- Entangling Roots
 | 
			
		||||
	[339] = "root",
 | 
			
		||||
	[1062] = "root",
 | 
			
		||||
	[5195] = "root",
 | 
			
		||||
	[5196] = "root",
 | 
			
		||||
	[9852] = "root",
 | 
			
		||||
	[9853] = "root",
 | 
			
		||||
	[26989] = "root",
 | 
			
		||||
 | 
			
		||||
	-- Nature's Grasp
 | 
			
		||||
	[19975] = "root",
 | 
			
		||||
	[19974] = "root",
 | 
			
		||||
	[19973] = "root",
 | 
			
		||||
	[19972] = "root",
 | 
			
		||||
	[19971] = "root",
 | 
			
		||||
	[19970] = "root",
 | 
			
		||||
	[27010] = "root",
 | 
			
		||||
 | 
			
		||||
	--[[ RANDOM ROOTS ]]--
 | 
			
		||||
	-- Improved Hamstring
 | 
			
		||||
	[23694] = "rndroot",
 | 
			
		||||
 | 
			
		||||
	-- Entrapment (Hunter Talent)
 | 
			
		||||
	[19185] = "rndroot",
 | 
			
		||||
 | 
			
		||||
	-- Improved Wingclip
 | 
			
		||||
	[19229] = "rndroot",
 | 
			
		||||
 | 
			
		||||
	-- Frostbite
 | 
			
		||||
	[12494] = "rndroot",
 | 
			
		||||
 | 
			
		||||
	--[[ SLEEPS ]]--
 | 
			
		||||
	-- Hibernate
 | 
			
		||||
	[2637] = "disorient",
 | 
			
		||||
	[18657] = "disorient",
 | 
			
		||||
	[18658] = "disorient",
 | 
			
		||||
	
 | 
			
		||||
	-- Wyvern Sting
 | 
			
		||||
	[19386] = "disorient",
 | 
			
		||||
	[24132] = "disorient",
 | 
			
		||||
	[24133] = "disorient",
 | 
			
		||||
	[27068] = "disorient",
 | 
			
		||||
	
 | 
			
		||||
	--[[ MISC ]]--
 | 
			
		||||
	-- Chastise
 | 
			
		||||
	[44041] = "chastise",
 | 
			
		||||
	[44043] = "chastise",
 | 
			
		||||
	[44044] = "chastise",
 | 
			
		||||
	[44045] = "chastise",
 | 
			
		||||
	[44046] = "chastise",
 | 
			
		||||
	[44047] = "chastise",
 | 
			
		||||
 | 
			
		||||
	-- Dragon's Breath
 | 
			
		||||
	[31661] = "scatters", -- Dragon's Breath
 | 
			
		||||
	[33041] = "scatters", -- Dragon's Breath
 | 
			
		||||
	[33042] = "scatters", -- Dragon's Breath
 | 
			
		||||
	[33043] = "scatters", -- Dragon's Breath
 | 
			
		||||
	-- Repentance
 | 
			
		||||
	[20066] = "disorient",
 | 
			
		||||
 | 
			
		||||
	-- Scatter Shot
 | 
			
		||||
	[19503] = "scatters",
 | 
			
		||||
	
 | 
			
		||||
	-- Freezing Trap
 | 
			
		||||
	[3355] = "disorient",
 | 
			
		||||
	[14308] = "disorient",
 | 
			
		||||
	[14309] = "disorient",
 | 
			
		||||
	
 | 
			
		||||
	-- Improved Conc Shot
 | 
			
		||||
	[19410] = "rndstun",
 | 
			
		||||
	[22915] = "rndstun",
 | 
			
		||||
	[28445] = "rndstun",
 | 
			
		||||
	
 | 
			
		||||
	-- Death Coil
 | 
			
		||||
	[6789] = "dc",
 | 
			
		||||
	[17925] = "dc",
 | 
			
		||||
	[17926] = "dc",
 | 
			
		||||
	[27223] = "dc",
 | 
			
		||||
 | 
			
		||||
	-- Kidney Shot
 | 
			
		||||
	[408] = "ks",
 | 
			
		||||
	[8643] = "ks",
 | 
			
		||||
	
 | 
			
		||||
	-- Mind Control
 | 
			
		||||
	[605] = "charm",
 | 
			
		||||
	[10911] = "charm",
 | 
			
		||||
	[10912] = "charm",
 | 
			
		||||
 | 
			
		||||
	-- Counterattack
 | 
			
		||||
	[19306] = "counterattack",
 | 
			
		||||
 | 
			
		||||
	-- Disarm
 | 
			
		||||
	[676] = "disarm",
 | 
			
		||||
	[14251] = "disarm",
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
-- DR Category names
 | 
			
		||||
Data.typeNames = {
 | 
			
		||||
	["disorient"] = "Disorients",
 | 
			
		||||
	["fear"] = "Fears",
 | 
			
		||||
	["ctrlstun"] = "Controlled Stuns",
 | 
			
		||||
	["rndstun"] = "Random Stuns",
 | 
			
		||||
	["cyclone"] = "Cyclone/Blind",
 | 
			
		||||
	["ks"] = "Kidney Shot",
 | 
			
		||||
	["chastise"] = "Chastise",
 | 
			
		||||
	["scatters"] = "Scatter Shot",
 | 
			
		||||
	["freezetrap"] = "Freeze Trap",
 | 
			
		||||
	["rndroot"]  = "Random Roots",
 | 
			
		||||
	["dc"] = "Death Coil",
 | 
			
		||||
	["sleep"] = "Sleep",
 | 
			
		||||
	["root"] = "Controlled Roots",
 | 
			
		||||
	["impconc"] = "Imp Concussive Shot",
 | 
			
		||||
	["charm"] = "Charms",
 | 
			
		||||
	["repentance"] = "Repentance",
 | 
			
		||||
	["dragonsbreath"] = "Dragon's Breath",
 | 
			
		||||
	["ua"] = "Unstable Affliction Silence",
 | 
			
		||||
	["counterattack"] = "Counterattack Immobilize",
 | 
			
		||||
	["disarm"] = "Disarm"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
-- Categories that have DR in PvE as well as PvP
 | 
			
		||||
Data.pveDRs = {
 | 
			
		||||
	["ks"] = true,
 | 
			
		||||
	["ctrlstun"] = true,
 | 
			
		||||
	["rndstun"] = true,
 | 
			
		||||
	["cyclone"] = true,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
-- List of DRs
 | 
			
		||||
Data.categories = {}
 | 
			
		||||
for _, cat in pairs(Data.spells) do
 | 
			
		||||
	Data.categories[cat] = true
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
-- Public APIs
 | 
			
		||||
-- Category name in something usable
 | 
			
		||||
function Data:GetCategoryName(cat)
 | 
			
		||||
	return cat and Data.typeNames[cat] or nil
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
-- Spell list
 | 
			
		||||
function Data:GetSpells()
 | 
			
		||||
	return Data.spells
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
-- Seconds before DR resets
 | 
			
		||||
function Data:GetResetTime()
 | 
			
		||||
	return Data.RESET_TIME
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
-- Get the category of the spellID
 | 
			
		||||
function Data:GetSpellCategory(spellID)
 | 
			
		||||
	return spellID and Data.spells[spellID] or nil
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
-- Does this category DR in PvE?
 | 
			
		||||
function Data:IsPVE(cat)
 | 
			
		||||
	return cat and Data.pveDRs[cat] or nil
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
-- List of categories
 | 
			
		||||
function Data:GetCategories()
 | 
			
		||||
	return Data.categories
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
-- Next DR, if it's 1.0, next is 0.50, if it's 0.50 next is 0.25 and such
 | 
			
		||||
function Data:NextDR(diminished)
 | 
			
		||||
	if( diminished == 1.0 ) then
 | 
			
		||||
		return 0.50
 | 
			
		||||
	elseif( diminished == 0.50 ) then
 | 
			
		||||
		return 0.25
 | 
			
		||||
	end
 | 
			
		||||
	
 | 
			
		||||
	return 0
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
--[[ EXAMPLES ]]--
 | 
			
		||||
--[[
 | 
			
		||||
	This is how you would track DR easily, you're welcome to do whatever you want with the below 4 functions.
 | 
			
		||||
 | 
			
		||||
	Does not include tracking for PvE, you'd need to hack that in yourself but it's not (too) hard.
 | 
			
		||||
]]
 | 
			
		||||
 | 
			
		||||
--[[
 | 
			
		||||
local trackedPlayers = {}
 | 
			
		||||
local function debuffGained(spellID, destName, destGUID, isEnemy)
 | 
			
		||||
	if( not trackedPlayers[destGUID] ) then
 | 
			
		||||
		trackedPlayers[destGUID] = {}
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	-- See if we should reset it back to undiminished
 | 
			
		||||
	local drCat = DRData:GetSpellCae
 | 
			
		||||
	local tracked = trackedPlayers[destGUID][drCat]
 | 
			
		||||
	if( tracked and tracked.reset <= GetTime() ) then
 | 
			
		||||
		tracked.diminished = 1.0
 | 
			
		||||
	end	
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local function debuffFaded(spellID, destName, destGUID, isEnemy)
 | 
			
		||||
	local drCat = DRData:GetSpellCategory(spellID)
 | 
			
		||||
	if( not trackedPlayers[destGUID] ) then
 | 
			
		||||
		trackedPlayers[destGUID] = {}
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	if( not trackedPlayers[destGUID][drCat] ) then
 | 
			
		||||
		trackedPlayers[destGUID][drCat] = { reset = 0, diminished = 1.0 }
 | 
			
		||||
	end
 | 
			
		||||
	
 | 
			
		||||
	local time = GetTime()
 | 
			
		||||
	local tracked = trackedPlayers[destGUID][drCat]
 | 
			
		||||
	
 | 
			
		||||
	tracked.reset = time + DRData:GetResetTime()
 | 
			
		||||
	tracked.diminished = nextDR(tracked.diminished)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local function resetDR(destGUID)
 | 
			
		||||
	-- Reset the tracked DRs for this person
 | 
			
		||||
	if( trackedPlayers[destGUID] ) then
 | 
			
		||||
		for cat in pairs(trackedPlayers[destGUID]) do
 | 
			
		||||
			trackedPlayers[destGUID][cat].reset = 0
 | 
			
		||||
			trackedPlayers[destGUID][cat].diminished = 1.0
 | 
			
		||||
		end
 | 
			
		||||
	end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local COMBATLOG_OBJECT_TYPE_PLAYER = COMBATLOG_OBJECT_TYPE_PLAYER
 | 
			
		||||
local COMBATLOG_OBJECT_REACTION_HOSTILE = COMBATLOG_OBJECT_REACTION_HOSTILE
 | 
			
		||||
local COMBATLOG_OBJECT_CONTROL_PLAYER = COMBATLOG_OBJECT_CONTROL_PLAYER
 | 
			
		||||
 | 
			
		||||
local eventRegistered = {["SPELL_AURA_APPLIED"] = true, ["SPELL_AURA_REMOVED"] = true, ["PARTY_KILL"] = true, ["UNIT_DIED"] = true}
 | 
			
		||||
local function COMBAT_LOG_EVENT_UNFILTERED(self, event, timestamp, eventType, sourceGUID, sourceName, sourceFlags, destGUID, destName, destFlags, spellID, spellName, spellSchool, auraType)
 | 
			
		||||
	if( not eventRegistered[eventType] or ( bit.band(destFlags, COMBATLOG_OBJECT_TYPE_PLAYER) ~= COMBATLOG_OBJECT_TYPE_PLAYER and bit.band(destFlags, COMBATLOG_OBJECT_CONTROL_PLAYER) ~= COMBATLOG_OBJECT_CONTROL_PLAYER ) ) then
 | 
			
		||||
		return
 | 
			
		||||
	end
 | 
			
		||||
	
 | 
			
		||||
	-- Enemy gained a debuff
 | 
			
		||||
	if( eventType == "SPELL_AURA_APPLIED" ) then
 | 
			
		||||
		if( auraType == "DEBUFF" and Data.Spells[spellID] ) then
 | 
			
		||||
			debuffGained(spellID, destName, destGUID, (bit.band(destFlags, COMBATLOG_OBJECT_REACTION_HOSTILE) == COMBATLOG_OBJECT_REACTION_HOSTILE))
 | 
			
		||||
		end
 | 
			
		||||
	
 | 
			
		||||
	-- Buff or debuff faded from an enemy
 | 
			
		||||
	elseif( eventType == "SPELL_AURA_REMOVED" ) then
 | 
			
		||||
		if( auraType == "DEBUFF" and Data.Spells[spellID] ) then
 | 
			
		||||
			debuffFaded(spellID, destName, destGUID, (bit.band(destFlags, COMBATLOG_OBJECT_REACTION_HOSTILE) == COMBATLOG_OBJECT_REACTION_HOSTILE))
 | 
			
		||||
		end
 | 
			
		||||
		
 | 
			
		||||
	-- Don't use UNIT_DIED inside arenas due to accuracy issues, outside of arenas we don't care too much
 | 
			
		||||
	elseif( ( eventType == "UNIT_DIED" and select(2, IsInInstance()) ~= "arena" ) or eventType == "PARTY_KILL" ) then
 | 
			
		||||
		resetDR(destGUID)
 | 
			
		||||
	end
 | 
			
		||||
end
 | 
			
		||||
]]
 | 
			
		||||
@@ -1,8 +0,0 @@
 | 
			
		||||
## Interface: 20400
 | 
			
		||||
## Title: Lib: Diminishing Returns Data-1.0
 | 
			
		||||
## Notes: DB of spellIDs -> DR category
 | 
			
		||||
## Author: Mayen
 | 
			
		||||
 | 
			
		||||
LibStub-1.0\LibStub-1.0.xml
 | 
			
		||||
 | 
			
		||||
DRData-1.0.xml
 | 
			
		||||
							
								
								
									
										400
									
								
								Libs/DRList-1.0/DRList-1.0.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										400
									
								
								Libs/DRList-1.0/DRList-1.0.lua
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,400 @@
 | 
			
		||||
--[[
 | 
			
		||||
Name: DRList-1.0
 | 
			
		||||
Description: Diminishing returns categorization. Fork of outdated DRData-1.0.
 | 
			
		||||
Website: https://github.com/wardz/DRList-1.0/
 | 
			
		||||
Documentation: https://wardz.github.io/DRList-1.0/
 | 
			
		||||
Dependencies: LibStub
 | 
			
		||||
License: MIT
 | 
			
		||||
]]
 | 
			
		||||
 | 
			
		||||
--- DRList-1.0
 | 
			
		||||
-- @module DRList-1.0
 | 
			
		||||
local MAJOR, MINOR = "DRList-1.0", 40 -- Don't forget to change this in Spells.lua aswell!
 | 
			
		||||
local Lib = assert(LibStub, MAJOR .. " requires LibStub."):NewLibrary(MAJOR, MINOR)
 | 
			
		||||
if not Lib then return end -- already loaded
 | 
			
		||||
 | 
			
		||||
-------------------------------------------------------------------------------
 | 
			
		||||
-- *** LOCALIZATIONS ARE AUTOMATICALLY GENERATED ***
 | 
			
		||||
-- Please see Curseforge localization page if you'd like to help translate.
 | 
			
		||||
-- https://www.curseforge.com/wow/addons/drlist-1-0/localization
 | 
			
		||||
local L = {}
 | 
			
		||||
Lib.L = L
 | 
			
		||||
L["DISARMS"] = "Disarms"
 | 
			
		||||
L["DISORIENTS"] = "Disorients"
 | 
			
		||||
L["INCAPACITATES"] = "Incapacitates"
 | 
			
		||||
L["KNOCKBACKS"] = "Knockbacks"
 | 
			
		||||
L["ROOTS"] = "Roots"
 | 
			
		||||
L["SILENCES"] = "Silences"
 | 
			
		||||
L["STUNS"] = "Stuns"
 | 
			
		||||
L["TAUNTS"] = "Taunts"
 | 
			
		||||
L["FEARS"] = "Fears"
 | 
			
		||||
L["RANDOM_ROOTS"] = "Random roots"
 | 
			
		||||
L["RANDOM_STUNS"] = "Random stuns"
 | 
			
		||||
L["OPENER_STUN"] = "Opener Stuns"
 | 
			
		||||
L["HORROR"] = "Horrors"
 | 
			
		||||
L["SCATTERS"] = "Scatters"
 | 
			
		||||
L["SLEEPS"] = GetSpellInfo(1090) or "Sleep"
 | 
			
		||||
L["MIND_CONTROL"] = GetSpellInfo(605) or "Mind Control"
 | 
			
		||||
L["FROST_SHOCK"] = GetSpellInfo(15089) or "Frost Shock"
 | 
			
		||||
L["KIDNEY_SHOT"] = GetSpellInfo(408) or "Kidney Shot"
 | 
			
		||||
L["DEATH_COIL"] = GetSpellInfo(28412) or "Death Coil"
 | 
			
		||||
L["UNSTABLE_AFFLICTION"] = GetSpellInfo(31117) or "Unstable Affliction"
 | 
			
		||||
L["CHASTISE"] = GetSpellInfo(44041) or "Chastise"
 | 
			
		||||
L["COUNTERATTACK"] = GetSpellInfo(19306) or "Counterattack"
 | 
			
		||||
L["CYCLONE"] = GetSpellInfo(33786) or "Cyclone"
 | 
			
		||||
L["BANISH"] = GetSpellInfo(710) or "Banish"
 | 
			
		||||
L["CHARGE"] = GetSpellInfo(100) or "Charge"
 | 
			
		||||
 | 
			
		||||
-- luacheck: push ignore 542
 | 
			
		||||
local locale = GetLocale()
 | 
			
		||||
if locale == "deDE" then
 | 
			
		||||
    L["FEARS"] = "Furchteffekte"
 | 
			
		||||
    L["KNOCKBACKS"] = "Rückstoßeffekte"
 | 
			
		||||
    L["ROOTS"] = "Bewegungsunfähigkeitseffekte"
 | 
			
		||||
    L["SILENCES"] = "Stilleeffekte"
 | 
			
		||||
    L["STUNS"] = "Betäubungseffekte"
 | 
			
		||||
    L["TAUNTS"] = "Spotteffekte"
 | 
			
		||||
elseif locale == "frFR" then
 | 
			
		||||
    L["FEARS"] = "Peurs"
 | 
			
		||||
    L["KNOCKBACKS"] = "Projections"
 | 
			
		||||
    L["ROOTS"] = "Immobilisations"
 | 
			
		||||
    L["SILENCES"] = "Silences"
 | 
			
		||||
    L["STUNS"] = "Etourdissements"
 | 
			
		||||
    L["TAUNTS"] = "Provocations"
 | 
			
		||||
elseif locale == "itIT" then
 | 
			
		||||
    --@localization(locale="itIT", namespace="Categories", format="lua_additive_table", handle-unlocalized="ignore")@
 | 
			
		||||
elseif locale == "koKR" then
 | 
			
		||||
    L["DISORIENTS"] = "방향 감각 상실"
 | 
			
		||||
    L["INCAPACITATES"] = "행동 불가"
 | 
			
		||||
    L["KNOCKBACKS"] = "밀쳐내기"
 | 
			
		||||
    L["ROOTS"] = "이동 불가"
 | 
			
		||||
    L["SILENCES"] = "침묵"
 | 
			
		||||
    L["STUNS"] = "기절"
 | 
			
		||||
elseif locale == "ptBR" then
 | 
			
		||||
    --@localization(locale="ptBR", namespace="Categories", format="lua_additive_table", handle-unlocalized="ignore")@
 | 
			
		||||
elseif locale == "ruRU" then
 | 
			
		||||
    L["DISARMS"] = "Разоружение"
 | 
			
		||||
    L["DISORIENTS"] = "Дезориентация"
 | 
			
		||||
    L["FEARS"] = "Опасения"
 | 
			
		||||
    L["INCAPACITATES"] = "Паралич"
 | 
			
		||||
    L["KNOCKBACKS"] = "Отбрасывание"
 | 
			
		||||
    L["RANDOM_ROOTS"] = "Случайные корни"
 | 
			
		||||
    L["RANDOM_STUNS"] = "Случайные оглушения"
 | 
			
		||||
    L["ROOTS"] = "Сковывание"
 | 
			
		||||
    L["SILENCES"] = "Немота"
 | 
			
		||||
    L["STUNS"] = "Оглушение"
 | 
			
		||||
    L["TAUNTS"] = "Насмешки"
 | 
			
		||||
elseif locale == "esES" or locale == "esMX" then
 | 
			
		||||
    L["DISARMS"] = "Desarmar"
 | 
			
		||||
    L["DISORIENTS"] = "Desorientar"
 | 
			
		||||
    L["FEARS"] = "Miedos"
 | 
			
		||||
    L["INCAPACITATES"] = "Incapacitar"
 | 
			
		||||
    L["KNOCKBACKS"] = "Derribos"
 | 
			
		||||
    L["RANDOM_ROOTS"] = "Raíces aleatorias"
 | 
			
		||||
    L["RANDOM_STUNS"] = "Aturdir aleatorio"
 | 
			
		||||
    L["ROOTS"] = "Raíces"
 | 
			
		||||
    L["SILENCES"] = "Silencios"
 | 
			
		||||
    L["STUNS"] = "Aturdimientos"
 | 
			
		||||
    L["TAUNTS"] = "Provocaciones"
 | 
			
		||||
elseif locale == "zhCN" then
 | 
			
		||||
    L["DISARMS"] = "缴械"
 | 
			
		||||
    L["DISORIENTS"] = "迷惑"
 | 
			
		||||
    L["FEARS"] = "恐惧"
 | 
			
		||||
    L["INCAPACITATES"] = "瘫痪"
 | 
			
		||||
    L["KNOCKBACKS"] = "击退"
 | 
			
		||||
    L["RANDOM_ROOTS"] = "随机定身"
 | 
			
		||||
    L["RANDOM_STUNS"] = "随机眩晕"
 | 
			
		||||
    L["ROOTS"] = "定身"
 | 
			
		||||
    L["SILENCES"] = "沉默"
 | 
			
		||||
    L["STUNS"] = "昏迷"
 | 
			
		||||
    L["TAUNTS"] = "嘲讽"
 | 
			
		||||
elseif locale == "zhTW" then
 | 
			
		||||
    L["DISARMS"] = "繳械"
 | 
			
		||||
    L["DISORIENTS"] = "迷惑"
 | 
			
		||||
    L["FEARS"] = "恐懼"
 | 
			
		||||
    L["INCAPACITATES"] = "癱瘓"
 | 
			
		||||
    L["KNOCKBACKS"] = "擊退"
 | 
			
		||||
    L["RANDOM_ROOTS"] = "隨機定身"
 | 
			
		||||
    L["RANDOM_STUNS"] = "隨機昏迷"
 | 
			
		||||
    L["ROOTS"] = "定身"
 | 
			
		||||
    L["SILENCES"] = "沉默"
 | 
			
		||||
    L["STUNS"] = "昏迷"
 | 
			
		||||
    L["TAUNTS"] = "嘲諷"
 | 
			
		||||
end
 | 
			
		||||
-- luacheck: pop
 | 
			
		||||
-------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
-- Check what game version we're running
 | 
			
		||||
Lib.gameExpansion = ({
 | 
			
		||||
    [WOW_PROJECT_MAINLINE] = "retail",
 | 
			
		||||
    [WOW_PROJECT_CLASSIC] = "classic",
 | 
			
		||||
    [WOW_PROJECT_BURNING_CRUSADE_CLASSIC or 5] = "tbc",
 | 
			
		||||
})[WOW_PROJECT_ID]
 | 
			
		||||
 | 
			
		||||
local tocVersion = select(4, GetBuildInfo())
 | 
			
		||||
if tocVersion >= 30400 and tocVersion < 40000 then
 | 
			
		||||
    Lib.gameExpansion = "wotlk" -- temporary check for wotlk build until new constant is added
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
-- How long it takes for a DR to expire, in seconds.
 | 
			
		||||
Lib.resetTimes = {
 | 
			
		||||
    retail = {
 | 
			
		||||
        ["default"] = 18.5, -- 18 sec + 0.5 latency
 | 
			
		||||
        ["npc"] = 23, -- Against mobs it seems to last slightly longer, depending on server load
 | 
			
		||||
        ["knockback"] = 10, -- Knockbacks are immediately immune and only DRs for 10s
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    classic = {
 | 
			
		||||
        ["default"] = 19, -- dynamic between 15 and 20s
 | 
			
		||||
        ["npc"] = 23,
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    tbc = {
 | 
			
		||||
        ["default"] = 19, -- dynamic between 15 and 20s
 | 
			
		||||
        ["npc"] = 23,
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    wotlk = {
 | 
			
		||||
        ["default"] = 19,  -- dynamic between 15 and 20s
 | 
			
		||||
        ["npc"] = 23,
 | 
			
		||||
    },
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
-- List of all DR categories, english -> localized.
 | 
			
		||||
Lib.categoryNames = {
 | 
			
		||||
    retail = {
 | 
			
		||||
        ["disorient"] = L.DISORIENTS,
 | 
			
		||||
        ["incapacitate"] = L.INCAPACITATES,
 | 
			
		||||
        ["silence"] = L.SILENCES,
 | 
			
		||||
        ["stun"] = L.STUNS,
 | 
			
		||||
        ["root"] = L.ROOTS,
 | 
			
		||||
        ["disarm"] = L.DISARMS,
 | 
			
		||||
        ["taunt"] = L.TAUNTS,
 | 
			
		||||
        ["knockback"] = L.KNOCKBACKS,
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    classic = {
 | 
			
		||||
        ["incapacitate"] = L.INCAPACITATES,
 | 
			
		||||
        ["stun"] = L.STUNS, -- controlled stun
 | 
			
		||||
        ["root"] = L.ROOTS, -- controlled root
 | 
			
		||||
        ["random_stun"] = L.RANDOM_STUNS, -- random proc stun, usually short (<3s)
 | 
			
		||||
        ["random_root"] = L.RANDOM_ROOTS,
 | 
			
		||||
        ["fear"] = L.FEARS,
 | 
			
		||||
        ["mind_control"] = L.MIND_CONTROL,
 | 
			
		||||
        ["frost_shock"] = L.FROST_SHOCK,
 | 
			
		||||
        ["kidney_shot"] = L.KIDNEY_SHOT,
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    tbc = {
 | 
			
		||||
        ["disorient"] = L.DISORIENTS,
 | 
			
		||||
        ["incapacitate"] = L.INCAPACITATES,
 | 
			
		||||
        ["stun"] = L.STUNS,
 | 
			
		||||
        ["random_stun"] = L.RANDOM_STUNS,
 | 
			
		||||
        ["random_root"] = L.RANDOM_ROOTS,
 | 
			
		||||
        ["root"] = L.ROOTS,
 | 
			
		||||
        ["disarm"] = L.DISARMS,
 | 
			
		||||
        ["fear"] = L.FEARS,
 | 
			
		||||
        ["scatter"] = L.SCATTERS,
 | 
			
		||||
        ["mind_control"] = L.MIND_CONTROL,
 | 
			
		||||
        ["kidney_shot"] = L.KIDNEY_SHOT,
 | 
			
		||||
        ["death_coil"] = L.DEATH_COIL,
 | 
			
		||||
        ["unstable_affliction"] = L.UNSTABLE_AFFLICTION,
 | 
			
		||||
        ["chastise"] = L.CHASTISE,
 | 
			
		||||
        ["counterattack"] = L.COUNTERATTACK,
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    wotlk = { -- WORK IN PROGRESS
 | 
			
		||||
        ["incapacitate"] = L.INCAPACITATES,
 | 
			
		||||
        ["stun"] = L.STUNS,
 | 
			
		||||
        ["random_stun"] = L.RANDOM_STUNS,
 | 
			
		||||
        ["random_root"] = L.RANDOM_ROOTS,
 | 
			
		||||
        ["root"] = L.ROOTS,
 | 
			
		||||
        ["disarm"] = L.DISARMS,
 | 
			
		||||
        ["fear"] = L.FEARS,
 | 
			
		||||
        ["scatter"] = L.SCATTERS,
 | 
			
		||||
        ["silence"] = L.SILENCES,
 | 
			
		||||
        ["horror"] = L.HORROR,
 | 
			
		||||
        ["mind_control"] = L.MIND_CONTROL,
 | 
			
		||||
        ["cyclone"] = L.CYCLONE,
 | 
			
		||||
        ["charge"] = L.CHARGE,
 | 
			
		||||
        ["opener_stun"] = L.OPENER_STUN,
 | 
			
		||||
        ["counterattack"] = L.COUNTERATTACK,
 | 
			
		||||
    },
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
-- Categories that have DR against normal mobs.
 | 
			
		||||
-- Note that this is only for normal mobs on retail. Special mobs or pets have DR on all categories,
 | 
			
		||||
-- see UnitClassification() and UnitIsQuestBoss().
 | 
			
		||||
Lib.categoriesPvE = {
 | 
			
		||||
    retail = {
 | 
			
		||||
        ["taunt"] = L.TAUNTS, -- Lib.categoryNames.retail.taunt
 | 
			
		||||
        ["stun"] = L.STUNS,
 | 
			
		||||
        ["root"] = L.ROOTS,
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    classic = {
 | 
			
		||||
        ["stun"] = L.STUNS,
 | 
			
		||||
        ["kidney_shot"] = L.KIDNEY_SHOT,
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    tbc = {
 | 
			
		||||
        ["stun"] = L.STUNS,
 | 
			
		||||
        ["random_stun"] = L.RANDOM_STUNS,
 | 
			
		||||
        ["kidney_shot"] = L.KIDNEY_SHOT,
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    wotlk = {
 | 
			
		||||
        --["taunt"] = L.TAUNTS,
 | 
			
		||||
        ["stun"] = L.STUNS,
 | 
			
		||||
        ["random_stun"] = L.RANDOM_STUNS,
 | 
			
		||||
        ["opener_stun"] = L.OPENER_STUN,
 | 
			
		||||
    },
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
-- Successives diminished durations
 | 
			
		||||
Lib.diminishedDurations = {
 | 
			
		||||
    retail = {
 | 
			
		||||
        -- Decreases by 50%, immune at the 4th application
 | 
			
		||||
        ["default"] = { 0.50, 0.25 },
 | 
			
		||||
        -- Decreases by 35%, immune at the 5th application
 | 
			
		||||
        ["taunt"] = { 0.65, 0.42, 0.27 },
 | 
			
		||||
        -- Immediately immune
 | 
			
		||||
        ["knockback"] = {},
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    classic = {
 | 
			
		||||
        ["default"] = { 0.50, 0.25 },
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    tbc = {
 | 
			
		||||
        ["default"] = { 0.50, 0.25 },
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    wotlk = {
 | 
			
		||||
        ["default"] = { 0.50, 0.25 },
 | 
			
		||||
    },
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
-------------------------------------------------------------------------------
 | 
			
		||||
-- Public API
 | 
			
		||||
-------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
--- Get table of all spells that DRs.
 | 
			
		||||
-- Key is the spellID, and value is the unlocalized DR category.
 | 
			
		||||
-- For Classic the key is the localized spell name instead, and value
 | 
			
		||||
-- is a table containing both the DR category and spell ID. (Classic has no spellID payload in the combat log)
 | 
			
		||||
-- @see IterateSpellsByCategory
 | 
			
		||||
-- @treturn ?table {number=string}|table {string=table}
 | 
			
		||||
function Lib:GetSpells()
 | 
			
		||||
    return Lib.spellList
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
--- Get table of all DR categories.
 | 
			
		||||
-- Key is unlocalized name used for API functions, value is localized name used for UI.
 | 
			
		||||
-- @treturn table {string=string}
 | 
			
		||||
function Lib:GetCategories()
 | 
			
		||||
    return Lib.categoryNames[Lib.gameExpansion]
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
--- Get table of all categories that DRs in PvE only.
 | 
			
		||||
-- Key is unlocalized name used for API functions, value is localized name used for UI.
 | 
			
		||||
-- Note that this is only for normal mobs on retail. Special mobs or pets have DR on all categories,
 | 
			
		||||
-- see UnitClassification() and UnitIsQuestBoss().
 | 
			
		||||
-- Tip: you can combine :GetPvECategories() and :IterateSpellsByCategory() to get spellIDs only for PvE aswell.
 | 
			
		||||
-- @treturn table {string=string}
 | 
			
		||||
function Lib:GetPvECategories()
 | 
			
		||||
    return Lib.categoriesPvE[Lib.gameExpansion]
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
--- Get constant for how long a DR lasts for a given category.
 | 
			
		||||
-- @tparam[opt="default"] string category Unlocalized category name, or "npc" for PvE timer.
 | 
			
		||||
-- @treturn number
 | 
			
		||||
function Lib:GetResetTime(category)
 | 
			
		||||
    return Lib.resetTimes[Lib.gameExpansion][category or "default"] or Lib.resetTimes[Lib.gameExpansion].default
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
--- Get unlocalized DR category by spell ID.
 | 
			
		||||
-- For Classic (vanilla) you should pass in the spell name instead of ID.
 | 
			
		||||
-- For Classic you also get an optional second return value
 | 
			
		||||
-- which is the hardcoded spell ID of the spell name you passed in.
 | 
			
		||||
-- You should use this ID to query additional info from Blizzard API if needed, as
 | 
			
		||||
-- spell names only works for the player if they have the spell in their current spellbook.
 | 
			
		||||
-- @tparam number spellID
 | 
			
		||||
-- @treturn[1] string|nil The category name.
 | 
			
		||||
-- @treturn[2] number|nil The spell ID. (Classic only)
 | 
			
		||||
function Lib:GetCategoryBySpellID(spellID)
 | 
			
		||||
    if Lib.gameExpansion == "classic" then
 | 
			
		||||
        -- special case for classic as CLEU doesn't provide spellIDs
 | 
			
		||||
        local data = Lib.spellList[spellID]
 | 
			
		||||
        if not data then return end
 | 
			
		||||
        return data.category, data.spellID
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    return Lib.spellList[spellID]
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
--- Get localized category from unlocalized category name, case sensitive.
 | 
			
		||||
-- @tparam string category Unlocalized category name
 | 
			
		||||
-- @treturn ?string|nil The localized category name.
 | 
			
		||||
function Lib:GetCategoryLocalization(category)
 | 
			
		||||
    return Lib.categoryNames[Lib.gameExpansion][category]
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
--- Check if a category has DR against mobs.
 | 
			
		||||
-- Note that this is only for normal mobs on retail. Special mobs or pets have DR on all categories,
 | 
			
		||||
-- see UnitClassification() and UnitIsQuestBoss().
 | 
			
		||||
-- @tparam string category Unlocalized category name
 | 
			
		||||
-- @treturn bool
 | 
			
		||||
function Lib:IsPvECategory(category)
 | 
			
		||||
    return Lib.categoriesPvE[Lib.gameExpansion][category] and true or false -- make sure bool is always returned here
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
--- Get next successive diminished duration
 | 
			
		||||
-- @tparam number diminished How many times the DR has been applied so far
 | 
			
		||||
-- @tparam[opt="default"] string category Unlocalized category name
 | 
			
		||||
-- @usage local reduction = DRList:GetNextDR(1) -- returns 0.50, half duration on debuff
 | 
			
		||||
-- @treturn number DR percentage in decimals. Returns 0 if max DR is reached or arguments are invalid.
 | 
			
		||||
function Lib:GetNextDR(diminished, category)
 | 
			
		||||
    local durations = Lib.diminishedDurations[Lib.gameExpansion][category or "default"]
 | 
			
		||||
    if not durations and Lib.categoryNames[Lib.gameExpansion][category] then
 | 
			
		||||
        -- Redirect to default when "stun", "root" etc is passed
 | 
			
		||||
        durations = Lib.diminishedDurations[Lib.gameExpansion]["default"]
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    return durations and durations[diminished] or 0
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
do
 | 
			
		||||
    local next = _G.next
 | 
			
		||||
 | 
			
		||||
    local function CategoryIterator(category, index)
 | 
			
		||||
        local spellList, newCat = Lib.spellList
 | 
			
		||||
        repeat
 | 
			
		||||
            index, newCat = next(spellList, index)
 | 
			
		||||
            if index then
 | 
			
		||||
                if newCat == category or newCat.category == category then
 | 
			
		||||
                    return index, category
 | 
			
		||||
                end
 | 
			
		||||
            end
 | 
			
		||||
        until not index
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    --- Iterate through the spells of a given category.
 | 
			
		||||
    -- @tparam string category Unlocalized category name
 | 
			
		||||
    -- @usage for spellID in DRList:IterateSpellsByCategory("root") do print(spellID) end
 | 
			
		||||
    -- @warning Slow function, do not use for frequent combat related stuff unless you cache results.
 | 
			
		||||
    -- @return Iterator function
 | 
			
		||||
    function Lib:IterateSpellsByCategory(category)
 | 
			
		||||
        assert(Lib.categoryNames[Lib.gameExpansion][category], "invalid category")
 | 
			
		||||
        return CategoryIterator, category
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
-- keep same API as DRData-1.0 for easier transitions
 | 
			
		||||
Lib.GetCategoryName = Lib.GetCategoryLocalization
 | 
			
		||||
Lib.IsPVE = Lib.IsPvECategory
 | 
			
		||||
Lib.NextDR = Lib.GetNextDR
 | 
			
		||||
Lib.GetSpellCategory = Lib.GetCategoryBySpellID
 | 
			
		||||
Lib.IterateSpells = Lib.IterateSpellsByCategory
 | 
			
		||||
Lib.RESET_TIME = Lib.resetTimes[Lib.gameExpansion].default
 | 
			
		||||
Lib.pveDR = Lib.categoriesPvE
 | 
			
		||||
							
								
								
									
										23
									
								
								Libs/DRList-1.0/DRList-1.0.toc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								Libs/DRList-1.0/DRList-1.0.toc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,23 @@
 | 
			
		||||
## Interface: 90205
 | 
			
		||||
## Interface-Classic: 11402
 | 
			
		||||
## Interface-BCC: 20504
 | 
			
		||||
## Interface-Wrath: 30400
 | 
			
		||||
## Title: Lib: DRList-1.0
 | 
			
		||||
## Version: @project-version@
 | 
			
		||||
## X-Category: Library
 | 
			
		||||
## X-License: MIT
 | 
			
		||||
## X-Curse-Project-ID: 315757
 | 
			
		||||
## X-Wago-ID: 9rN4BxKD
 | 
			
		||||
 | 
			
		||||
#@no-lib-strip@
 | 
			
		||||
libs\LibStub\LibStub.lua
 | 
			
		||||
#@end-no-lib-strip@
 | 
			
		||||
 | 
			
		||||
DRList-1.0.xml
 | 
			
		||||
#@do-not-package@
 | 
			
		||||
tests\engine.lua
 | 
			
		||||
tests\test-retail.lua
 | 
			
		||||
tests\test-classic.lua
 | 
			
		||||
tests\test-tbc.lua
 | 
			
		||||
tests\test-wotlk.lua
 | 
			
		||||
#@end-do-not-package@
 | 
			
		||||
							
								
								
									
										4
									
								
								Libs/DRList-1.0/DRList-1.0.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								Libs/DRList-1.0/DRList-1.0.xml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,4 @@
 | 
			
		||||
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">
 | 
			
		||||
    <Script file="DRList-1.0.lua"/>
 | 
			
		||||
    <Script file="Spells.lua"/>
 | 
			
		||||
</Ui>
 | 
			
		||||
							
								
								
									
										695
									
								
								Libs/DRList-1.0/Spells.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										695
									
								
								Libs/DRList-1.0/Spells.lua
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,695 @@
 | 
			
		||||
local Lib, version = LibStub("DRList-1.0")
 | 
			
		||||
if Lib.spellList and version >= 40 then return end
 | 
			
		||||
 | 
			
		||||
if Lib.gameExpansion == "retail" then
 | 
			
		||||
 | 
			
		||||
    -- SpellID list for mainline aka retail WoW
 | 
			
		||||
    Lib.spellList = {
 | 
			
		||||
        [207167]  = "disorient",       -- Blinding Sleet
 | 
			
		||||
        [207685]  = "disorient",       -- Sigil of Misery
 | 
			
		||||
        [33786]   = "disorient",       -- Cyclone
 | 
			
		||||
        [1513]    = "disorient",       -- Scare Beast
 | 
			
		||||
        [31661]   = "disorient",       -- Dragon's Breath
 | 
			
		||||
        [198909]  = "disorient",       -- Song of Chi-ji
 | 
			
		||||
        [202274]  = "disorient",       -- Incendiary Brew
 | 
			
		||||
        [105421]  = "disorient",       -- Blinding Light
 | 
			
		||||
        [10326]   = "disorient",       -- Turn Evil
 | 
			
		||||
        [605]     = "disorient",       -- Mind Control
 | 
			
		||||
        [8122]    = "disorient",       -- Psychic Scream
 | 
			
		||||
        [226943]  = "disorient",       -- Mind Bomb
 | 
			
		||||
        [2094]    = "disorient",       -- Blind
 | 
			
		||||
        [118699]  = "disorient",       -- Fear
 | 
			
		||||
        [5484]    = "disorient",       -- Howl of Terror
 | 
			
		||||
        [261589]  = "disorient",       -- Seduction (Grimoire of Sacrifice)
 | 
			
		||||
        [6358]    = "disorient",       -- Seduction (Succubus)
 | 
			
		||||
        [5246]    = "disorient",       -- Intimidating Shout 1
 | 
			
		||||
        [316593]  = "disorient",       -- Intimidating Shout 2 (TODO: not sure which one is correct in 9.0.1)
 | 
			
		||||
        [316595]  = "disorient",       -- Intimidating Shout 3
 | 
			
		||||
        [331866]  = "disorient",       -- Agent of Chaos (Venthyr Covenant)
 | 
			
		||||
 | 
			
		||||
        [217832]  = "incapacitate",    -- Imprison
 | 
			
		||||
        [221527]  = "incapacitate",    -- Imprison (Honor talent)
 | 
			
		||||
        [2637]    = "incapacitate",    -- Hibernate
 | 
			
		||||
        [99]      = "incapacitate",    -- Incapacitating Roar
 | 
			
		||||
        [3355]    = "incapacitate",    -- Freezing Trap
 | 
			
		||||
        [203337]  = "incapacitate",    -- Freezing Trap (Honor talent)
 | 
			
		||||
        [213691]  = "incapacitate",    -- Scatter Shot
 | 
			
		||||
        [118]     = "incapacitate",    -- Polymorph
 | 
			
		||||
        [28271]   = "incapacitate",    -- Polymorph (Turtle)
 | 
			
		||||
        [28272]   = "incapacitate",    -- Polymorph (Pig)
 | 
			
		||||
        [61025]   = "incapacitate",    -- Polymorph (Snake)
 | 
			
		||||
        [61305]   = "incapacitate",    -- Polymorph (Black Cat)
 | 
			
		||||
        [61780]   = "incapacitate",    -- Polymorph (Turkey)
 | 
			
		||||
        [61721]   = "incapacitate",    -- Polymorph (Rabbit)
 | 
			
		||||
        [126819]  = "incapacitate",    -- Polymorph (Porcupine)
 | 
			
		||||
        [161353]  = "incapacitate",    -- Polymorph (Polar Bear Cub)
 | 
			
		||||
        [161354]  = "incapacitate",    -- Polymorph (Monkey)
 | 
			
		||||
        [161355]  = "incapacitate",    -- Polymorph (Penguin)
 | 
			
		||||
        [161372]  = "incapacitate",    -- Polymorph (Peacock)
 | 
			
		||||
        [277787]  = "incapacitate",    -- Polymorph (Baby Direhorn)
 | 
			
		||||
        [277792]  = "incapacitate",    -- Polymorph (Bumblebee)
 | 
			
		||||
        [82691]   = "incapacitate",    -- Ring of Frost
 | 
			
		||||
        [115078]  = "incapacitate",    -- Paralysis
 | 
			
		||||
        [20066]   = "incapacitate",    -- Repentance
 | 
			
		||||
        [9484]    = "incapacitate",    -- Shackle Undead
 | 
			
		||||
        [200196]  = "incapacitate",    -- Holy Word: Chastise
 | 
			
		||||
        [1776]    = "incapacitate",    -- Gouge
 | 
			
		||||
        [6770]    = "incapacitate",    -- Sap
 | 
			
		||||
        [51514]   = "incapacitate",    -- Hex
 | 
			
		||||
        [196942]  = "incapacitate",    -- Hex (Voodoo Totem)
 | 
			
		||||
        [210873]  = "incapacitate",    -- Hex (Raptor)
 | 
			
		||||
        [211004]  = "incapacitate",    -- Hex (Spider)
 | 
			
		||||
        [211010]  = "incapacitate",    -- Hex (Snake)
 | 
			
		||||
        [211015]  = "incapacitate",    -- Hex (Cockroach)
 | 
			
		||||
        [269352]  = "incapacitate",    -- Hex (Skeletal Hatchling)
 | 
			
		||||
        [309328]  = "incapacitate",    -- Hex (Living Honey)
 | 
			
		||||
        [277778]  = "incapacitate",    -- Hex (Zandalari Tendonripper)
 | 
			
		||||
        [277784]  = "incapacitate",    -- Hex (Wicker Mongrel)
 | 
			
		||||
        [197214]  = "incapacitate",    -- Sundering
 | 
			
		||||
        [710]     = "incapacitate",    -- Banish
 | 
			
		||||
        [6789]    = "incapacitate",    -- Mortal Coil
 | 
			
		||||
        [107079]  = "incapacitate",    -- Quaking Palm (Pandaren racial)
 | 
			
		||||
 | 
			
		||||
        [47476]   = "silence",         -- Strangulate
 | 
			
		||||
        [204490]  = "silence",         -- Sigil of Silence
 | 
			
		||||
--      [78675]   = "silence",         -- Solar Beam (doesn't seem to DR)
 | 
			
		||||
        [202933]  = "silence",         -- Spider Sting
 | 
			
		||||
        [356727]  = "silence",         -- Spider Venom
 | 
			
		||||
        [217824]  = "silence",         -- Shield of Virtue
 | 
			
		||||
        [15487]   = "silence",         -- Silence
 | 
			
		||||
        [1330]    = "silence",         -- Garrote
 | 
			
		||||
        [196364]  = "silence",         -- Unstable Affliction Silence Effect
 | 
			
		||||
 | 
			
		||||
        [210141]  = "stun",            -- Zombie Explosion
 | 
			
		||||
        [334693]  = "stun",            -- Absolute Zero (Breath of Sindragosa)
 | 
			
		||||
        [108194]  = "stun",            -- Asphyxiate (Unholy)
 | 
			
		||||
        [221562]  = "stun",            -- Asphyxiate (Blood)
 | 
			
		||||
        [91800]   = "stun",            -- Gnaw (Ghoul)
 | 
			
		||||
        [91797]   = "stun",            -- Monstrous Blow (Mutated Ghoul)
 | 
			
		||||
        [287254]  = "stun",            -- Dead of Winter
 | 
			
		||||
        [179057]  = "stun",            -- Chaos Nova
 | 
			
		||||
        [205630]  = "stun",            -- Illidan's Grasp (Primary effect)
 | 
			
		||||
        [208618]  = "stun",            -- Illidan's Grasp (Secondary effect)
 | 
			
		||||
        [211881]  = "stun",            -- Fel Eruption
 | 
			
		||||
        [200166]  = "stun",            -- Metamorphosis (PvE stun effect)
 | 
			
		||||
        [203123]  = "stun",            -- Maim
 | 
			
		||||
        [163505]  = "stun",            -- Rake (Prowl)
 | 
			
		||||
        [5211]    = "stun",            -- Mighty Bash
 | 
			
		||||
        [202244]  = "stun",            -- Overrun
 | 
			
		||||
        [325321]  = "stun",            -- Wild Hunt's Charge
 | 
			
		||||
        [357021]  = "stun",            -- Consecutive Concussion
 | 
			
		||||
        [24394]   = "stun",            -- Intimidation
 | 
			
		||||
        [119381]  = "stun",            -- Leg Sweep
 | 
			
		||||
        [202346]  = "stun",            -- Double Barrel
 | 
			
		||||
        [853]     = "stun",            -- Hammer of Justice
 | 
			
		||||
        [255941]  = "stun",            -- Wake of Ashes
 | 
			
		||||
        [64044]   = "stun",            -- Psychic Horror
 | 
			
		||||
        [200200]  = "stun",            -- Holy Word: Chastise Censure
 | 
			
		||||
        [1833]    = "stun",            -- Cheap Shot
 | 
			
		||||
        [408]     = "stun",            -- Kidney Shot
 | 
			
		||||
        [118905]  = "stun",            -- Static Charge (Capacitor Totem)
 | 
			
		||||
        [118345]  = "stun",            -- Pulverize (Primal Earth Elemental)
 | 
			
		||||
        [305485]  = "stun",            -- Lightning Lasso
 | 
			
		||||
        [89766]   = "stun",            -- Axe Toss
 | 
			
		||||
        [171017]  = "stun",            -- Meteor Strike (Infernal)
 | 
			
		||||
        [171018]  = "stun",            -- Meteor Strike (Abyssal)
 | 
			
		||||
        [30283]   = "stun",            -- Shadowfury
 | 
			
		||||
        [46968]   = "stun",            -- Shockwave
 | 
			
		||||
        [132168]  = "stun",            -- Shockwave (Protection)
 | 
			
		||||
        [145047]  = "stun",            -- Shockwave (Proving Grounds PvE)
 | 
			
		||||
        [132169]  = "stun",            -- Storm Bolt
 | 
			
		||||
        [199085]  = "stun",            -- Warpath
 | 
			
		||||
        [20549]   = "stun",            -- War Stomp (Tauren)
 | 
			
		||||
        [255723]  = "stun",            -- Bull Rush (Highmountain Tauren)
 | 
			
		||||
        [287712]  = "stun",            -- Haymaker (Kul Tiran)
 | 
			
		||||
        [332423]  = "stun",            -- Sparkling Driftglobe Core (Kyrian Covenant)
 | 
			
		||||
 | 
			
		||||
        [204085]  = "root",            -- Deathchill (Chains of Ice)
 | 
			
		||||
        [233395]  = "root",            -- Deathchill (Remorseless Winter)
 | 
			
		||||
        [339]     = "root",            -- Entangling Roots
 | 
			
		||||
        [170855]  = "root",            -- Entangling Roots (Nature's Grasp)
 | 
			
		||||
        [102359]  = "root",            -- Mass Entanglement
 | 
			
		||||
        [117526]  = "root",            -- Binding Shot
 | 
			
		||||
        [162480]  = "root",            -- Steel Trap
 | 
			
		||||
        [273909]  = "root",            -- Steelclaw Trap
 | 
			
		||||
--      [190927]  = "root_harpoon",    -- Harpoon (TODO: confirm)
 | 
			
		||||
        [212638]  = "root",            -- Tracker's Net
 | 
			
		||||
        [201158]  = "root",            -- Super Sticky Tar
 | 
			
		||||
        [122]     = "root",            -- Frost Nova
 | 
			
		||||
        [33395]   = "root",            -- Freeze
 | 
			
		||||
        [198121]  = "root",            -- Frostbite
 | 
			
		||||
        [342375]  = "root",            -- Tormenting Backlash (Torghast PvE)
 | 
			
		||||
        [233582]  = "root",            -- Entrenched in Flame
 | 
			
		||||
        [116706]  = "root",            -- Disable
 | 
			
		||||
        [324382]  = "root",            -- Clash
 | 
			
		||||
        [64695]   = "root",            -- Earthgrab (Totem effect)
 | 
			
		||||
        [285515]  = "root",            -- Surge of Power
 | 
			
		||||
        [39965]   = "root",            -- Frost Grenade (Item)
 | 
			
		||||
        [75148]   = "root",            -- Embersilk Net (Item)
 | 
			
		||||
        [55536]   = "root",            -- Frostweave Net (Item)
 | 
			
		||||
        [268966]  = "root",            -- Hooked Deep Sea Net (Item)
 | 
			
		||||
 | 
			
		||||
        [209749]  = "disarm",          -- Faerie Swarm (Balance Honor Talent)
 | 
			
		||||
        [207777]  = "disarm",          -- Dismantle
 | 
			
		||||
        [233759]  = "disarm",          -- Grapple Weapon
 | 
			
		||||
        [236077]  = "disarm",          -- Disarm
 | 
			
		||||
 | 
			
		||||
        [56222]   = "taunt",           -- Dark Command
 | 
			
		||||
        [51399]   = "taunt",           -- Death Grip (Taunt Effect)
 | 
			
		||||
        [185245]  = "taunt",           -- Torment
 | 
			
		||||
        [6795]    = "taunt",           -- Growl (Druid)
 | 
			
		||||
        [2649]    = "taunt",           -- Growl (Hunter Pet) (TODO: confirm)
 | 
			
		||||
        [20736]   = "taunt",           -- Distracting Shot
 | 
			
		||||
        [116189]  = "taunt",           -- Provoke
 | 
			
		||||
        [118635]  = "taunt",           -- Provoke (Black Ox Statue)
 | 
			
		||||
        [196727]  = "taunt",           -- Provoke (Niuzao)
 | 
			
		||||
        [204079]  = "taunt",           -- Final Stand
 | 
			
		||||
        [62124]   = "taunt",           -- Hand of Reckoning
 | 
			
		||||
        [17735]   = "taunt",           -- Suffering (Voidwalker) (TODO: confirm)
 | 
			
		||||
        [355]     = "taunt",           -- Taunt
 | 
			
		||||
 | 
			
		||||
        -- Experimental
 | 
			
		||||
        [108199]  = "knockback",        -- Gorefiend's Grasp
 | 
			
		||||
        [202249]  = "knockback",        -- Overrun
 | 
			
		||||
        [61391]   = "knockback",        -- Typhoon
 | 
			
		||||
        [102793]  = "knockback",        -- Ursol's Vortex
 | 
			
		||||
        [186387]  = "knockback",        -- Bursting Shot
 | 
			
		||||
        [236777]  = "knockback",        -- Hi-Explosive Trap
 | 
			
		||||
        [157981]  = "knockback",        -- Blast Wave
 | 
			
		||||
        [237371]  = "knockback",        -- Ring of Peace
 | 
			
		||||
        [204263]  = "knockback",        -- Shining Force
 | 
			
		||||
        [51490]   = "knockback",        -- Thunderstorm
 | 
			
		||||
--      [287712]  = "knockback",        -- Haywire (Kul'Tiran Racial)
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
elseif Lib.gameExpansion == "tbc" then
 | 
			
		||||
 | 
			
		||||
    -- SpellID list for The Burning Crusade
 | 
			
		||||
    -- spellID for every rank is used over spell name to avoid name collisions, and faster lookups
 | 
			
		||||
    Lib.spellList = {
 | 
			
		||||
        [2637]  = "incapacitate", -- Hibernate (Rank 1)
 | 
			
		||||
        [18657] = "incapacitate", -- Hibernate (Rank 2)
 | 
			
		||||
        [18658] = "incapacitate", -- Hibernate (Rank 3)
 | 
			
		||||
        [22570] = "incapacitate", -- Maim
 | 
			
		||||
        [3355]  = "incapacitate", -- Freezing Trap Effect (Rank 1)
 | 
			
		||||
        [14308] = "incapacitate", -- Freezing Trap Effect (Rank 2)
 | 
			
		||||
        [14309] = "incapacitate", -- Freezing Trap Effect (Rank 3)
 | 
			
		||||
        [19386] = "incapacitate", -- Wyvern Sting (Rank 1)
 | 
			
		||||
        [24132] = "incapacitate", -- Wyvern Sting (Rank 2)
 | 
			
		||||
        [24133] = "incapacitate", -- Wyvern Sting (Rank 3)
 | 
			
		||||
        [27068] = "incapacitate", -- Wyvern Sting (Rank 4)
 | 
			
		||||
        [118]   = "incapacitate", -- Polymorph (Rank 1)
 | 
			
		||||
        [12824] = "incapacitate", -- Polymorph (Rank 2)
 | 
			
		||||
        [12825] = "incapacitate", -- Polymorph (Rank 3)
 | 
			
		||||
        [12826] = "incapacitate", -- Polymorph (Rank 4)
 | 
			
		||||
        [28271] = "incapacitate", -- Polymorph: Turtle
 | 
			
		||||
        [28272] = "incapacitate", -- Polymorph: Pig
 | 
			
		||||
        [20066] = "incapacitate", -- Repentance
 | 
			
		||||
        [6770]  = "incapacitate", -- Sap (Rank 1)
 | 
			
		||||
        [2070]  = "incapacitate", -- Sap (Rank 2)
 | 
			
		||||
        [11297] = "incapacitate", -- Sap (Rank 3)
 | 
			
		||||
        [1776]  = "incapacitate", -- Gouge (Rank 1)
 | 
			
		||||
        [1777]  = "incapacitate", -- Gouge (Rank 2)
 | 
			
		||||
        [8629]  = "incapacitate", -- Gouge (Rank 3)
 | 
			
		||||
        [11285] = "incapacitate", -- Gouge (Rank 4)
 | 
			
		||||
        [11286] = "incapacitate", -- Gouge (Rank 5)
 | 
			
		||||
        [38764] = "incapacitate", -- Gouge (Rank 6)
 | 
			
		||||
        [13327] = "incapacitate", -- Reckless Charge (Rocket Helmet)
 | 
			
		||||
        [4064]  = "incapacitate", -- Rough Copper Bomb
 | 
			
		||||
        [4065]  = "incapacitate", -- Large Copper Bomb
 | 
			
		||||
        [4066]  = "incapacitate", -- Small Bronze Bomb
 | 
			
		||||
        [4067]  = "incapacitate", -- Big Bronze Bomb
 | 
			
		||||
        [4068]  = "incapacitate", -- Iron Grenade
 | 
			
		||||
        [12421] = "incapacitate", -- Mithril Frag Bomb
 | 
			
		||||
        [4069]  = "incapacitate", -- Big Iron Bomb
 | 
			
		||||
        [12562] = "incapacitate", -- The Big One
 | 
			
		||||
        [12543] = "incapacitate", -- Hi-Explosive Bomb
 | 
			
		||||
        [19769] = "incapacitate", -- Thorium Grenade
 | 
			
		||||
        [19784] = "incapacitate", -- Dark Iron Bomb
 | 
			
		||||
        [30216] = "incapacitate", -- Fel Iron Bomb
 | 
			
		||||
        [30461] = "incapacitate", -- The Bigger One
 | 
			
		||||
        [30217] = "incapacitate", -- Adamantite Grenade
 | 
			
		||||
 | 
			
		||||
        [33786] = "disorient", -- Cyclone
 | 
			
		||||
        [2094]  = "disorient", -- Blind
 | 
			
		||||
 | 
			
		||||
        [5211]  = "stun", -- Bash (Rank 1)
 | 
			
		||||
        [6798]  = "stun", -- Bash (Rank 2)
 | 
			
		||||
        [8983]  = "stun", -- Bash (Rank 3)
 | 
			
		||||
        [9005]  = "stun", -- Pounce (Rank 1)
 | 
			
		||||
        [9823]  = "stun", -- Pounce (Rank 2)
 | 
			
		||||
        [9827]  = "stun", -- Pounce (Rank 3)
 | 
			
		||||
        [27006] = "stun", -- Pounce (Rank 4)
 | 
			
		||||
        [24394] = "stun", -- Intimidation
 | 
			
		||||
        [853]   = "stun", -- Hammer of Justice (Rank 1)
 | 
			
		||||
        [5588]  = "stun", -- Hammer of Justice (Rank 2)
 | 
			
		||||
        [5589]  = "stun", -- Hammer of Justice (Rank 3)
 | 
			
		||||
        [10308] = "stun", -- Hammer of Justice (Rank 4)
 | 
			
		||||
        [1833]  = "stun", -- Cheap Shot
 | 
			
		||||
        [30283] = "stun", -- Shadowfury (Rank 1)
 | 
			
		||||
        [30413] = "stun", -- Shadowfury (Rank 2)
 | 
			
		||||
        [30414] = "stun", -- Shadowfury (Rank 3)
 | 
			
		||||
        [12809] = "stun", -- Concussion Blow
 | 
			
		||||
        [7922]  = "stun", -- Charge Stun
 | 
			
		||||
        [20253] = "stun", -- Intercept Stun (Rank 1)
 | 
			
		||||
        [20614] = "stun", -- Intercept Stun (Rank 2)
 | 
			
		||||
        [20615] = "stun", -- Intercept Stun (Rank 3)
 | 
			
		||||
        [25273] = "stun", -- Intercept Stun (Rank 4)
 | 
			
		||||
        [25274] = "stun", -- Intercept Stun (Rank 5)
 | 
			
		||||
        [20549] = "stun", -- War Stomp (Racial)
 | 
			
		||||
        [13237] = "stun", -- Goblin Mortar
 | 
			
		||||
        [835]   = "stun", -- Tidal Charm
 | 
			
		||||
 | 
			
		||||
        [16922]   = "random_stun",  -- Celestial Focus (Starfire Stun)
 | 
			
		||||
        [19410]   = "random_stun",  -- Improved Concussive Shot
 | 
			
		||||
        [12355]   = "random_stun",  -- Impact
 | 
			
		||||
        [20170]   = "random_stun",  -- Seal of Justice Stun
 | 
			
		||||
        [15269]   = "random_stun",  -- Blackout
 | 
			
		||||
        [18093]   = "random_stun",  -- Pyroclasm
 | 
			
		||||
        [39796]   = "random_stun",  -- Stoneclaw Stun
 | 
			
		||||
        [12798]   = "random_stun",  -- Revenge Stun
 | 
			
		||||
        [5530]    = "random_stun",  -- Mace Stun Effect (Mace Specialization)
 | 
			
		||||
        [15283]   = "random_stun",  -- Stunning Blow (Weapon Proc)
 | 
			
		||||
        [56]      = "random_stun",  -- Stun (Weapon Proc)
 | 
			
		||||
        [34510]   = "random_stun",  -- Stormherald/Deep Thunder (Weapon Proc)
 | 
			
		||||
 | 
			
		||||
        [10326] = "fear", -- Turn Evil (Might be PvE only until wotlk, adding just incase)
 | 
			
		||||
        [8122]  = "fear", -- Psychic Scream (Rank 1)
 | 
			
		||||
        [8124]  = "fear", -- Psychic Scream (Rank 2)
 | 
			
		||||
        [10888] = "fear", -- Psychic Scream (Rank 3)
 | 
			
		||||
        [10890] = "fear", -- Psychic Scream (Rank 4)
 | 
			
		||||
        [5782]  = "fear", -- Fear (Rank 1)
 | 
			
		||||
        [6213]  = "fear", -- Fear (Rank 2)
 | 
			
		||||
        [6215]  = "fear", -- Fear (Rank 3)
 | 
			
		||||
        [6358]  = "fear", -- Seduction (Succubus)
 | 
			
		||||
        [5484]  = "fear", -- Howl of Terror (Rank 1)
 | 
			
		||||
        [17928] = "fear", -- Howl of Terror (Rank 2)
 | 
			
		||||
        [1513]  = "fear", -- Scare Beast (Rank 1)
 | 
			
		||||
        [14326] = "fear", -- Scare Beast (Rank 2)
 | 
			
		||||
        [14327] = "fear", -- Scare Beast (Rank 3)
 | 
			
		||||
        [5246]  = "fear", -- Intimidating Shout
 | 
			
		||||
        [5134]  = "fear", -- Flash Bomb Fear (Item)
 | 
			
		||||
 | 
			
		||||
        [339]   = "root", -- Entangling Roots (Rank 1)
 | 
			
		||||
        [1062]  = "root", -- Entangling Roots (Rank 2)
 | 
			
		||||
        [5195]  = "root", -- Entangling Roots (Rank 3)
 | 
			
		||||
        [5196]  = "root", -- Entangling Roots (Rank 4)
 | 
			
		||||
        [9852]  = "root", -- Entangling Roots (Rank 5)
 | 
			
		||||
        [9853]  = "root", -- Entangling Roots (Rank 6)
 | 
			
		||||
        [26989] = "root", -- Entangling Roots (Rank 7)
 | 
			
		||||
        [19975] = "root", -- Nature's Grasp (Rank 1)
 | 
			
		||||
        [19974] = "root", -- Nature's Grasp (Rank 2)
 | 
			
		||||
        [19973] = "root", -- Nature's Grasp (Rank 3)
 | 
			
		||||
        [19972] = "root", -- Nature's Grasp (Rank 4)
 | 
			
		||||
        [19971] = "root", -- Nature's Grasp (Rank 5)
 | 
			
		||||
        [19970] = "root", -- Nature's Grasp (Rank 6)
 | 
			
		||||
        [27010] = "root", -- Nature's Grasp (Rank 7)
 | 
			
		||||
        [122]   = "root", -- Frost Nova (Rank 1)
 | 
			
		||||
        [865]   = "root", -- Frost Nova (Rank 2)
 | 
			
		||||
        [6131]  = "root", -- Frost Nova (Rank 3)
 | 
			
		||||
        [10230] = "root", -- Frost Nova (Rank 4)
 | 
			
		||||
        [27088] = "root", -- Frost Nova (Rank 5)
 | 
			
		||||
        [33395] = "root", -- Freeze (Water Elemental)
 | 
			
		||||
        [39965] = "root", -- Frost Grenade (Item)
 | 
			
		||||
 | 
			
		||||
        [605]   = "mind_control", -- Mind Control (Rank 1)
 | 
			
		||||
        [10911] = "mind_control", -- Mind Control (Rank 2)
 | 
			
		||||
        [10912] = "mind_control", -- Mind Control (Rank 3)
 | 
			
		||||
        [13181] = "mind_control", -- Gnomish Mind Control Cap
 | 
			
		||||
 | 
			
		||||
        [14251] = "disarm", -- Riposte
 | 
			
		||||
        [34097] = "disarm", -- Riposte 2 (TODO: Check which ID is the correct one)
 | 
			
		||||
        [676]   = "disarm", -- Disarm
 | 
			
		||||
 | 
			
		||||
        [12494] = "random_root",         -- Frostbite
 | 
			
		||||
        [23694] = "random_root",         -- Improved Hamstring
 | 
			
		||||
        [19229] = "random_root",         -- Improved Wing Clip
 | 
			
		||||
        [19185] = "random_root",         -- Entrapment
 | 
			
		||||
 | 
			
		||||
        [19503] = "scatter",        -- Scatter Shot
 | 
			
		||||
        [31661] = "scatter",        -- Dragon's Breath (Rank 1)
 | 
			
		||||
        [33041] = "scatter",        -- Dragon's Breath (Rank 2)
 | 
			
		||||
        [33042] = "scatter",        -- Dragon's Breath (Rank 3)
 | 
			
		||||
        [33043] = "scatter",        -- Dragon's Breath (Rank 4)
 | 
			
		||||
 | 
			
		||||
        -- Spells that DR with itself only
 | 
			
		||||
        [408]   = "kidney_shot",         -- Kidney Shot (Rank 1)
 | 
			
		||||
        [8643]  = "kidney_shot",         -- Kidney Shot (Rank 2)
 | 
			
		||||
        [43523] = "unstable_affliction", -- Unstable Affliction 1
 | 
			
		||||
        [31117] = "unstable_affliction", -- Unstable Affliction 2
 | 
			
		||||
        [6789]  = "death_coil",          -- Death Coil (Rank 1)
 | 
			
		||||
        [17925] = "death_coil",          -- Death Coil (Rank 2)
 | 
			
		||||
        [17926] = "death_coil",          -- Death Coil (Rank 3)
 | 
			
		||||
        [27223] = "death_coil",          -- Death Coil (Rank 4)
 | 
			
		||||
        [44041] = "chastise",            -- Chastise (Rank 1)
 | 
			
		||||
        [44043] = "chastise",            -- Chastise (Rank 2)
 | 
			
		||||
        [44044] = "chastise",            -- Chastise (Rank 3)
 | 
			
		||||
        [44045] = "chastise",            -- Chastise (Rank 4)
 | 
			
		||||
        [44046] = "chastise",            -- Chastise (Rank 5)
 | 
			
		||||
        [44047] = "chastise",            -- Chastise (Rank 6)
 | 
			
		||||
        [19306] = "counterattack",       -- Counterattack (Rank 1)
 | 
			
		||||
        [20909] = "counterattack",       -- Counterattack (Rank 2)
 | 
			
		||||
        [20910] = "counterattack",       -- Counterattack (Rank 3)
 | 
			
		||||
        [27067] = "counterattack",       -- Counterattack (Rank 4)
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
elseif Lib.gameExpansion == "wotlk" then -- STILL WORK IN PROGRESS, I DON'T HAVE BETA ACCESS
 | 
			
		||||
 | 
			
		||||
    -- SpellID list for Wrath of the Lich King.
 | 
			
		||||
    -- spellID for every rank is used over spell name to avoid name collisions, and faster lookups
 | 
			
		||||
    Lib.spellList = {
 | 
			
		||||
        [49203] = "incapacitate", -- Hungering Cold
 | 
			
		||||
        [2637]  = "incapacitate", -- Hibernate (Rank 1)
 | 
			
		||||
        [18657] = "incapacitate", -- Hibernate (Rank 2)
 | 
			
		||||
        [18658] = "incapacitate", -- Hibernate (Rank 3)
 | 
			
		||||
        [60210] = "incapacitate", -- Freezing Arrow Effect (Rank 1)
 | 
			
		||||
        [3355]  = "incapacitate", -- Freezing Trap Effect (Rank 1)
 | 
			
		||||
        [14308] = "incapacitate", -- Freezing Trap Effect (Rank 2)
 | 
			
		||||
        [14309] = "incapacitate", -- Freezing Trap Effect (Rank 3)
 | 
			
		||||
        [19386] = "incapacitate", -- Wyvern Sting (Rank 1)
 | 
			
		||||
        [24132] = "incapacitate", -- Wyvern Sting (Rank 2)
 | 
			
		||||
        [24133] = "incapacitate", -- Wyvern Sting (Rank 3)
 | 
			
		||||
        [27068] = "incapacitate", -- Wyvern Sting (Rank 4)
 | 
			
		||||
        [49011] = "incapacitate", -- Wyvern Sting (Rank 5)
 | 
			
		||||
        [49012] = "incapacitate", -- Wyvern Sting (Rank 6)
 | 
			
		||||
        [118]   = "incapacitate", -- Polymorph (Rank 1)
 | 
			
		||||
        [12824] = "incapacitate", -- Polymorph (Rank 2)
 | 
			
		||||
        [12825] = "incapacitate", -- Polymorph (Rank 3)
 | 
			
		||||
        [12826] = "incapacitate", -- Polymorph (Rank 4)
 | 
			
		||||
        [28271] = "incapacitate", -- Polymorph: Turtle
 | 
			
		||||
        [28272] = "incapacitate", -- Polymorph: Pig
 | 
			
		||||
        [61721] = "incapacitate", -- Polymorph: Rabbit
 | 
			
		||||
        [61780] = "incapacitate", -- Polymorph: Turkey
 | 
			
		||||
        [61305] = "incapacitate", -- Polymorph: Black Cat
 | 
			
		||||
        [20066] = "incapacitate", -- Repentance
 | 
			
		||||
        [1776]  = "incapacitate", -- Gouge
 | 
			
		||||
        [6770]  = "incapacitate", -- Sap (Rank 1)
 | 
			
		||||
        [2070]  = "incapacitate", -- Sap (Rank 2)
 | 
			
		||||
        [11297] = "incapacitate", -- Sap (Rank 3)
 | 
			
		||||
        [51724] = "incapacitate", -- Sap (Rank 4)
 | 
			
		||||
        [710]   = "incapacitate", -- Banish (Rank 1)
 | 
			
		||||
        [18647] = "incapacitate", -- Banish (Rank 2)
 | 
			
		||||
        [9484]  = "incapacitate", -- Shackle Undead (Rank 1)
 | 
			
		||||
        [9485]  = "incapacitate", -- Shackle Undead (Rank 2)
 | 
			
		||||
        [10955] = "incapacitate", -- Shackle Undead (Rank 3)
 | 
			
		||||
        [51514] = "incapacitate", -- Hex
 | 
			
		||||
        [13327] = "incapacitate", -- Reckless Charge (Rocket Helmet)
 | 
			
		||||
        [4064]  = "incapacitate", -- Rough Copper Bomb
 | 
			
		||||
        [4065]  = "incapacitate", -- Large Copper Bomb
 | 
			
		||||
        [4066]  = "incapacitate", -- Small Bronze Bomb
 | 
			
		||||
        [4067]  = "incapacitate", -- Big Bronze Bomb
 | 
			
		||||
        [4068]  = "incapacitate", -- Iron Grenade
 | 
			
		||||
        [12421] = "incapacitate", -- Mithril Frag Bomb
 | 
			
		||||
        [4069]  = "incapacitate", -- Big Iron Bomb
 | 
			
		||||
        [12562] = "incapacitate", -- The Big One
 | 
			
		||||
        [12543] = "incapacitate", -- Hi-Explosive Bomb
 | 
			
		||||
        [19769] = "incapacitate", -- Thorium Grenade
 | 
			
		||||
        [19784] = "incapacitate", -- Dark Iron Bomb
 | 
			
		||||
        [30216] = "incapacitate", -- Fel Iron Bomb
 | 
			
		||||
        [30461] = "incapacitate", -- The Bigger One
 | 
			
		||||
        [30217] = "incapacitate", -- Adamantite Grenade
 | 
			
		||||
 | 
			
		||||
        [47481] = "stun", -- Gnaw (Ghoul Pet)
 | 
			
		||||
        [5211]  = "stun", -- Bash (Rank 1)
 | 
			
		||||
        [6798]  = "stun", -- Bash (Rank 2)
 | 
			
		||||
        [8983]  = "stun", -- Bash (Rank 3)
 | 
			
		||||
        [22570] = "stun", -- Maim (Rank 1)
 | 
			
		||||
        [49802] = "stun", -- Maim (Rank 2)
 | 
			
		||||
        [24394] = "stun", -- Intimidation
 | 
			
		||||
        [50519] = "stun", -- Sonic Blast (Pet Rank 1)
 | 
			
		||||
        [53564] = "stun", -- Sonic Blast (Pet Rank 2)
 | 
			
		||||
        [53565] = "stun", -- Sonic Blast (Pet Rank 3)
 | 
			
		||||
        [53566] = "stun", -- Sonic Blast (Pet Rank 4)
 | 
			
		||||
        [53567] = "stun", -- Sonic Blast (Pet Rank 5)
 | 
			
		||||
        [53568] = "stun", -- Sonic Blast (Pet Rank 6)
 | 
			
		||||
        [50518] = "stun", -- Ravage (Pet Rank 1)
 | 
			
		||||
        [53558] = "stun", -- Ravage (Pet Rank 2)
 | 
			
		||||
        [53559] = "stun", -- Ravage (Pet Rank 3)
 | 
			
		||||
        [53560] = "stun", -- Ravage (Pet Rank 4)
 | 
			
		||||
        [53561] = "stun", -- Ravage (Pet Rank 5)
 | 
			
		||||
        [53562] = "stun", -- Ravage (Pet Rank 6)
 | 
			
		||||
        [44572] = "stun", -- Deep Freeze
 | 
			
		||||
        [853]   = "stun", -- Hammer of Justice (Rank 1)
 | 
			
		||||
        [5588]  = "stun", -- Hammer of Justice (Rank 2)
 | 
			
		||||
        [5589]  = "stun", -- Hammer of Justice (Rank 3)
 | 
			
		||||
        [10308] = "stun", -- Hammer of Justice (Rank 4)
 | 
			
		||||
        [2812]  = "stun", -- Holy Wrath (Rank 1)
 | 
			
		||||
        [10318] = "stun", -- Holy Wrath (Rank 2)
 | 
			
		||||
        [27139] = "stun", -- Holy Wrath (Rank 3)
 | 
			
		||||
        [48816] = "stun", -- Holy Wrath (Rank 4)
 | 
			
		||||
        [48817] = "stun", -- Holy Wrath (Rank 5)
 | 
			
		||||
        [408]   = "stun", -- Kidney Shot (Rank 1)
 | 
			
		||||
        [8643]  = "stun", -- Kidney Shot (Rank 2)
 | 
			
		||||
        [58861] = "stun", -- Bash (Spirit Wolves)
 | 
			
		||||
        [30283] = "stun", -- Shadowfury (Rank 1)
 | 
			
		||||
        [30413] = "stun", -- Shadowfury (Rank 2)
 | 
			
		||||
        [30414] = "stun", -- Shadowfury (Rank 3)
 | 
			
		||||
        [47846] = "stun", -- Shadowfury (Rank 4)
 | 
			
		||||
        [47847] = "stun", -- Shadowfury (Rank 5)
 | 
			
		||||
        [12809] = "stun", -- Concussion Blow
 | 
			
		||||
        [60995] = "stun", -- Demon Charge
 | 
			
		||||
        [30153] = "stun", -- Intercept (Felguard Rank 1)
 | 
			
		||||
        [30195] = "stun", -- Intercept (Felguard Rank 2)
 | 
			
		||||
        [30197] = "stun", -- Intercept (Felguard Rank 3)
 | 
			
		||||
        [47995] = "stun", -- Intercept (Felguard Rank 4)
 | 
			
		||||
        [20253] = "stun", -- Intercept Stun (Rank 1)
 | 
			
		||||
        [20614] = "stun", -- Intercept Stun (Rank 2)
 | 
			
		||||
        [20615] = "stun", -- Intercept Stun (Rank 3)
 | 
			
		||||
        [25273] = "stun", -- Intercept Stun (Rank 4)
 | 
			
		||||
        [25274] = "stun", -- Intercept Stun (Rank 5)
 | 
			
		||||
        [46968] = "stun", -- Shockwave
 | 
			
		||||
        [20549] = "stun", -- War Stomp (Racial)
 | 
			
		||||
 | 
			
		||||
        [16922]   = "random_stun",  -- Celestial Focus (Starfire Stun)
 | 
			
		||||
        [28445]   = "random_stun",  -- Improved Concussive Shot
 | 
			
		||||
        [12355]   = "random_stun",  -- Impact
 | 
			
		||||
        [20170]   = "random_stun",  -- Seal of Justice Stun
 | 
			
		||||
        [39796]   = "random_stun",  -- Stoneclaw Stun
 | 
			
		||||
        [12798]   = "random_stun",  -- Revenge Stun
 | 
			
		||||
        [5530]    = "random_stun",  -- Mace Stun Effect (Mace Specialization)
 | 
			
		||||
        [15283]   = "random_stun",  -- Stunning Blow (Weapon Proc)
 | 
			
		||||
        [56]      = "random_stun",  -- Stun (Weapon Proc)
 | 
			
		||||
        [34510]   = "random_stun",  -- Stormherald/Deep Thunder (Weapon Proc)
 | 
			
		||||
 | 
			
		||||
        [1513]  = "fear", -- Scare Beast (Rank 1)
 | 
			
		||||
        [14326] = "fear", -- Scare Beast (Rank 2)
 | 
			
		||||
        [14327] = "fear", -- Scare Beast (Rank 3)
 | 
			
		||||
        [10326] = "fear", -- Turn Evil
 | 
			
		||||
        [8122]  = "fear", -- Psychic Scream (Rank 1)
 | 
			
		||||
        [8124]  = "fear", -- Psychic Scream (Rank 2)
 | 
			
		||||
        [10888] = "fear", -- Psychic Scream (Rank 3)
 | 
			
		||||
        [10890] = "fear", -- Psychic Scream (Rank 4)
 | 
			
		||||
        [2094]  = "fear", -- Blind
 | 
			
		||||
        [5782]  = "fear", -- Fear (Rank 1)
 | 
			
		||||
        [6213]  = "fear", -- Fear (Rank 2)
 | 
			
		||||
        [6215]  = "fear", -- Fear (Rank 3)
 | 
			
		||||
        [6358]  = "fear", -- Seduction (Succubus)
 | 
			
		||||
        [5484]  = "fear", -- Howl of Terror (Rank 1)
 | 
			
		||||
        [17928] = "fear", -- Howl of Terror (Rank 2)
 | 
			
		||||
        [5246]  = "fear", -- Intimidating Shout
 | 
			
		||||
        [5134]  = "fear", -- Flash Bomb Fear (Item)
 | 
			
		||||
 | 
			
		||||
        [339]   = "root", -- Entangling Roots (Rank 1)
 | 
			
		||||
        [1062]  = "root", -- Entangling Roots (Rank 2)
 | 
			
		||||
        [5195]  = "root", -- Entangling Roots (Rank 3)
 | 
			
		||||
        [5196]  = "root", -- Entangling Roots (Rank 4)
 | 
			
		||||
        [9852]  = "root", -- Entangling Roots (Rank 5)
 | 
			
		||||
        [9853]  = "root", -- Entangling Roots (Rank 6)
 | 
			
		||||
        [26989] = "root", -- Entangling Roots (Rank 7)
 | 
			
		||||
        [53308] = "root", -- Entangling Roots (Rank 8)
 | 
			
		||||
        [19975] = "root", -- Nature's Grasp (Rank 1)
 | 
			
		||||
        [19974] = "root", -- Nature's Grasp (Rank 2)
 | 
			
		||||
        [19973] = "root", -- Nature's Grasp (Rank 3)
 | 
			
		||||
        [19972] = "root", -- Nature's Grasp (Rank 4)
 | 
			
		||||
        [19971] = "root", -- Nature's Grasp (Rank 5)
 | 
			
		||||
        [19970] = "root", -- Nature's Grasp (Rank 6)
 | 
			
		||||
        [27010] = "root", -- Nature's Grasp (Rank 7)
 | 
			
		||||
        [53312] = "root", -- Nature's Grasp (Rank 8)
 | 
			
		||||
        [50245] = "root", -- Pin (Rank 1)
 | 
			
		||||
        [53544] = "root", -- Pin (Rank 2)
 | 
			
		||||
        [53545] = "root", -- Pin (Rank 3)
 | 
			
		||||
        [53546] = "root", -- Pin (Rank 4)
 | 
			
		||||
        [53547] = "root", -- Pin (Rank 5)
 | 
			
		||||
        [53548] = "root", -- Pin (Rank 6)
 | 
			
		||||
        [33395] = "root", -- Freeze (Water Elemental)
 | 
			
		||||
        [122]   = "root", -- Frost Nova (Rank 1)
 | 
			
		||||
        [865]   = "root", -- Frost Nova (Rank 2)
 | 
			
		||||
        [6131]  = "root", -- Frost Nova (Rank 3)
 | 
			
		||||
        [10230] = "root", -- Frost Nova (Rank 4)
 | 
			
		||||
        [27088] = "root", -- Frost Nova (Rank 5)
 | 
			
		||||
        [42917] = "root", -- Frost Nova (Rank 6)
 | 
			
		||||
        [39965] = "root", -- Frost Grenade (Item)
 | 
			
		||||
        [63685] = "root", -- Freeze (Frost Shock)
 | 
			
		||||
 | 
			
		||||
        [12494] = "random_root",         -- Frostbite
 | 
			
		||||
        [55080] = "random_root",         -- Shattered Barrier
 | 
			
		||||
        [58373] = "random_root",         -- Glyph of Hamstring
 | 
			
		||||
        [23694] = "random_root",         -- Improved Hamstring
 | 
			
		||||
        [47168] = "random_root",         -- Improved Wing Clip
 | 
			
		||||
        [19185] = "random_root",         -- Entrapment
 | 
			
		||||
 | 
			
		||||
        [53359] = "disarm", -- Chimera Shot (Scorpid)
 | 
			
		||||
        [50541] = "disarm", -- Snatch (Rank 1)
 | 
			
		||||
        [53537] = "disarm", -- Snatch (Rank 2)
 | 
			
		||||
        [53538] = "disarm", -- Snatch (Rank 3)
 | 
			
		||||
        [53540] = "disarm", -- Snatch (Rank 4)
 | 
			
		||||
        [53542] = "disarm", -- Snatch (Rank 5)
 | 
			
		||||
        [53543] = "disarm", -- Snatch (Rank 6)
 | 
			
		||||
        [64058] = "disarm", -- Psychic Horror Disarm Effect
 | 
			
		||||
        [51722] = "disarm", -- Dismantle
 | 
			
		||||
        [676]   = "disarm", -- Disarm
 | 
			
		||||
 | 
			
		||||
        [47476] = "silence", -- Strangulate
 | 
			
		||||
        [34490] = "silence", -- Silencing Shot
 | 
			
		||||
        [35334] = "silence", -- Nether Shock 1 -- TODO: verify
 | 
			
		||||
        [44957] = "silence", -- Nether Shock 2 -- TODO: verify
 | 
			
		||||
        [18469] = "silence", -- Silenced - Improved Counterspell (Rank 1)
 | 
			
		||||
        [55021] = "silence", -- Silenced - Improved Counterspell (Rank 2)
 | 
			
		||||
        [63529] = "silence", -- Silenced - Shield of the Templar
 | 
			
		||||
        [15487] = "silence", -- Silence
 | 
			
		||||
        [1330]  = "silence", -- Garrote - Silence
 | 
			
		||||
        [18425] = "silence", -- Silenced - Improved Kick
 | 
			
		||||
        [24259] = "silence", -- Spell Lock
 | 
			
		||||
        [43523] = "silence", -- Unstable Affliction 1
 | 
			
		||||
        [31117] = "silence", -- Unstable Affliction 2
 | 
			
		||||
        [18498] = "silence", -- Silenced - Gag Order 1
 | 
			
		||||
        [74347] = "silence", -- Silenced - Gag Order 1
 | 
			
		||||
        [50613] = "silence", -- Arcane Torrent (Racial, Runic Power)
 | 
			
		||||
        [28730] = "silence", -- Arcane Torrent (Racial, Mana)
 | 
			
		||||
        [25046] = "silence", -- Arcane Torrent (Racial, Energy)
 | 
			
		||||
 | 
			
		||||
        [64044] = "horror", -- Psychic Horror
 | 
			
		||||
        [6789]  = "horror", -- Death Coil (Rank 1)
 | 
			
		||||
        [17925] = "horror", -- Death Coil (Rank 2)
 | 
			
		||||
        [17926] = "horror", -- Death Coil (Rank 3)
 | 
			
		||||
        [27223] = "horror", -- Death Coil (Rank 4)
 | 
			
		||||
        [47859] = "horror", -- Death Coil (Rank 5)
 | 
			
		||||
        [47860] = "horror", -- Death Coil (Rank 6)
 | 
			
		||||
 | 
			
		||||
        [1833]  = "opener_stun", -- Cheap Shot
 | 
			
		||||
        [9005]  = "opener_stun", -- Pounce (Rank 1)
 | 
			
		||||
        [9823]  = "opener_stun", -- Pounce (Rank 2)
 | 
			
		||||
        [9827]  = "opener_stun", -- Pounce (Rank 3)
 | 
			
		||||
        [27006] = "opener_stun", -- Pounce (Rank 4)
 | 
			
		||||
        [49803] = "opener_stun", -- Pounce (Rank 5)
 | 
			
		||||
 | 
			
		||||
        [31661] = "scatter", -- Dragon's Breath (Rank 1)
 | 
			
		||||
        [33041] = "scatter", -- Dragon's Breath (Rank 2)
 | 
			
		||||
        [33042] = "scatter", -- Dragon's Breath (Rank 3)
 | 
			
		||||
        [33043] = "scatter", -- Dragon's Breath (Rank 4)
 | 
			
		||||
        [42949] = "scatter", -- Dragon's Breath (Rank 5)
 | 
			
		||||
        [42950] = "scatter", -- Dragon's Breath (Rank 6)
 | 
			
		||||
        [19503] = "scatter", -- Scatter Shot
 | 
			
		||||
 | 
			
		||||
        -- Spells that DR with itself only
 | 
			
		||||
        [33786] = "cyclone",        -- Cyclone
 | 
			
		||||
        [605]   = "mind_control",   -- Mind Control
 | 
			
		||||
        [13181] = "mind_control",   -- Gnomish Mind Control Cap
 | 
			
		||||
        [7922]  = "charge",         -- Charge Stun
 | 
			
		||||
        [19306] = "counterattack",  -- Counterattack 1
 | 
			
		||||
        [20909] = "counterattack",  -- Counterattack 2
 | 
			
		||||
        [20910] = "counterattack",  -- Counterattack 3
 | 
			
		||||
        [27067] = "counterattack",  -- Counterattack 4
 | 
			
		||||
        [48998] = "counterattack",  -- Counterattack 5
 | 
			
		||||
        [48999] = "counterattack",  -- Counterattack 6
 | 
			
		||||
        --Storm, Earth and Fire has no DR
 | 
			
		||||
 | 
			
		||||
        -- TODO: profession stuff
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
elseif Lib.gameExpansion == "classic" then
 | 
			
		||||
 | 
			
		||||
    -- SpellID list for Classic Era (vanilla)
 | 
			
		||||
    -- In Classic the spell ID payload is gone from the combat log, so we need the key here to be
 | 
			
		||||
    -- spell name instead. We also provide spell ID in the table value so it's possible to retrieve
 | 
			
		||||
    -- for example spell icon using GetSpellTexture(spellID) later on. (These functions only accept
 | 
			
		||||
    -- spell names if the player has the spell in their spell book)
 | 
			
		||||
    local GetSpellInfo = _G.GetSpellInfo -- upvalue
 | 
			
		||||
    Lib.spellList = {
 | 
			
		||||
        -- Controlled roots
 | 
			
		||||
        [GetSpellInfo(339)]     = { category = "root", spellID = 339 },      -- Entangling Roots
 | 
			
		||||
        [GetSpellInfo(19306)]   = { category = "root", spellID = 19306 },    -- Counterattack
 | 
			
		||||
        [GetSpellInfo(122)]     = { category = "root", spellID = 122 },      -- Frost Nova
 | 
			
		||||
    --  [GetSpellInfo(13099)]   = { category = "root", spellID = 13099 },    -- Net-o-Matic
 | 
			
		||||
    --  [GetSpellInfo(8312)]    = { category = "root", spellID = 8312 },     -- Trap
 | 
			
		||||
 | 
			
		||||
        -- Controlled stuns
 | 
			
		||||
        [GetSpellInfo(5211)]    = { category = "stun", spellID = 5211 },     -- Bash
 | 
			
		||||
        [GetSpellInfo(24394)]   = { category = "stun", spellID = 24394 },    -- Intimidation
 | 
			
		||||
        [GetSpellInfo(853)]     = { category = "stun", spellID = 853 },      -- Hammer of Justice
 | 
			
		||||
        [GetSpellInfo(9005)]    = { category = "stun", spellID = 9005 },     -- Pounce
 | 
			
		||||
        [GetSpellInfo(1833)]    = { category = "stun", spellID = 1833 },     -- Cheap Shot
 | 
			
		||||
        [GetSpellInfo(12809)]   = { category = "stun", spellID = 12809 },    -- Concussion Blow
 | 
			
		||||
        [GetSpellInfo(20253)]   = { category = "stun", spellID = 20253 },    -- Intercept Stun
 | 
			
		||||
        [GetSpellInfo(7922)]    = { category = "stun", spellID = 7922 },     -- Charge Stun
 | 
			
		||||
        [GetSpellInfo(20549)]   = { category = "stun", spellID = 20549 },    -- War Stomp (Racial)
 | 
			
		||||
        [GetSpellInfo(4068)]    = { category = "stun", spellID = 4068 },     -- Iron Grenade
 | 
			
		||||
        [GetSpellInfo(19769)]   = { category = "stun", spellID = 19769 },    -- Thorium Grenade
 | 
			
		||||
        [GetSpellInfo(13808)]   = { category = "stun", spellID = 13808 },    -- M73 Frag Grenade
 | 
			
		||||
        [GetSpellInfo(4069)]    = { category = "stun", spellID = 4069 },     -- Big Iron Bomb
 | 
			
		||||
        [GetSpellInfo(12543)]   = { category = "stun", spellID = 12543 },    -- Hi-Explosive Bomb
 | 
			
		||||
        [GetSpellInfo(4064)]    = { category = "stun", spellID = 4064 },     -- Rough Copper Bomb
 | 
			
		||||
        [GetSpellInfo(12421)]   = { category = "stun", spellID = 12421 },    -- Mithril Frag Bomb
 | 
			
		||||
        [GetSpellInfo(19784)]   = { category = "stun", spellID = 19784 },    -- Dark Iron Bomb
 | 
			
		||||
        [GetSpellInfo(4067)]    = { category = "stun", spellID = 4067 },     -- Big Bronze Bomb
 | 
			
		||||
        [GetSpellInfo(4066)]    = { category = "stun", spellID = 4066 },     -- Small Bronze Bomb
 | 
			
		||||
        [GetSpellInfo(4065)]    = { category = "stun", spellID = 4065 },     -- Large Copper Bomb
 | 
			
		||||
        [GetSpellInfo(13237)]   = { category = "stun", spellID = 13237 },    -- Goblin Mortar
 | 
			
		||||
        [GetSpellInfo(835)]     = { category = "stun", spellID = 835 },      -- Tidal Charm
 | 
			
		||||
        [GetSpellInfo(12562)]   = { category = "stun", spellID = 12562 },    -- The Big One
 | 
			
		||||
 | 
			
		||||
        -- Incapacitates
 | 
			
		||||
        [GetSpellInfo(2637)]    = { category = "incapacitate", spellID = 2637 },    -- Hibernate
 | 
			
		||||
        [GetSpellInfo(3355)]    = { category = "incapacitate", spellID = 3355 },    -- Freezing Trap
 | 
			
		||||
        [GetSpellInfo(19503)]   = { category = "incapacitate", spellID = 19503 },   -- Scatter Shot
 | 
			
		||||
        [GetSpellInfo(19386)]   = { category = "incapacitate", spellID = 19386 },   -- Wyvern Sting
 | 
			
		||||
        [GetSpellInfo(28271)]   = { category = "incapacitate", spellID = 28271 },   -- Polymorph: Turtle
 | 
			
		||||
        [GetSpellInfo(28272)]   = { category = "incapacitate", spellID = 28272 },   -- Polymorph: Pig
 | 
			
		||||
        [GetSpellInfo(118)]     = { category = "incapacitate", spellID = 118 },     -- Polymorph
 | 
			
		||||
        [GetSpellInfo(20066)]   = { category = "incapacitate", spellID = 20066 },   -- Repentance
 | 
			
		||||
        [GetSpellInfo(1776)]    = { category = "incapacitate", spellID = 1776 },    -- Gouge
 | 
			
		||||
        [GetSpellInfo(6770)]    = { category = "incapacitate", spellID = 6770 },    -- Sap
 | 
			
		||||
        [GetSpellInfo(1090)]    = { category = "incapacitate", spellID = 1090 },    -- Sleep
 | 
			
		||||
        [GetSpellInfo(13327)]   = { category = "incapacitate", spellID = 13327 },   -- Reckless Charge (Rocket Helmet)
 | 
			
		||||
        [GetSpellInfo(26108)]   = { category = "incapacitate", spellID = 26108 },   -- Glimpse of Madness
 | 
			
		||||
 | 
			
		||||
        -- Fears
 | 
			
		||||
        [GetSpellInfo(1513)]    = { category = "fear", spellID = 1513 },          -- Scare Beast
 | 
			
		||||
        [GetSpellInfo(8122)]    = { category = "fear", spellID = 8122 },          -- Psychic Scream
 | 
			
		||||
        [GetSpellInfo(5782)]    = { category = "fear", spellID = 5782 },          -- Fear
 | 
			
		||||
        [GetSpellInfo(5484)]    = { category = "fear", spellID = 5484 },          -- Howl of Terror
 | 
			
		||||
        [GetSpellInfo(6358)]    = { category = "fear", spellID = 6358 },          -- Seduction
 | 
			
		||||
        [GetSpellInfo(5246)]    = { category = "fear", spellID = 5246 },          -- Intimidating Shout
 | 
			
		||||
        [GetSpellInfo(5134)]    = { category = "fear", spellID = 5134 },          -- Flash Bomb Fear
 | 
			
		||||
 | 
			
		||||
        -- Random/short roots
 | 
			
		||||
        [GetSpellInfo(19229)]   = { category = "random_root", spellID = 19229 },   -- Improved Wing Clip
 | 
			
		||||
--      [GetSpellInfo(27868)]   = { category = "random_root", spellID = 12494 },   -- Frostbite
 | 
			
		||||
        [GetSpellInfo(23694)]   = { category = "random_root", spellID = 23694 },   -- Improved Hamstring
 | 
			
		||||
        [GetSpellInfo(27868)]   = { category = "random_root", spellID = 27868 },   -- Freeze (Item proc and set bonus)
 | 
			
		||||
 | 
			
		||||
        -- Random/short stuns
 | 
			
		||||
        [GetSpellInfo(16922)]   = { category = "random_stun", spellID = 16922 },   -- Improved Starfire
 | 
			
		||||
        [GetSpellInfo(19410)]   = { category = "random_stun", spellID = 19410 },   -- Improved Concussive Shot
 | 
			
		||||
        [GetSpellInfo(12355)]   = { category = "random_stun", spellID = 12355 },   -- Impact
 | 
			
		||||
        [GetSpellInfo(20170)]   = { category = "random_stun", spellID = 20170 },   -- Seal of Justice Stun
 | 
			
		||||
        [GetSpellInfo(15269)]   = { category = "random_stun", spellID = 15269 },   -- Blackout
 | 
			
		||||
        [GetSpellInfo(18093)]   = { category = "random_stun", spellID = 18093 },   -- Pyroclasm
 | 
			
		||||
        [GetSpellInfo(12798)]   = { category = "random_stun", spellID = 12798 },   -- Revenge Stun
 | 
			
		||||
        [GetSpellInfo(5530)]    = { category = "random_stun", spellID = 5530 },    -- Mace Stun Effect (Mace Specialization)
 | 
			
		||||
        [GetSpellInfo(15283)]   = { category = "random_stun", spellID = 15283 },   -- Stunning Blow (Weapon Proc)
 | 
			
		||||
        [GetSpellInfo(56)]      = { category = "random_stun", spellID = 56 },      -- Stun (Weapon Proc)
 | 
			
		||||
        [GetSpellInfo(21152)]   = { category = "random_stun", spellID = 21152 },   -- Earthshaker (Weapon Proc)
 | 
			
		||||
 | 
			
		||||
        -- Spells that DRs with itself only
 | 
			
		||||
        [GetSpellInfo(408)]     = { category = "kidney_shot", spellID = 408 },     -- Kidney Shot
 | 
			
		||||
        [GetSpellInfo(605)]     = { category = "mind_control", spellID = 605 },    -- Mind Control
 | 
			
		||||
        [GetSpellInfo(13181)]   = { category = "mind_control", spellID = 13181 },  -- Gnomish Mind Control Cap
 | 
			
		||||
        [GetSpellInfo(8056)]    = { category = "frost_shock", spellID = 8056 },    -- Frost Shock
 | 
			
		||||
    }
 | 
			
		||||
else
 | 
			
		||||
    print("DRList-1.0: Unsupported game expansion loaded.") -- luacheck: ignore
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
-- Alias for DRData-1.0
 | 
			
		||||
Lib.spells = Lib.spellList
 | 
			
		||||
@@ -6,24 +6,23 @@ local Buff = LibClassAuras.Buff
 | 
			
		||||
-------------
 | 
			
		||||
-- PRIEST
 | 
			
		||||
-------------
 | 
			
		||||
Buff({ 1243, 1244, 1245, 2791, 10937, 10938, 25389 }, { buffType = "magic" }, "PRIEST") -- Power Word: Fortitude
 | 
			
		||||
Buff({ 21562, 21564, 25392 }, { buffType = "magic" }, "PRIEST") -- Prayer of Fortitude
 | 
			
		||||
Buff({ 17, 592, 600, 3747, 6065, 6066, 10898, 10899, 10900, 10901, 25217, 25218 }, { buffType = "magic" }, "PRIEST") -- Power Word: Shield
 | 
			
		||||
Buff({ 588, 7128, 602, 1006, 10951, 10952, 25431 }, { buffType = "magic" }, "PRIEST") -- Inner Fire
 | 
			
		||||
Buff({ 1243, 1244, 1245, 2791, 10937, 10938, 25389, 48161 }, { buffType = "magic" }, "PRIEST") -- Power Word: Fortitude
 | 
			
		||||
Buff({ 21562, 21564, 25392, 48162 }, { buffType = "magic" }, "PRIEST") -- Prayer of Fortitude
 | 
			
		||||
Buff({ 17, 592, 600, 3747, 6065, 6066, 10898, 10899, 10900, 10901, 25217, 25218, 48065, 48066 }, { buffType = "magic" }, "PRIEST") -- Power Word: Shield
 | 
			
		||||
Buff({ 588, 7128, 602, 1006, 10951, 10952, 25431, 48040, 48168 }, { buffType = "magic" }, "PRIEST") -- Inner Fire
 | 
			
		||||
Buff({ 2651 }, { buffType = "magic" }, "PRIEST") -- Elune's Grace
 | 
			
		||||
Buff({ 6346 }, { buffType = "magic" }, "PRIEST") -- Fear Ward
 | 
			
		||||
Buff({ 14752, 14818, 14819, 27841, 25312 }, { buffType = "magic" }, "PRIEST") -- Divine Spirit
 | 
			
		||||
Buff({ 27681, 32999 }, { buffType = "magic" }, "PRIEST") -- Prayer of Spirit
 | 
			
		||||
Buff({ 14752, 14818, 14819, 27841, 25312, 48073 }, { buffType = "magic" }, "PRIEST") -- Divine Spirit
 | 
			
		||||
Buff({ 27681, 32999, 48074 }, { buffType = "magic" }, "PRIEST") -- Prayer of Spirit
 | 
			
		||||
Buff({ 1706 }, { buffType = "magic" }, "PRIEST") -- Levitate
 | 
			
		||||
Buff({ 139, 6074, 6075, 6076, 6077, 6078, 10927, 10928, 10929, 25315, 25221, 25222 }, { buffType = "magic" }, "PRIEST") -- Renew
 | 
			
		||||
Buff({ 139, 6074, 6075, 6076, 6077, 6078, 10927, 10928, 10929, 25315, 25221, 25222, 48067, 48068 }, { buffType = "magic" }, "PRIEST") -- Renew
 | 
			
		||||
Buff({ 552 }, { buffType = "magic" }, "PRIEST") -- Abolish Disease
 | 
			
		||||
Buff({ 33076 }, { buffType = "magic" }, "PRIEST") -- Prayer of Mending
 | 
			
		||||
Buff({ 33076, 48112, 48113 }, { buffType = "magic" }, "PRIEST") -- Prayer of Mending
 | 
			
		||||
Buff({ 586, 9578, 9579, 9592, 10941, 10942, 25429 }, { buffType = "magic" }, "PRIEST") -- Fade
 | 
			
		||||
Buff({ 2652, 19261, 19262, 19264, 19265, 19266, 25461 }, { buffType = "magic" }, "PRIEST") -- Touch of Weakness
 | 
			
		||||
Buff({ 18137, 19308, 19310, 19311, 19312, 25477 }, { buffType = "magic" }, "PRIEST") -- Shadowguard
 | 
			
		||||
Buff({ 976, 10957, 10958, 16874, 25433 }, { buffType = "magic" }, "PRIEST") -- Shadow Protection
 | 
			
		||||
Buff({ 27683, 39374 }, { buffType = "magic" }, "PRIEST") -- Prayer of Shadow Protection
 | 
			
		||||
Buff({ 15473 }, { buffType = "form" }, "PRIEST") -- Shadowform
 | 
			
		||||
--talents
 | 
			
		||||
Buff({ 14893, 15357, 15359 }, { buffType = "magic" }, "PRIEST") -- Inspiration
 | 
			
		||||
Buff({ 27813, 27817, 27818 }, { buffType = "magic" }, "PRIEST") -- Blessed Recovery
 | 
			
		||||
@@ -32,51 +31,74 @@ Buff({ 14751 }, { buffType = "magic" }, "PRIEST") -- Inner Focus
 | 
			
		||||
Buff({ 10060 }, { buffType = "magic" }, "PRIEST") -- Power Infusion
 | 
			
		||||
Buff({ 33206 }, { buffType = "magic" }, "PRIEST") -- Pain Suppression
 | 
			
		||||
Buff({ 34754 }, { buffType = "magic" }, "PRIEST") -- Clearcasting
 | 
			
		||||
Buff({ 15473 }, { buffType = "form" }, "PRIEST") -- Shadowform
 | 
			
		||||
Buff({ 47788 }, { buffType = "magic" }, "PRIEST") -- Guardian's Spirit
 | 
			
		||||
Buff({ 47585 }, { buffType = "magic" }, "PRIEST") -- Dispersion
 | 
			
		||||
Buff({ 65081 }, { buffType = "magic" }, "PRIEST") -- Body and Soul
 | 
			
		||||
Buff({ 33151 }, { buffType = "magic" }, "PRIEST") -- Surge of Light
 | 
			
		||||
Buff({ 47753 }, { buffType = "magic" }, "PRIEST") -- Divine Aegis
 | 
			
		||||
Buff({ 47930 }, { buffType = "magic" }, "PRIEST") -- Grace
 | 
			
		||||
Buff({ 63734 }, { buffType = "magic" }, "PRIEST") -- Serendipity
 | 
			
		||||
 | 
			
		||||
---------------
 | 
			
		||||
-- DRUID
 | 
			
		||||
---------------
 | 
			
		||||
Buff({ 467, 782, 1075, 8914, 9756, 9910, 26992 }, { buffType = "magic"}, "DRUID") -- Thorns
 | 
			
		||||
Buff({ 467, 782, 1075, 8914, 9756, 9910, 26992, 53307 }, { buffType = "magic"}, "DRUID") -- Thorns
 | 
			
		||||
Buff({ 5487 }, { buffType = "form"}, "DRUID") -- Bear Form
 | 
			
		||||
Buff({ 783 }, { buffType = "form"}, "DRUID") -- Travel Form
 | 
			
		||||
Buff({ 9634 }, { buffType = "form"}, "DRUID") -- Dire Bear Form
 | 
			
		||||
Buff({ 768 }, { buffType = "form"}, "DRUID") -- Cat Form
 | 
			
		||||
Buff({ 22812 }, { buffType = "magic"}, "DRUID") -- Barkskin
 | 
			
		||||
Buff({ 5229 }, { buffType = "physical"}, "DRUID") -- Enrage
 | 
			
		||||
Buff({ 5217, 6793, 9845, 9846 }, { buffType = "physical"}, "DRUID") -- Tiger's Fury
 | 
			
		||||
Buff({ 5229 }, { buffType = "enrage"}, "DRUID") -- Enrage
 | 
			
		||||
Buff({ 5217, 6793, 9845, 9846, 50212, 50213 }, { buffType = "physical"}, "DRUID") -- Tiger's Fury
 | 
			
		||||
Buff({ 1850, 9821, 33357 }, { buffType = "physical"}, "DRUID") -- Dash
 | 
			
		||||
Buff({ 22842, 22895, 22896, 26999 }, { buffType = "physical"}, "DRUID") -- Frenzied Regeneration
 | 
			
		||||
Buff({ 1126, 5232, 6756, 5234, 8907, 9884, 9885, 26990 }, { buffType = "magic"}, "DRUID") -- Mark of the Wild
 | 
			
		||||
Buff({ 21849, 21850, 26991 }, { buffType = "magic"}, "DRUID") -- Gift of the Wild
 | 
			
		||||
Buff({ 774, 1058, 1430, 2090, 2091, 3627, 8910, 9839, 9840, 9841, 25299, 26981, 26982 }, { buffType = "magic"}, "DRUID") -- Regrowth
 | 
			
		||||
Buff({ 8936, 8938, 8939, 8940, 8941, 9750, 9856, 9857, 9858, 26980 }, { buffType = "magic"}, "DRUID") -- Rejuvenation
 | 
			
		||||
Buff({ 22842 }, { buffType = "physical"}, "DRUID") -- Frenzied Regeneration
 | 
			
		||||
Buff({ 1126, 5232, 6756, 5234, 8907, 9884, 9885, 26990, 48469 }, { buffType = "magic"}, "DRUID") -- Mark of the Wild
 | 
			
		||||
Buff({ 21849, 21850, 26991, 48470 }, { buffType = "magic"}, "DRUID") -- Gift of the Wild
 | 
			
		||||
Buff({ 774, 1058, 1430, 2090, 2091, 3627, 8910, 9839, 9840, 9841, 25299, 26981, 26982, 48442, 48443 }, { buffType = "magic"}, "DRUID") -- Regrowth
 | 
			
		||||
Buff({ 8936, 8938, 8939, 8940, 8941, 9750, 9856, 9857, 9858, 26980, 48440, 48441 }, { buffType = "magic"}, "DRUID") -- Rejuvenation
 | 
			
		||||
Buff({ 2893 }, { buffType = "magic"}, "DRUID") -- Abolish Poison
 | 
			
		||||
Buff({ 33763 }, { buffType = "magic"}, "DRUID") -- Lifebloom
 | 
			
		||||
Buff({ 33763, 48450, 48451}, { buffType = "magic"}, "DRUID") -- Lifebloom
 | 
			
		||||
--Talents
 | 
			
		||||
Buff({ 24858 }, { buffType = "form"}, "DRUID") -- Moonkin Form
 | 
			
		||||
Buff({ 24907 }, { buffType = "aura"}, "DRUID") -- Moonkin Aura
 | 
			
		||||
Buff({ 33891 }, { buffType = "form"}, "DRUID") -- Tree of Life
 | 
			
		||||
Buff({ 16864 }, { buffType = "magic"}, "DRUID") -- Omen of Clarity
 | 
			
		||||
Buff({ 16689, 16810, 16811, 16812, 16813, 17329, 27009 }, { buffType = "magic"}, "DRUID") -- Nature's Grasp
 | 
			
		||||
Buff({ 16864, 16870 }, { buffType = "magic"}, "DRUID") -- Omen of Clarity
 | 
			
		||||
Buff({ 16689, 16810, 16811, 16812, 16813, 17329, 27009, 53312 }, { buffType = "magic"}, "DRUID") -- Nature's Grasp
 | 
			
		||||
Buff({ 45281, 45282, 45283 }, { buffType = "magic"}, "DRUID") -- Natural Perfection
 | 
			
		||||
Buff({ 17116 }, { buffType = "magic"}, "DRUID") -- Nature's Swiftness
 | 
			
		||||
Buff({ 17007 }, { buffType = "aura"}, "DRUID") -- Leader of the Pack
 | 
			
		||||
Buff({ 48518 }, { buffType = "physical"}, "DRUID") -- Eclipse (Lunar)
 | 
			
		||||
Buff({ 48517 }, { buffType = "physical"}, "DRUID") -- Eclipse (Solar)
 | 
			
		||||
Buff({ 16886 }, { buffType = "magic"}, "DRUID") -- Nature's Grace
 | 
			
		||||
Buff({ 48503, 48504 }, { buffType = "magic"}, "DRUID") -- Living Seed
 | 
			
		||||
Buff({ 50334 }, { buffType = "physical"}, "DRUID") -- Berserk
 | 
			
		||||
Buff({ 52610, 62071 }, { buffType = "enrage"}, "DRUID") -- Savage Roar
 | 
			
		||||
Buff({ 48391 }, { buffType = "enrage"}, "DRUID") -- Owlkin Frenzy
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
-------------
 | 
			
		||||
-- WARRIOR -- TODO
 | 
			
		||||
-------------
 | 
			
		||||
Buff({ 29838 }, { buffType = "physical"}, "WARRIOR") -- Second Wind
 | 
			
		||||
Buff({ 12292 }, { buffType = "physical"}, "WARRIOR") -- Death Wish
 | 
			
		||||
Buff({ 12292 }, { buffType = "enrage"}, "WARRIOR") -- Death Wish
 | 
			
		||||
Buff({ 6673 }, { buffType = "physical"}, "WARRIOR") -- Battle Shout
 | 
			
		||||
Buff({ 469 }, { buffType = "physical"}, "WARRIOR") -- Commanding Shout
 | 
			
		||||
Buff({ 12328 }, { buffType = "physical"}, "WARRIOR") -- Sweeping Strikes
 | 
			
		||||
Buff({ 30032 }, { buffType = "physical"}, "WARRIOR") -- Rampage
 | 
			
		||||
Buff({ 2687 }, { buffType = "physical"}, "WARRIOR") -- Blood Rage
 | 
			
		||||
Buff({ 29801, 30032 }, { buffType = "aura"}, "WARRIOR") -- Rampage
 | 
			
		||||
Buff({ 2687 }, { buffType = "enrage"}, "WARRIOR") -- Blood Rage
 | 
			
		||||
Buff({ 20230 }, { buffType = "physical"}, "WARRIOR") -- Retaliation
 | 
			
		||||
Buff({ 871 }, { buffType = "physical"}, "WARRIOR") -- Shield Wall
 | 
			
		||||
Buff({ 18499 }, { buffType = "physical"}, "WARRIOR") -- Berserker Rage
 | 
			
		||||
Buff({ 23885 }, { buffType = "physical"}, "WARRIOR") -- Bloodthirst
 | 
			
		||||
Buff({ 18499 }, { buffType = "enrage"}, "WARRIOR") -- Berserker Rage
 | 
			
		||||
Buff({ 23885 }, { buffType = "enrage"}, "WARRIOR") -- Bloodthirst
 | 
			
		||||
Buff({ 3411 }, { buffType = "physical"}, "WARRIOR") -- Intervene
 | 
			
		||||
Buff({ 50622 }, { buffType = "physical"}, "WARRIOR") -- Bladestorm (whirlwind)
 | 
			
		||||
Buff({ 52437 }, { buffType = "physical"}, "WARRIOR") -- Sudden Death
 | 
			
		||||
Buff({ 57522 }, { buffType = "physical"}, "WARRIOR") -- Wrecking Crew
 | 
			
		||||
Buff({ 46916 }, { buffType = "physical"}, "WARRIOR") -- Slam!
 | 
			
		||||
Buff({ 50720 }, { buffType = "physical"}, "WARRIOR") -- Vigilance
 | 
			
		||||
Buff({ 55694 }, { buffType = "enrage"}, "WARRIOR") -- Enraged Regeneration
 | 
			
		||||
Buff({ 1719 }, { buffType = "enrage"}, "WARRIOR") -- Recklessness
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
--------------
 | 
			
		||||
@@ -87,24 +109,35 @@ Buff({ 2983 }, { buffType = "physical" }, "ROGUE") -- Sprint
 | 
			
		||||
Buff({ 5277 }, { buffType = "physical" }, "ROGUE") -- Evasion
 | 
			
		||||
Buff({ 31224 }, { buffType = "physical" }, "ROGUE") -- Cloak of Shadows
 | 
			
		||||
Buff({ 14278 }, { buffType = "physical" }, "ROGUE") -- Ghostly Strike
 | 
			
		||||
Buff({ 51713 }, { buffType = "physical" }, "ROGUE") -- Shadow Dance
 | 
			
		||||
Buff({ 31665 }, { buffType = "physical" }, "ROGUE") -- Master of Subtlety
 | 
			
		||||
Buff({ 51690 }, { buffType = "physical" }, "ROGUE") -- Killing Spree
 | 
			
		||||
Buff({ 63848 }, { buffType = "enrage" }, "ROGUE") -- Hunger For Blood
 | 
			
		||||
Buff({ 57934 }, { buffType = "physical" }, "ROGUE") -- Tricks of the Trade
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
------------
 | 
			
		||||
-- WARLOCK --TODO
 | 
			
		||||
------------
 | 
			
		||||
Buff({ 19028 }, { buffType = "aura"}, "WARLOCK") -- Soul Link
 | 
			
		||||
Buff({ 696 }, { buffType = "aura"}, "WARLOCK") -- Demon Skin
 | 
			
		||||
Buff({ 706 }, { buffType = "aura"}, "WARLOCK") -- Demon Armor
 | 
			
		||||
Buff({ 28176 }, { buffType = "aura"}, "WARLOCK") -- Fel Armor
 | 
			
		||||
Buff({ 687, 696 }, { buffType = "aura"}, "WARLOCK") -- Demon Skin
 | 
			
		||||
Buff({ 706, 1086, 11733, 11734, 11735, 27260, 47793, 47889 }, { buffType = "aura"}, "WARLOCK") -- Demon Armor
 | 
			
		||||
Buff({ 28176, 28189, 47892, 47893 }, { buffType = "aura"}, "WARLOCK") -- Fel Armor
 | 
			
		||||
Buff({ 23759 }, { buffType = "aura"}, "WARLOCK") -- Master Demonologist
 | 
			
		||||
Buff({ 34936 }, { buffType = "magic"}, "WARLOCK") -- Backlash
 | 
			
		||||
Buff({ 5697 }, { buffType = "magic"}, "WARLOCK") -- Unending Breath
 | 
			
		||||
Buff({ 132 }, { buffType = "magic"}, "WARLOCK") -- Detect Invisibility
 | 
			
		||||
Buff({ 1949 }, { buffType = "aura"}, "WARLOCK") -- Hellfire
 | 
			
		||||
Buff({ 6229 }, { buffType = "magic"}, "WARLOCK") -- Shadow Ward
 | 
			
		||||
Buff({ 19480 }, { buffType = "magic"}, "WARLOCK") -- Paranoia
 | 
			
		||||
Buff({ 7812 }, { buffType = "magic"}, "WARLOCK") -- Sacrifice
 | 
			
		||||
Buff({ 2947 }, { buffType = "magic"}, "WARLOCK") -- Fire Shield
 | 
			
		||||
Buff({ 1949, 11683, 11684, 27213, 47823 }, { buffType = "aura"}, "WARLOCK") -- Hellfire
 | 
			
		||||
Buff({ 6229, 11739, 11740, 28610, 47890, 47891 }, { buffType = "magic"}, "WARLOCK") -- Shadow Ward
 | 
			
		||||
Buff({ 19480, 20435, 41002 }, { buffType = "aura"}, "WARLOCK") -- Paranoia
 | 
			
		||||
Buff({ 7812, 19438, 19440, 19441, 19442, 19443, 27273, 47985, 47986 }, { buffType = "magic"}, "WARLOCK") -- Sacrifice
 | 
			
		||||
Buff({ 2947, 8316, 8317, 11770, 11771, 27269, 47983 }, { buffType = "magic"}, "WARLOCK") -- Fire Shield
 | 
			
		||||
Buff({ 48018 }, { buffType = "magic"}, "WARLOCK") -- Demonic Circle: Summon
 | 
			
		||||
Buff({ 59672 }, { buffType = "physical"}, "WARLOCK") -- Metamorphosis
 | 
			
		||||
Buff({ 54277 }, { buffType = "physical"}, "WARLOCK") -- Backdraft
 | 
			
		||||
Buff({ 47283 }, { buffType = "magic"}, "WARLOCK") -- Empowered Imp
 | 
			
		||||
Buff({ 64371 }, { buffType = "magic"}, "WARLOCK") -- Eradication
 | 
			
		||||
Buff({ 18093, 63243, 63244 } ,{ buffType = "physical" }, "WARLOCK") -- Pyroclasm
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
---------------
 | 
			
		||||
@@ -115,35 +148,43 @@ Buff({ 8178 } ,{ buffType = "magic" }, "SHAMAN") -- Grounding Totem Effect
 | 
			
		||||
Buff({ 30823 } ,{ buffType = "magic" }, "SHAMAN") -- Shamanistic Rage
 | 
			
		||||
Buff({ 32182 } ,{ buffType = "magic" }, "SHAMAN") -- Heroism
 | 
			
		||||
Buff({ 2825 } ,{ buffType = "magic" }, "SHAMAN") -- Bloodlust
 | 
			
		||||
Buff({ 974 } ,{ buffType = "magic" }, "SHAMAN") -- Earth Shield
 | 
			
		||||
Buff({ 24398 } ,{ buffType = "magic" }, "SHAMAN") -- Water Shield
 | 
			
		||||
Buff({ 324 } ,{ buffType = "magic" }, "SHAMAN") -- Lightning Shield
 | 
			
		||||
Buff({ 974, 32593, 32594, 49283, 49284 } ,{ buffType = "magic" }, "SHAMAN") -- Earth Shield
 | 
			
		||||
Buff({ 24398, 33736, 57960 } ,{ buffType = "magic" }, "SHAMAN") -- Water Shield
 | 
			
		||||
Buff({ 324, 25472, 49280, 49281 } ,{ buffType = "magic" }, "SHAMAN") -- Lightning Shield
 | 
			
		||||
Buff({ 16188 } ,{ buffType = "magic" }, "SHAMAN") -- Nature's Swiftness
 | 
			
		||||
Buff({ 16166 } ,{ buffType = "magic" }, "SHAMAN") -- Elemental Mastery
 | 
			
		||||
Buff({ 51470 } ,{ buffType = "aura" }, "SHAMAN") -- Elemental Oath
 | 
			
		||||
Buff({ 30809 } ,{ buffType = "aura" }, "SHAMAN") -- Unleashed Rage
 | 
			
		||||
Buff({ 52179 } ,{ buffType = "magic" }, "SHAMAN") -- Astral Shift
 | 
			
		||||
Buff({ 61295, 61299, 61300, 61301 } ,{ buffType = "magic" }, "SHAMAN") -- Riptide
 | 
			
		||||
Buff({ 53390 } ,{ buffType = "magic" }, "SHAMAN") -- Tidal Waves
 | 
			
		||||
Buff({ 52000, 51999, 51998, 51997, 51990, 51945 } ,{ buffType = "magic" }, "SHAMAN") -- Earthliving proc
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
--------------
 | 
			
		||||
-- PALADIN --TODO
 | 
			
		||||
--------------
 | 
			
		||||
--Blessings
 | 
			
		||||
Buff( { 1022, 5599, 10278 }, { buffType = "magic"}, "PALADIN") -- Blessing of Protection
 | 
			
		||||
Buff( { 6940 }, { buffType = "magic"}, "PALADIN") -- Blessing of Sacrifice
 | 
			
		||||
Buff( { 1044 }, { buffType = "magic"}, "PALADIN") -- Blessing of Freedom
 | 
			
		||||
Buff( { 19740, 19834, 19835, 19836, 19837, 19838, 25291, 27140 }, { buffType = "magic"}, "PALADIN") -- Blessing of Might
 | 
			
		||||
Buff( { 19742 }, { buffType = "magic"}, "PALADIN") -- Blessing of Wisdom
 | 
			
		||||
Buff( { 1022, 5599, 10278 }, { buffType = "magic"}, "PALADIN") -- Blessing/Hand of Protection
 | 
			
		||||
Buff( { 6940 }, { buffType = "magic"}, "PALADIN") -- Blessing/Hand of Sacrifice
 | 
			
		||||
Buff( { 1044, 66115 }, { buffType = "magic"}, "PALADIN") -- Blessing/Hand of Freedom
 | 
			
		||||
Buff( { 19740, 19834, 19835, 19836, 19837, 19838, 25291, 27140, 48931, 48932 }, { buffType = "magic"}, "PALADIN") -- Blessing of Might
 | 
			
		||||
Buff( { 19742, 19850, 19852, 19853, 19854, 25290, 27142, 48935, 48936 }, { buffType = "magic"}, "PALADIN") -- Blessing of Wisdom
 | 
			
		||||
Buff( { 20217 }, { buffType = "magic"}, "PALADIN") -- Blessing of Kings
 | 
			
		||||
Buff( { 19977 }, { buffType = "magic"}, "PALADIN") -- Blessing of Light
 | 
			
		||||
Buff( { 1038 }, { buffType = "magic"}, "PALADIN") -- Blessing of Salvation
 | 
			
		||||
Buff( { 1038 }, { buffType = "magic"}, "PALADIN") -- Blessing/Hand of Salvation
 | 
			
		||||
Buff( { 20911 }, { buffType = "magic"}, "PALADIN") -- Blessing of Sanctuary
 | 
			
		||||
Buff( { 25898 }, { buffType = "magic"}, "PALADIN") -- Greater Blessing of Kings
 | 
			
		||||
Buff( { 25890 }, { buffType = "magic"}, "PALADIN") -- Greater Blessing of Light
 | 
			
		||||
Buff( { 25782 }, { buffType = "magic"}, "PALADIN") -- Greater Blessing of Might
 | 
			
		||||
Buff( { 25895 }, { buffType = "magic"}, "PALADIN") -- Greater Blessing of Salvation
 | 
			
		||||
Buff( { 25782, 27141, 48933, 48934 }, { buffType = "magic"}, "PALADIN") -- Greater Blessing of Might
 | 
			
		||||
Buff( { 25895  }, { buffType = "magic"}, "PALADIN") -- Greater Blessing of Salvation
 | 
			
		||||
Buff( { 25899 }, { buffType = "magic"}, "PALADIN") -- Greater Blessing of Sanctuary
 | 
			
		||||
Buff( { 25894 }, { buffType = "magic"}, "PALADIN") -- Greater Blessing of Wisdom
 | 
			
		||||
Buff( { 25894, 48937 }, { buffType = "magic"}, "PALADIN") -- Greater Blessing of Wisdom
 | 
			
		||||
Buff( { 642 }, { buffType = "immune"}, "PALADIN") -- Divine Shield
 | 
			
		||||
Buff( { 31884 }, { buffType = "magic"}, "PALADIN") -- Avenging Wrath
 | 
			
		||||
--Auras
 | 
			
		||||
Buff( { 465, 10290, 643, 10291, 1032, 10292, 10293, 27149 }, { buffType = "aura"}, "PALADIN") -- Devotion Aura
 | 
			
		||||
Buff( { 465, 10290, 643, 10291, 1032, 10292, 10293, 27149, 48941, 48942 }, { buffType = "aura"}, "PALADIN") -- Devotion Aura
 | 
			
		||||
Buff( { 7294 }, { buffType = "aura"}, "PALADIN") -- Retribution Aura
 | 
			
		||||
Buff( { 19746 }, { buffType = "aura"}, "PALADIN") -- Concentration Aura
 | 
			
		||||
Buff( { 19876 }, { buffType = "aura"}, "PALADIN") -- Shadow Resistance Aura
 | 
			
		||||
@@ -152,7 +193,7 @@ Buff( { 19888 }, { buffType = "aura"}, "PALADIN") -- Frost Resistance Aura
 | 
			
		||||
Buff( { 19891 }, { buffType = "aura"}, "PALADIN") -- Fire Resistance Aura
 | 
			
		||||
Buff( { 32223 }, { buffType = "aura"}, "PALADIN") -- Crusader Aura
 | 
			
		||||
--Seals
 | 
			
		||||
Buff( { 20154, 20287, 20288, 20289, 20290, 20291, 20292, 20293, 27155 }, { buffType = "magic"}, "PALADIN") -- Seal of Righteousness
 | 
			
		||||
Buff( { 20154, 21084, 20287, 20288, 20289, 20290, 20291, 20292, 20293, 27155 }, { buffType = "magic"}, "PALADIN") -- Seal of Righteousness
 | 
			
		||||
Buff( { 31892 }, { buffType = "magic"}, "PALADIN") -- Seal of Blood
 | 
			
		||||
Buff( { 20375 }, { buffType = "magic"}, "PALADIN") -- Seal of Command
 | 
			
		||||
Buff( { 20164 }, { buffType = "magic"}, "PALADIN") -- Seal of Justice
 | 
			
		||||
@@ -161,6 +202,18 @@ Buff( { 15277 }, { buffType = "magic"}, "PALADIN") -- Seal of Reckoning
 | 
			
		||||
Buff( { 31801 }, { buffType = "magic"}, "PALADIN") -- Seal of Vengeance
 | 
			
		||||
Buff( { 20166 }, { buffType = "magic"}, "PALADIN") -- Seal of Wisdom
 | 
			
		||||
Buff( { 21082 }, { buffType = "magic"}, "PALADIN") -- Seal of the Crusade
 | 
			
		||||
Buff( { 53563 }, { buffType = "magic"}, "PALADIN") -- Beacon of Light
 | 
			
		||||
Buff( { 54149 }, { buffType = "magic"}, "PALADIN") -- Infusion of Light
 | 
			
		||||
Buff( { 59578 }, { buffType = "magic"}, "PALADIN") -- The Art of War
 | 
			
		||||
Buff( { 20925, 20927, 20928, 27179, 48951, 48952 }, { buffType = "magic"}, "PALADIN") -- Holy Shield
 | 
			
		||||
Buff( { 53601 }, { buffType = "magic"}, "PALADIN") -- Sacred Shield
 | 
			
		||||
Buff( { 54428 }, { buffType = "magic"}, "PALADIN") -- Divine Plea
 | 
			
		||||
Buff( { 31821 }, { buffType = "magic"}, "PALADIN") -- Aura Mastery
 | 
			
		||||
Buff( { 31842 }, { buffType = "magic"}, "PALADIN") -- Divine Illumination
 | 
			
		||||
Buff( { 20216 }, { buffType = "magic"}, "PALADIN") -- Divine Favor
 | 
			
		||||
Buff( { 25780 }, { buffType = "magic"}, "PALADIN") -- Righteous Fury
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
-------------
 | 
			
		||||
@@ -170,7 +223,10 @@ Buff( { 21082 }, { buffType = "magic"}, "PALADIN") -- Seal of the Crusade
 | 
			
		||||
Buff( { 5384 }, { buffType = "physical"}, "HUNTER") -- Feign Death
 | 
			
		||||
Buff( { 19263 }, { buffType = "physical"}, "HUNTER") -- Deterrence
 | 
			
		||||
Buff( { 3045 }, { buffType = "physical"}, "HUNTER") -- Rapid Fire
 | 
			
		||||
--local FEIGN_DEATH = GetSpellInfo(5384) -- Localized name for Feign Death
 | 
			
		||||
Buff( { 64420 }, { buffType = "physical"}, "HUNTER") -- Sniper Training
 | 
			
		||||
Buff( { 34835 }, { buffType = "physical"}, "HUNTER") -- Master Tactician
 | 
			
		||||
Buff( { 54216 }, { buffType = "physical"}, "HUNTER") -- Master's Call
 | 
			
		||||
Buff( { 34471 }, { buffType = "physical"}, "HUNTER") -- The Beast Within
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
-------------
 | 
			
		||||
@@ -178,20 +234,50 @@ Buff( { 3045 }, { buffType = "physical"}, "HUNTER") -- Rapid Fire
 | 
			
		||||
-------------
 | 
			
		||||
 | 
			
		||||
Buff({ 66 }, { buffType = "magic"}, "MAGE") -- Invisibility
 | 
			
		||||
Buff({ 1459 }, { buffType = "magic"}, "MAGE") -- Arcane Intellect
 | 
			
		||||
Buff({ 1459, 1460, 1461, 10156, 10157, 27126, 42995 }, { buffType = "magic"}, "MAGE") -- Arcane Intellect
 | 
			
		||||
Buff({ 130 }, { buffType = "magic"}, "MAGE") -- Slow Fall
 | 
			
		||||
Buff({ 604 }, { buffType = "magic"}, "MAGE") -- Dampen Magic
 | 
			
		||||
Buff({ 1008 }, { buffType = "magic"}, "MAGE") -- Amplify Magic
 | 
			
		||||
Buff({ 1463 }, { buffType = "magic"}, "MAGE") -- Mana Shield
 | 
			
		||||
Buff({ 6117 }, { buffType = "form"}, "MAGE") -- Mage Armor
 | 
			
		||||
Buff({ 604, 8450, 8451, 10173, 10174, 33944, 43015 }, { buffType = "magic"}, "MAGE") -- Dampen Magic
 | 
			
		||||
Buff({ 1008, 8455, 10169, 10170, 27130, 33946, 43017,  }, { buffType = "magic"}, "MAGE") -- Amplify Magic
 | 
			
		||||
Buff({ 1463, 8494, 8495, 10191, 10192, 10193, 27131, 43019, 43020 }, { buffType = "magic"}, "MAGE") -- Mana Shield
 | 
			
		||||
Buff({ 6117, 22782, 22783, 27125, 43023, 43024 }, { buffType = "form"}, "MAGE") -- Mage Armor
 | 
			
		||||
Buff({ 31643 }, { buffType = "magic"}, "MAGE") -- Blazing Speed
 | 
			
		||||
Buff({ 543 }, { buffType = "magic"}, "MAGE") -- Fire Ward
 | 
			
		||||
Buff({ 543, 8457, 8458, 10223, 10225, 27128, 43010 }, { buffType = "magic"}, "MAGE") -- Fire Ward
 | 
			
		||||
Buff({ 11129 }, { buffType = "magic"}, "MAGE") -- Combustion
 | 
			
		||||
Buff({ 30482 }, { buffType = "form"}, "MAGE") -- Molten Armor
 | 
			
		||||
Buff({ 168 }, { buffType = "form"}, "MAGE") -- Frost Armor
 | 
			
		||||
Buff({ 7302 }, { buffType = "form"}, "MAGE") -- Ice Armor
 | 
			
		||||
Buff({ 30482, 43045, 43046 }, { buffType = "form"}, "MAGE") -- Molten Armor
 | 
			
		||||
Buff({ 168, 7300, 7301 }, { buffType = "form"}, "MAGE") -- Frost Armor
 | 
			
		||||
Buff({ 7302, 7320, 10219, 10220, 27124, 43008 }, { buffType = "form"}, "MAGE") -- Ice Armor
 | 
			
		||||
Buff({ 45438 }, { buffType = "immune"}, "MAGE") -- Ice Block
 | 
			
		||||
Buff({ 6143 }, { buffType = "magic"}, "MAGE") -- Frost Ward
 | 
			
		||||
Buff({ 6143, 32796, 8462, 28609, 10177, 43012, 8461 }, { buffType = "magic"}, "MAGE") -- Frost Ward
 | 
			
		||||
--talents
 | 
			
		||||
Buff({ 11426 }, { buffType = "magic"}, "MAGE") -- Ice Barrier
 | 
			
		||||
Buff({ 12472 }, { buffType = "magic"}, "MAGE") -- Icy Veins
 | 
			
		||||
Buff({ 11426, 13031, 13032, 13033, 27134, 33405, 43038, 43039 }, { buffType = "magic"}, "MAGE") -- Ice Barrier
 | 
			
		||||
Buff({ 12472 }, { buffType = "magic"}, "MAGE") -- Icy Veins
 | 
			
		||||
Buff({ 74396 }, { buffType = "magic"}, "MAGE") -- Fingers of Frost
 | 
			
		||||
Buff({ 57761 }, { buffType = "magic"}, "MAGE") -- FireBall!
 | 
			
		||||
Buff({ 44413 }, { buffType = "magic"}, "MAGE") -- Incanter's Absorption
 | 
			
		||||
Buff({ 48108 }, { buffType = "magic"}, "MAGE") -- Hot Streak
 | 
			
		||||
Buff({ 54741 }, { buffType = "magic"}, "MAGE") -- Hot Streak
 | 
			
		||||
Buff({ 61316 }, { buffType = "magic"}, "MAGE") -- Dalaran Brilliance
 | 
			
		||||
Buff({ 44401 }, { buffType = "magic"}, "MAGE") -- Missile Barrage
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
-------------
 | 
			
		||||
-- DEATHKNIGHT
 | 
			
		||||
-------------
 | 
			
		||||
 | 
			
		||||
Buff({ 48707 }, { buffType = "physical"}, "DEATHKNIGHT") -- Anti-Magic Shell
 | 
			
		||||
Buff({ 48792 }, { buffType = "physical"}, "DEATHKNIGHT") -- Icebound Fortitude
 | 
			
		||||
Buff({ 49039 }, { buffType = "physical"}, "DEATHKNIGHT") -- Lichborne
 | 
			
		||||
Buff({ 50461 }, { buffType = "physical"}, "DEATHKNIGHT") -- Anti-Magic Zone
 | 
			
		||||
Buff({ 57330, 57623 }, { buffType = "physical"}, "DEATHKNIGHT") -- Horn of Winter
 | 
			
		||||
Buff({ 49222 }, { buffType = "physical"}, "DEATHKNIGHT") -- Bone Shield
 | 
			
		||||
Buff({ 49016 }, { buffType = "enrage"}, "DEATHKNIGHT") -- Unholy Frenzy
 | 
			
		||||
Buff({ 59052 }, { buffType = "physical"}, "DEATHKNIGHT") -- Freezing Fog
 | 
			
		||||
Buff({ 55233 }, { buffType = "physical"}, "DEATHKNIGHT") -- Vampiric Blood
 | 
			
		||||
Buff({ 51271 }, { buffType = "physical"}, "DEATHKNIGHT") -- Unbreakable Armor
 | 
			
		||||
Buff({ 49796 }, { buffType = "physical"}, "DEATHKNIGHT") -- Deathchill
 | 
			
		||||
Buff({ 50485 }, { buffType = "physical"}, "DEATHKNIGHT") -- Acclimation
 | 
			
		||||
Buff({ 66803 }, { buffType = "physical"}, "DEATHKNIGHT") -- Desolation
 | 
			
		||||
Buff({ 55610 }, { buffType = "aura"}, "DEATHKNIGHT") -- Improved Icy Talons
 | 
			
		||||
Buff({ 53138 }, { buffType = "aura"}, "DEATHKNIGHT") -- Abomination's Might
 | 
			
		||||
@@ -11,129 +11,151 @@ Debuff({ 9035, 19281, 19282, 19283, 19284, 19285, 25470 }, { buffType = "curse"
 | 
			
		||||
Debuff({ 6788 }, { }, "PRIEST") -- Weakened Soul
 | 
			
		||||
Debuff({ 15487 }, { buffType = "magic" }, "PRIEST") -- Silence
 | 
			
		||||
Debuff({ 10797, 19296, 19299, 19302, 19303, 19304, 19305, 25446 }, { stacking = true, buffType = "magic", preEvent = "SPELL_CAST_SUCCESS" }, "PRIEST") -- starshards
 | 
			
		||||
Debuff({ 2944, 19276, 19277, 19278, 19279, 19280, 25467 }, { stacking = true , buffType = "disease", preEvent = "SPELL_CAST_SUCCESS"}, "PRIEST") --devouring plague
 | 
			
		||||
Debuff({ 2944, 19276, 19277, 19278, 19279, 19280, 25467, 48299, 48300 }, { stacking = true , buffType = "disease", preEvent = "SPELL_CAST_SUCCESS"}, "PRIEST") --devouring plague
 | 
			
		||||
Debuff({ 453, 8192, 10953, 25596 }, { }, "PRIEST") -- mind soothe
 | 
			
		||||
Debuff({ 14914, 15261, 15262, 15263, 15264, 15265, 15266, 15267, 25384 }, { stacking = true, buffType = "magic", preEvent = "SPELL_DAMAGE"}, "PRIEST") -- Holy Fire, stacking?
 | 
			
		||||
Debuff({ 589, 594, 970, 992, 2767, 10892, 10893, 10894, 25367, 25368 }, { stacking = true, buffType = "magic", preEvent = "SPELL_CAST_SUCCESS"}, "PRIEST") -- SW:P
 | 
			
		||||
Debuff({ 14914, 15261, 15262, 15263, 15264, 15265, 15266, 15267, 25384, 48134, 48135 }, { stacking = true, buffType = "magic", preEvent = "SPELL_DAMAGE"}, "PRIEST") -- Holy Fire, stacking?
 | 
			
		||||
Debuff({ 589, 594, 970, 992, 2767, 10892, 10893, 10894, 25367, 25368, 48124, 48125 }, { stacking = true, buffType = "magic", preEvent = "SPELL_CAST_SUCCESS"}, "PRIEST") -- SW:P
 | 
			
		||||
Debuff({ 15258 } ,{ buffType = "magic" }, "PRIEST") -- Shadow Vulnerability (Shadow Weaving Talent Effect)
 | 
			
		||||
Debuff({ 15286 } ,{ buffType = "magic" }, "PRIEST") -- Vampiric Embrace
 | 
			
		||||
Debuff({ 15407, 17311, 17312, 17313, 17314, 18807, 25387 }, { buffType = "magic" }, "PRIEST") -- Mind Flay
 | 
			
		||||
Debuff({ 34914, 34916, 34917, 48159, 48160 }, { buffType = "magic"}, "PRIEST") -- Vampiric Touch
 | 
			
		||||
Debuff({ 15407, 17311, 17312, 17313, 17314, 18807, 25387, 48155, 48156 }, { buffType = "magic" }, "PRIEST") -- Mind Flay
 | 
			
		||||
Debuff({ 605, 10911, 10912 }, { buffType = "magic" }, "PRIEST") -- Mind Control
 | 
			
		||||
Debuff({ 8122, 8124, 10888, 10890 }, { buffType = "magic", }, "PRIEST") -- Psychic Scream
 | 
			
		||||
Debuff({ 15269 }, { buffType = "magic"}, "PRIEST") -- Blackout
 | 
			
		||||
Debuff({ 44041, 44043, 44044, 44045, 44046, 44047 }, { buffType = "magic"}, "PRIEST") -- Chastise
 | 
			
		||||
Debuff({ 48045, 53023 }, {stacking = true, buffType = "magic", preEvent = "SPELL_CAST_SUCCESS"}, "PRIEST") -- Mind Sear
 | 
			
		||||
Debuff({ 64044 }, { buffType = "magic" }, "PRIEST") -- Psychic Horror
 | 
			
		||||
Debuff({ 64058 }, { buffType = "physical" }, "PRIEST") -- Psychic Horror Disarm
 | 
			
		||||
 | 
			
		||||
---------------
 | 
			
		||||
-- DRUID
 | 
			
		||||
---------------
 | 
			
		||||
Debuff({ 33786 }, { buffType = "immune"}, "DRUID") -- Cyclone
 | 
			
		||||
Debuff({ 19675 }, { }, "DRUID") -- Feral Charge
 | 
			
		||||
Debuff( { 22570}, { buffType = "physical"}, "DRUID") -- Maim
 | 
			
		||||
Debuff({ 19975, 19974, 19973, 19972, 19971, 19970, 27010 }, { buffType = "magic", altName = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689))  }, "DRUID") -- Nature's Grasp root
 | 
			
		||||
Debuff({ 22570, 49802}, { buffType = "physical"}, "DRUID") -- Maim
 | 
			
		||||
Debuff({ 19975, 19974, 19973, 19972, 19971, 19970, 27010, 53313 }, { buffType = "magic", altName = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689))  }, "DRUID") -- Nature's Grasp root
 | 
			
		||||
Debuff({ 339, 1062, 5195, 5196, 9852, 9853, 26989 }, { buffType = "magic"}, "DRUID") -- Entangling Roots
 | 
			
		||||
Debuff({ 770, 778, 9749, 9907, 26993 }, { buffType = "magic"  }, "DRUID") -- Faerie Fire
 | 
			
		||||
Debuff({ 16857, 17390, 17391, 17392, 27011 }, { buffType = "magic"  }, "DRUID") -- Faerie Fire (Feral)
 | 
			
		||||
Debuff({ 2637, 18657, 18658 }, { buffType = "magic"}, "DRUID") -- Hibernate
 | 
			
		||||
Debuff({ 99, 1735, 9490, 9747, 9898, 26998 }, { buffType = "physical" }, "DRUID") -- Demoralizing Roar
 | 
			
		||||
Debuff({ 99, 1735, 9490, 9747, 9898, 26998, 48559, 48560 }, { buffType = "physical" }, "DRUID") -- Demoralizing Roar
 | 
			
		||||
Debuff({ 5209 }, { buffType = "physical"  }, "DRUID") -- Challenging Roar
 | 
			
		||||
Debuff({ 6795 }, { stacking = true, buffType = "physical", preEvent = "SPELL_CAST_SUCCESS" }, "DRUID") -- Taunt
 | 
			
		||||
Debuff({ 16922 }, { buffType = "physical" }, "DRUID") -- Imp Starfire Stun
 | 
			
		||||
Debuff({ 9005, 9823, 9827, 27006 }, { buffType = "physical" }, "DRUID") -- Pounce
 | 
			
		||||
Debuff({ 9007, 9824, 9826, 27007 }, { buffType = "physical", stacking = true, preEvent = "SPELL_CAST_SUCCESS" }, "DRUID") -- Pounce Bleed
 | 
			
		||||
Debuff({ 8921, 8924, 8925, 8926, 8927, 8928, 8929, 9833, 9834, 9835, 26987, 26988 }, { stacking = true, buffType = "magic"}, "DRUID") -- Moonfire
 | 
			
		||||
Debuff({ 1822, 1823, 1824, 9904, 27003 }, { stacking = true, buffType = "physical", preEvent = "SPELL_CAST_SUCCESS" }, "DRUID") -- Rake
 | 
			
		||||
Debuff({ 1079, 9492, 9493, 9752, 9894, 9896, 27008 }, { stacking = true, buffType = "physical", preEvent = "SPELL_CAST_SUCCESS" }, "DRUID") -- Rip
 | 
			
		||||
Debuff({ 5570, 24974, 24975, 24976, 24977, 27013 }, { stacking = true, buffType = "magic", preEvent = "SPELL_CAST_SUCCESS" }, "DRUID") -- Insect Swarm
 | 
			
		||||
Debuff({ 33745 }, { stacking = true, buffType = "physical", preEvent = "SPELL_CAST_SUCCESS" }, "DRUID") -- Lacerate
 | 
			
		||||
Debuff({ 33878, 33986, 33987 }, { buffType = "physical" }, "DRUID") -- Mangle (Bear)
 | 
			
		||||
Debuff({ 33876, 33982, 33983 }, { buffType = "physical" }, "DRUID") -- Mangle (Cat)
 | 
			
		||||
Debuff({ 9005, 9823, 9827, 27006, 49803 }, { buffType = "physical" }, "DRUID") -- Pounce
 | 
			
		||||
Debuff({ 9007, 9824, 9826, 27007, 49804 }, { buffType = "physical", stacking = true, preEvent = "SPELL_CAST_SUCCESS" }, "DRUID") -- Pounce Bleed
 | 
			
		||||
Debuff({ 8921, 8924, 8925, 8926, 8927, 8928, 8929, 9833, 9834, 9835, 26987, 26988, 48462, 48463 }, { stacking = true, buffType = "magic"}, "DRUID") -- Moonfire
 | 
			
		||||
Debuff({ 1822, 1823, 1824, 9904, 27003, 48573, 48574, 59886 }, { stacking = true, buffType = "physical", preEvent = "SPELL_CAST_SUCCESS" }, "DRUID") -- Rake
 | 
			
		||||
Debuff({ 1079, 9492, 9493, 9752, 9894, 9896, 27008, 49799, 49800 }, { stacking = true, buffType = "physical", preEvent = "SPELL_CAST_SUCCESS" }, "DRUID") -- Rip
 | 
			
		||||
Debuff({ 5570, 24974, 24975, 24976, 24977, 27013, 48468 }, { stacking = true, buffType = "magic", preEvent = "SPELL_CAST_SUCCESS" }, "DRUID") -- Insect Swarm
 | 
			
		||||
Debuff({ 33745, 48567, 48568 }, { stacking = true, buffType = "physical", preEvent = "SPELL_CAST_SUCCESS" }, "DRUID") -- Lacerate
 | 
			
		||||
Debuff({ 33878, 33986, 33987, 48563, 48564 }, { buffType = "physical" }, "DRUID") -- Mangle (Bear)
 | 
			
		||||
Debuff({ 33876, 33982, 33983, 48565, 48566 }, { buffType = "physical" }, "DRUID") -- Mangle (Cat)
 | 
			
		||||
Debuff({ 60433 }, { buffType = "magic" }, "DRUID") -- Earth and Moon
 | 
			
		||||
Debuff({ 58181 }, { buffType = "physical" }, "DRUID") -- Infected Wounds
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
-------------
 | 
			
		||||
-- WARRIOR
 | 
			
		||||
-------------
 | 
			
		||||
Debuff({ 29703 }, { buffType = "physical"}, "WARRIOR") -- Dazed
 | 
			
		||||
Debuff({ 12294, 21551, 21552, 21553, 25248, 30330 }, { buffType = "physical" }, "WARRIOR") -- Mortal Strike
 | 
			
		||||
Debuff({ 72, 1671, 1672, 29704}, { buffType = "physical" }, "WARRIOR") -- Shield Bash
 | 
			
		||||
Debuff({ 12294, 21551, 21552, 21553, 25248, 30330, 47485, 47486 }, { buffType = "physical" }, "WARRIOR") -- Mortal Strike
 | 
			
		||||
Debuff({ 72, 1671, 1672, 29704 }, { buffType = "physical" }, "WARRIOR") -- Shield Bash
 | 
			
		||||
Debuff({ 18498 }, { buffType = "physical" }, "WARRIOR") -- Improved Shield Bash
 | 
			
		||||
Debuff({ 772, 6546, 6547, 6548, 11572, 11573, 11574, 25208 }, { stacking = true, buffType = "physical"}, "WARRIOR") -- Rend
 | 
			
		||||
Debuff({ 12721, 43104 }, { stacking = true, buffType = "physical"}, "WARRIOR") -- Deep Wounds
 | 
			
		||||
Debuff({ 772, 6546, 6547, 6548, 11572, 11573, 11574, 25208, 46845, 47465 }, { stacking = true, buffType = "physical"}, "WARRIOR") -- Rend
 | 
			
		||||
Debuff({ 12721, 43104,  }, { stacking = true, buffType = "physical"}, "WARRIOR") -- Deep Wounds
 | 
			
		||||
Debuff({ 12323 }, { buffType = "physical"}, "WARRIOR") -- Piercing Howl
 | 
			
		||||
Debuff({ 1715, 7372, 7373, 25212 }, { buffType = "physical" }, "WARRIOR") -- Hamstring
 | 
			
		||||
Debuff({ 23694 } , { buffType = "physical" }, "WARRIOR") -- Improved Hamstring
 | 
			
		||||
Debuff({ 6343, 8198, 8204, 8205, 11580, 11581, 25264 }, { buffType = "physical"}, "WARRIOR") -- Thunder Clap
 | 
			
		||||
Debuff({ 6343, 8198, 8204, 8205, 11580, 11581, 25264, 47501, 47502 }, { buffType = "physical"}, "WARRIOR") -- Thunder Clap
 | 
			
		||||
Debuff({ 694, 7400, 7402, 20559, 20560 }, { buffType = "physical", }, "WARRIOR") -- Mocking Blow
 | 
			
		||||
Debuff({ 1161 } ,{ buffType = "physical", }, "WARRIOR") -- Challenging Shout
 | 
			
		||||
Debuff({ 355 } ,{ stacking = true, buffType = "physical", preEvent = "SPELL_CAST_SUCCESS" }, "WARRIOR") -- Taunt
 | 
			
		||||
Debuff({ 1160, 6190, 11554, 11555, 11556, 25202, 25203 }, { buffType = "physical" }, "WARRIOR") -- Demoralizing Shout, varies
 | 
			
		||||
Debuff({ 1160, 6190, 11554, 11555, 11556, 25202, 25203, 47437 }, { buffType = "physical" }, "WARRIOR") -- Demoralizing Shout, varies
 | 
			
		||||
Debuff({ 5246 }, { buffType = "physical" }, "WARRIOR") -- Intimidating Shout Fear
 | 
			
		||||
Debuff({ 676 } ,{ buffType = "physical" }, "WARRIOR") -- Disarm
 | 
			
		||||
Debuff({ 12798 } , { buffType = "physical" }, "WARRIOR") -- Imp Revenge Stun
 | 
			
		||||
Debuff({ 7386, 7405, 8380, 11596, 11597, 25225, buffType = "physical" }, { }, "WARRIOR") -- Sunder Armor
 | 
			
		||||
Debuff({ 7386, 7405, 8380, 11596, 11597, 25225 }, { buffType = "physical" }, { }, "WARRIOR") -- Sunder Armor
 | 
			
		||||
Debuff({ 12809 } ,{ buffType = "physical" }, "WARRIOR") -- Concussion Blow
 | 
			
		||||
Debuff({ 7922 }, { buffType = "physical" }, "WARRIOR") -- Charge Stun
 | 
			
		||||
Debuff({ 20253, 20614, 20615, 25273, 25274 }, { buffType = "physical" }, "WARRIOR") -- Intercept Stun
 | 
			
		||||
Debuff({ 20253, 20614, 20615, 25273, 25274, 47995 }, { buffType = "physical" }, "WARRIOR") -- Intercept Stun
 | 
			
		||||
Debuff({ 5530 }, { buffType = "physical"}, "WARRIOR") -- Mace Stun Effect (Mace Specialization)
 | 
			
		||||
Debuff({ 56112 }, { buffType = "physical"}, "WARRIOR") -- Furious Attacks
 | 
			
		||||
Debuff({ 18498, 74347 }, { buffType = "physical"}, "WARRIOR") -- Gag Order
 | 
			
		||||
Debuff({ 46857 }, { buffType = "physical"}, "WARRIOR") -- Trauma
 | 
			
		||||
Debuff({ 46968 }, { buffType = "physical"}, "WARRIOR") -- Shockwave
 | 
			
		||||
Debuff({ 64382 }, { buffType = "physical"}, "WARRIOR") -- Shattering Throw
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
--------------
 | 
			
		||||
-- ROGUE
 | 
			
		||||
--------------
 | 
			
		||||
 | 
			
		||||
Debuff({ 16511, 17347, 17348, 26864 }, { buffType = "physical" }, "ROGUE") -- Hemorrhage
 | 
			
		||||
Debuff({ 16511, 17347, 17348, 26864, 48660 }, { buffType = "physical" }, "ROGUE") -- Hemorrhage
 | 
			
		||||
Debuff({ 3409, 11201 }, { buffType = "poison" }, "ROGUE") -- Crippling Poison
 | 
			
		||||
Debuff({ 13218, 13222, 13223, 13224, 27189 }, { buffType = "poison" }, "ROGUE") -- Wound Poison
 | 
			
		||||
Debuff({ 13218, 13222, 13223, 13224, 27189, 57975 }, { buffType = "poison" }, "ROGUE") -- Wound Poison
 | 
			
		||||
Debuff({ 26679 }, { buffType = "physical"}, "ROGUE") -- Deadly Throw Slow
 | 
			
		||||
Debuff({ 2818, 2819, 11353, 11354, 25349, 26968, 27187 }, { stacking = true, buffType = "poison", preEvent = { { event = "SPELL_DAMAGE", spellID = 5940}, "SWING_DAMAGE" }}, "ROGUE") -- Deadly Poison
 | 
			
		||||
Debuff({ 2818, 2819, 11353, 11354, 25349, 26968, 27187, 57970 }, { stacking = true, buffType = "poison", preEvent = { { event = "SPELL_DAMAGE", spellID = 5940}, "SWING_DAMAGE" }}, "ROGUE") -- Deadly Poison
 | 
			
		||||
Debuff({ 5760, 8692, 11398 }, { buffType = "poison" }, "ROGUE") -- Mind-numbing Poison
 | 
			
		||||
Debuff({ 18425 }, { buffType = "physical" }, "ROGUE") -- Improved Kick Silence
 | 
			
		||||
Debuff({ 1833 }, { buffType = "physical" }, "ROGUE") -- Cheap Shot
 | 
			
		||||
Debuff({ 2070, 6770, 11297 }, { buffType = "physical" }, "ROGUE") -- Sap
 | 
			
		||||
Debuff({ 2094 } , { buffType = "physical" }, "ROGUE") -- Blind
 | 
			
		||||
Debuff({ 8647, 8649, 8650, 11197, 11198, 26866 }, { buffType = "physical" }, "ROGUE") -- Expose Armor
 | 
			
		||||
Debuff({ 703, 8631, 8632, 8633, 11289, 11290, 26839, 26884 }, { buffType = "physical", stacking = true, preEvent = "SPELL_CAST_SUCCESS"}, "ROGUE") -- Garrote
 | 
			
		||||
Debuff({ 703, 8631, 8632, 8633, 11289, 11290, 26839, 26884, 48676 }, { buffType = "physical", stacking = true, preEvent = "SPELL_CAST_SUCCESS"}, "ROGUE") -- Garrote
 | 
			
		||||
Debuff({ 1330 }, { buffType = "physical"}, "ROGUE")-- Garrote - Silence
 | 
			
		||||
Debuff({ 408, 8643 }, { buffType = "physical" }, "ROGUE") -- Kidney Shot
 | 
			
		||||
Debuff({ 1943, 8639, 8640, 11273, 11274, 11275, 26867 }, { buffType = "physical", stacking = true}, "ROGUE") -- Rupture
 | 
			
		||||
Debuff({ 1943, 8639, 8640, 11273, 11274, 11275, 26867, 48671, 48672 }, { buffType = "physical", stacking = true}, "ROGUE") -- Rupture
 | 
			
		||||
Debuff({ 1776, 1777, 8629, 11285, 11286, 38764 }, { buffType = "physical", }, "ROGUE") -- Gouge
 | 
			
		||||
Debuff({ 14251 } , { buffType = "physical", }, "ROGUE") -- Riposte (disarm)
 | 
			
		||||
Debuff({ 51693 } , { buffType = "physical", }, "ROGUE") -- Waylay
 | 
			
		||||
Debuff({ 51585 } , { buffType = "physical", }, "ROGUE") -- Blade Twisting
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
------------
 | 
			
		||||
-- WARLOCK
 | 
			
		||||
------------
 | 
			
		||||
Debuff({ 32386 }, { buffType = "magic"}, "WARLOCK") -- Shadow Embrace
 | 
			
		||||
Debuff({ 710, 18647 } ,{ buffType = "immune"}, "WARLOCK") -- Banish
 | 
			
		||||
Debuff( { 348, 707, 1094, 2941, 11665, 11667, 11668, 25309, 27215 }, { buffType = "magic", stacking = true, preEvent = "SPELL_DAMAGE"}, "WARLOCK") -- Immolate
 | 
			
		||||
Debuff( { 348, 707, 1094, 2941, 11665, 11667, 11668, 25309, 27215, 47810, 47811 }, { buffType = "magic", stacking = true, preEvent = "SPELL_DAMAGE"}, "WARLOCK") -- Immolate
 | 
			
		||||
Debuff({ 24259 } ,{ buffType = "magic" }, "WARLOCK") -- Spell Lock Silence
 | 
			
		||||
Debuff({ 27243 } ,{ buffType = "magic", stacking = true, preEvent = "SPELL_CAST_START" }, "WARLOCK") -- Seed of Corruption
 | 
			
		||||
Debuff( { 689, 699, 709, 7651, 11699, 11700, 27219, 27220 }, { buffType = "magic", stacking = true, preEvent = "SPELL_CAST_SUCCESS"}, "WARLOCK") -- Drain Life
 | 
			
		||||
Debuff( { 689, 699, 709, 7651, 11699, 11700, 27219, 27220, 47857 }, { buffType = "magic", stacking = true, preEvent = "SPELL_CAST_SUCCESS"}, "WARLOCK") -- Drain Life
 | 
			
		||||
Debuff( { 5138, 6226, 11703, 11704, 27221, 30908 }, { buffType = "magic", stacking = true, preEvent = "SPELL_CAST_SUCCESS"}, "WARLOCK") -- Drain Mana
 | 
			
		||||
Debuff( { 1120, 8288, 8289, 11675, 27217 }, { buffType = "magic", stacking = true, preEvent = "SPELL_CAST_SUCCESS"}, "WARLOCK") -- Drain Soul
 | 
			
		||||
Debuff( { 1120, 8288, 8289, 11675, 27217, 47855 }, { buffType = "magic", stacking = true, preEvent = "SPELL_CAST_SUCCESS"}, "WARLOCK") -- Drain Soul
 | 
			
		||||
Debuff( { 18265, 18879, 18880, 18881, 27264, 30911}, { buffType = "magic", stacking = true, preEvent = "SPELL_CAST_SUCCESS"}, "WARLOCK") -- Siphon Life
 | 
			
		||||
Debuff( { 172, 6222, 6223, 7648, 11671, 11672, 25311, 27216 }, { buffType = "magic", stacking = true }, "WARLOCK") -- Corruption
 | 
			
		||||
Debuff( { 980, 1014, 6217, 11711, 11712, 11713, 27218 }, { buffType = "curse", stacking = true, preEvent = "SPELL_CAST_SUCCESS"}, "WARLOCK") -- Curse of Agony
 | 
			
		||||
Debuff( { 172, 6222, 6223, 7648, 11671, 11672, 25311, 27216, 47812, 47813 }, { buffType = "magic", stacking = true }, "WARLOCK") -- Corruption
 | 
			
		||||
Debuff( { 980, 1014, 6217, 11711, 11712, 11713, 27218, 47863, 47864 }, { buffType = "curse", stacking = true, preEvent = "SPELL_CAST_SUCCESS"}, "WARLOCK") -- Curse of Agony
 | 
			
		||||
Debuff({ 18223, 29539, 46434 }, { buffType = "curse"}, "WARLOCK") -- Curse of Exhaustion
 | 
			
		||||
Debuff( { 704, 7658, 7659, 11717, 27226 }, { buffType = "curse"}, "WARLOCK") -- Curse of Recklessness
 | 
			
		||||
Debuff( { 1490, 11721, 11722, 27228 }, { buffType = "curse"}, "WARLOCK") -- Curse of the Elements
 | 
			
		||||
Debuff( { 16231, 704, 7658, 7659, 11717, 27226 }, { buffType = "curse"}, "WARLOCK") -- Curse of Recklessness
 | 
			
		||||
Debuff( { 1490, 11721, 11722, 27228, 47865 }, { buffType = "curse"}, "WARLOCK") -- Curse of the Elements
 | 
			
		||||
Debuff( { 1714, 11719 }, { buffType = "curse"}, "WARLOCK") -- Curse of Tongues
 | 
			
		||||
Debuff( { 702, 1108, 6205, 7646, 11707, 11708, 27224, 30909 }, { buffType = "curse"}, "WARLOCK") -- Curse of Weakness
 | 
			
		||||
Debuff( { 603, 30910 }, { buffType = "curse"}, "WARLOCK") -- Curse of Doom
 | 
			
		||||
Debuff( { 6789, 17925, 17926, 27223 }, { buffType = "magic"}, "WARLOCK") -- Death Coil
 | 
			
		||||
Debuff( { 702, 1108, 6205, 7646, 11707, 11708, 27224, 30909, 50511 }, { buffType = "curse"}, "WARLOCK") -- Curse of Weakness
 | 
			
		||||
Debuff( { 603, 30910, 47867 }, { buffType = "curse"}, "WARLOCK") -- Curse of Doom
 | 
			
		||||
Debuff( { 6789, 17925, 17926, 27223, 47859, 47860 }, { buffType = "magic"}, "WARLOCK") -- Death Coil
 | 
			
		||||
Debuff( { 5782, 6213, 6215 }, { buffType = "magic"}, "WARLOCK") -- Fear
 | 
			
		||||
Debuff( { 5484, 17928 }, { buffType = "magic"}, "WARLOCK") -- Howl of Terror
 | 
			
		||||
Debuff({ 6358 }, { buffType = "magic" }, "WARLOCK") -- Seduction
 | 
			
		||||
Debuff({ 30108, 30404, 30405 }, { buffType = "magic", stacking = true, preEvent = "SPELL_CAST_START" }, "WARLOCK") -- Unstable Affliction
 | 
			
		||||
Debuff({ 31117, 43523 }, { buffType = "magic", altName = select(1, GetSpellInfo(30405)) .. " Silence" }, "WARLOCK") -- Unstable Affliction Silence
 | 
			
		||||
Debuff({ 30108, 30404, 30405, 47841, 47843 }, { buffType = "magic", stacking = true, preEvent = "SPELL_CAST_START" }, "WARLOCK") -- Unstable Affliction
 | 
			
		||||
Debuff({ 31117, 43523, 65813 }, { buffType = "magic", altName = select(1, GetSpellInfo(30405)) .. " Silence" }, "WARLOCK") -- Unstable Affliction Silence
 | 
			
		||||
Debuff({ 18093 } ,{ buffType = "physical" }, "WARLOCK") -- Pyroclasm
 | 
			
		||||
Debuff({ 17877, 18867, 18868, 18869, 18870, 18871, 27263, 30546 }, { buffType = "physical", stacking = true, preEvent = "SPELL_CAST_SUCCESS" }, "WARLOCK") -- Shadowburn Debuff
 | 
			
		||||
Debuff({ 17877, 18867, 18868, 18869, 18870, 18871, 27263, 30546, 47826, 47827 }, { buffType = "physical", stacking = true, preEvent = "SPELL_CAST_SUCCESS" }, "WARLOCK") -- Shadowburn Debuff
 | 
			
		||||
Debuff({ 47960, 61291 } ,{ buffType = "magic" }, "WARLOCK") -- Shadowflame dot
 | 
			
		||||
Debuff({ 63311 } ,{ buffType = "physical" }, "WARLOCK") -- Shadowflame slow
 | 
			
		||||
Debuff({ 48181, 59161, 59163, 59164 }, { buffType = "magic" }, "WARLOCK") -- Haunt
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
---------------
 | 
			
		||||
-- SHAMAN
 | 
			
		||||
---------------
 | 
			
		||||
 | 
			
		||||
Debuff({ 17364 } ,{ buffType = "magic" }, "SHAMAN") -- Stormstrike
 | 
			
		||||
Debuff({ 8056, 8058, 10472, 10473, 25464 }, { buffType = "magic" }, "SHAMAN") -- Frost Shock
 | 
			
		||||
Debuff({ 8050, 8052, 8053, 10447, 10448, 29228, 25457 }, { stacking = true, buffType = "magic", preEvent = "SPELL_CAST_SUCCESS" }, "SHAMAN") -- Flame Shock
 | 
			
		||||
Debuff({ 8034, 8037, 10458, 16352, 16353, 25501 }, { buffType = "magic" }, "SHAMAN") -- Frostbrand Attack
 | 
			
		||||
Debuff({ 8056, 8058, 10472, 10473, 25464, 49235, 49236 }, { buffType = "magic" }, "SHAMAN") -- Frost Shock
 | 
			
		||||
Debuff({ 8050, 8052, 8053, 10447, 10448, 29228, 25457, 49232, 49233 }, { stacking = true, buffType = "magic", preEvent = "SPELL_CAST_SUCCESS" }, "SHAMAN") -- Flame Shock
 | 
			
		||||
Debuff({ 8034, 8037, 10458, 16352, 16353, 25501, 58797, 58798, 58799 }, { buffType = "magic" }, "SHAMAN") -- Frostbrand Attack
 | 
			
		||||
Debuff({ 3600 } ,{ buffType = "magic" }, "SHAMAN") -- Earthbind Totem
 | 
			
		||||
Debuff({ 63685 } ,{ buffType = "magic" }, "SHAMAN") -- Frozen Power
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
--------------
 | 
			
		||||
-- PALADIN
 | 
			
		||||
@@ -143,59 +165,94 @@ Debuff( { 25771 }, { buffType = "immune"}, "PALADIN") -- Forbearance
 | 
			
		||||
Debuff({ 20066 }, { buffType = "magic" }, "PALADIN") -- Repentance
 | 
			
		||||
Debuff({ 2878, 5627, 5627 }, { buffType = "magic"}, "PALADIN") -- Turn Undead
 | 
			
		||||
Debuff({ 21183, 20188, 20300, 20301, 20302, 20303, 27159 }, { }, "PALADIN") -- Judgement of the Crusader
 | 
			
		||||
Debuff({ 20185, 20344, 20345, 20346 }, { buffType = "magic"}, "PALADIN") -- Judgement of Light
 | 
			
		||||
Debuff({ 20186, 20354, 20355 }, { buffType = "magic"}, "PALADIN") -- Judgement of Wisdom
 | 
			
		||||
Debuff({ 20184, 31896}, { buffType = "magic", }, "PALADIN") -- Judgement of Justice
 | 
			
		||||
Debuff({ 20271, 20185, 20344, 20345, 20346 }, { buffType = "magic"}, "PALADIN") -- Judgement of Light
 | 
			
		||||
Debuff({ 20186, 20354, 20355, 53408 }, { buffType = "magic"}, "PALADIN") -- Judgement of Wisdom
 | 
			
		||||
Debuff({ 20184, 31896, 53407}, { buffType = "magic", }, "PALADIN") -- Judgement of Justice
 | 
			
		||||
Debuff({ 853, 5588, 5589, 10308 }, { buffType = "magic" }, "PALADIN") -- Hammer of Justice
 | 
			
		||||
Debuff({ 20170 } ,{ buffType = "physical", }, "PALADIN") -- Seal of Justice stun
 | 
			
		||||
Debuff({ 63529 } ,{ buffType = "magic", }, "PALADIN") -- Shield of the Templar
 | 
			
		||||
Debuff({ 61840 } ,{ buffType = "magic", }, "PALADIN") -- Righteous Vengeance
 | 
			
		||||
Debuff({ 10326 }, { buffType = "magic"}, "PALADIN") -- Turn Evil
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
-------------
 | 
			
		||||
-- HUNTER
 | 
			
		||||
-------------
 | 
			
		||||
 | 
			
		||||
Debuff( { 19434, 20900, 20901, 20902, 20903, 20904}, { buffType = "physical"}, "HUNTER") -- Aimed Shot
 | 
			
		||||
Debuff({ 1130, 14323, 14324, 14325 }, { buffType = "magic", }, "HUNTER") -- Hunter's Mark
 | 
			
		||||
Debuff({ 1978, 13549, 13550, 13551, 13552, 13553, 13554, 13555, 25295, 27016 }, { stacking = true, buffType = "poison", preEvent = "SPELL_CAST_SUCCESS" }, "HUNTER") -- Serpent Sting
 | 
			
		||||
Debuff( { 19434, 20900, 20901, 20902, 20903, 20904, 27065, 49049, 49050}, { buffType = "physical"}, "HUNTER") -- Aimed Shot
 | 
			
		||||
Debuff({ 1130, 14323, 14324, 14325, 53338 }, { buffType = "magic", }, "HUNTER") -- Hunter's Mark
 | 
			
		||||
Debuff({ 1978, 13549, 13550, 13551, 13552, 13553, 13554, 13555, 25295, 27016, 49000, 49001 }, { stacking = true, buffType = "poison", preEvent = "SPELL_CAST_SUCCESS" }, "HUNTER") -- Serpent Sting
 | 
			
		||||
Debuff({ 34490 }, { buffType = "magic" }, "HUNTER") -- Silencing Shot
 | 
			
		||||
Debuff({ 3043 }, { buffType = "poison", }, "HUNTER") -- Scorpid Sting
 | 
			
		||||
Debuff({ 3034, 14279, 14280, 27018 }, { buffType = "poison", }, "HUNTER") -- Viper Sting
 | 
			
		||||
Debuff({ 19386, 24132, 24133, 27068 }, { buffType = "poison", }, "HUNTER") -- Wyvern Sting
 | 
			
		||||
Debuff({ 24131, 24134, 24135, 27069 }, { buffType = "poison", altName = select(1, GetSpellInfo(19386)) .. " Dot" }, "HUNTER") -- Wyvern Sting Dot
 | 
			
		||||
Debuff({ 19386, 24132, 24133, 27068, 49011, 49012 }, { buffType = "poison", }, "HUNTER") -- Wyvern Sting
 | 
			
		||||
Debuff({ 24131, 24134, 24135, 27069, 49009, 49010 }, { buffType = "poison", altName = select(1, GetSpellInfo(19386)) .. " Dot" }, "HUNTER") -- Wyvern Sting Dot
 | 
			
		||||
Debuff({ 1513, 14326, 14327 }, { buffType = "magic"}, "HUNTER") -- Scare Beast
 | 
			
		||||
Debuff({ 19229 }, { buffType = "physical", }, "HUNTER") -- Wing Clip Root
 | 
			
		||||
Debuff({ 19306, 20909, 20910 }, { buffType = "physical"}, "HUNTER") -- Counterattack
 | 
			
		||||
Debuff({ 13812, 14314, 14315, 27026 }, { stacking = true, buffType = "physical", preEvent = "SPELL_CAST_SUCCESS" }, "HUNTER") -- Explosive Trap
 | 
			
		||||
Debuff({ 19229, 47168 }, { buffType = "physical", }, "HUNTER") -- Wing Clip Root
 | 
			
		||||
Debuff({ 19306, 20909, 20910, 27067, 48998, 48999 }, { buffType = "physical"}, "HUNTER") -- Counterattack
 | 
			
		||||
Debuff({ 13812, 14314, 14315, 27026, 49064, 49065 }, { stacking = true, buffType = "physical", preEvent = "SPELL_CAST_SUCCESS" }, "HUNTER") -- Explosive Trap
 | 
			
		||||
Debuff({ 13797, 14298, 14299, 14300, 14301, 27024 }, { stacking = true, buffType = "magic", preEvent = "SPELL_CAST_SUCCESS" }, "HUNTER") -- Immolation Trap
 | 
			
		||||
Debuff({ 3355, 14308, 14309 }, { buffType = "magic" }, "HUNTER") -- Freezing Trap
 | 
			
		||||
Debuff({ 19503 }, { buffType = "physical" }, "HUNTER") -- Scatter Shot
 | 
			
		||||
Debuff({ 2974, 14267, 14268 }, { buffType = "physical" }, "HUNTER") -- Wing Clip
 | 
			
		||||
Debuff({ 2974 }, { buffType = "physical" }, "HUNTER") -- Wing Clip
 | 
			
		||||
Debuff({ 19229, 47168 }, { buffType = "physical" }, "HUNTER") -- Improved Wing Clip
 | 
			
		||||
Debuff({ 5116 }, { buffType = "physical" }, "HUNTER") -- Concussive Shot
 | 
			
		||||
Debuff({ 19410 }, { buffType = "physical" }, "HUNTER") -- Conc Stun
 | 
			
		||||
Debuff({ 24394 }, { buffType = "physical" }, "HUNTER") -- Intimidation
 | 
			
		||||
Debuff({ 15571 }, { buffType = "physical" }, "HUNTER") -- Daze from Aspect
 | 
			
		||||
Debuff({ 19185 }, { buffType = "physical" }, "HUNTER") -- Entrapment
 | 
			
		||||
Debuff({ 25999 }, { buffType = "physical" }, "HUNTER") -- Boar Charge
 | 
			
		||||
Debuff({ 24640, 24583, 24586, 24587, 27060 }, { buffType = "poison" }, "HUNTER") -- Scorpid Poison
 | 
			
		||||
Debuff({ 24640, 24583, 24586, 24587, 27060, 55728 }, { buffType = "poison" }, "HUNTER") -- Scorpid Poison
 | 
			
		||||
Debuff({ 60053 }, { buffType = "magic" }, "HUNTER") -- Explosive Shot
 | 
			
		||||
Debuff({ 63468 }, { buffType = "physical" }, "HUNTER") -- Piercing Shots
 | 
			
		||||
Debuff({ 3674 }, { buffType = "magic" }, "HUNTER") -- Black Arrow
 | 
			
		||||
Debuff({ 60210 }, { buffType = "magic" }, "HUNTER") -- Freezing Arrow effect
 | 
			
		||||
 | 
			
		||||
-------------
 | 
			
		||||
-- MAGE
 | 
			
		||||
-------------
 | 
			
		||||
 | 
			
		||||
Debuff({ 133, 143, 145, 3140, 8400, 8401, 8402, 10148, 10149, 10150, 10151, 25306, 27070 }, { buffType = "magic"}, "MAGE") -- Fireball
 | 
			
		||||
Debuff({ 11366, 12505, 12522, 12523, 12524, 12525, 12526, 18809, 27132, 33938 }, { buffType = "magic" }, "MAGE") -- Pyroblast
 | 
			
		||||
Debuff({ 133, 143, 145, 3140, 8400, 8401, 8402, 10148, 10149, 10150, 10151, 25306, 27070, 38692, 42832, 42833 }, { buffType = "magic"}, "MAGE") -- Fireball
 | 
			
		||||
Debuff({ 11366, 12505, 12522, 12523, 12524, 12525, 12526, 18809, 27132, 33938, 42890, 42891 }, { buffType = "magic" }, "MAGE") -- Pyroblast
 | 
			
		||||
Debuff({ 18469 }, { buffType = "magic" }, "MAGE") -- Imp CS Silence
 | 
			
		||||
Debuff({ 118, 12824, 12825, 12826 }, { buffType = "magic" }, "MAGE") -- Polymorph
 | 
			
		||||
Debuff({ 118, 12824, 12825, 12826, 61721, 61305, 61780 }, { buffType = "magic" }, "MAGE") -- Polymorph
 | 
			
		||||
Debuff({ 12355 } , { buffType = "physical" }, "MAGE") -- Impact
 | 
			
		||||
Debuff({ 12654 }, { buffType = "magic" }, "MAGE") -- Ignite
 | 
			
		||||
Debuff({ 22959 }, { buffType = "magic" }, "MAGE") -- Fire Vulnerability
 | 
			
		||||
Debuff({ 12579 }, { buffType = "magic" }, "MAGE") -- Winter's Chill
 | 
			
		||||
Debuff({ 11113, 13018, 13019, 13020, 13021, 27133, 33933 }, { buffType = "physical" }, "MAGE") -- Blast Wave
 | 
			
		||||
Debuff({ 11113, 13018, 13019, 13020, 13021, 27133, 33933, 42944, 42945 }, { buffType = "physical" }, "MAGE") -- Blast Wave
 | 
			
		||||
--Spell({ 2120, 2121, 8422, 8423, 10215, 10216, 27086 }, { stacking = true, buffType = "physical" }) -- Flamestrike
 | 
			
		||||
Debuff({ 120, 8492, 10159, 10160, 10161, 27087 }, { buffType = "magic" }, "MAGE") -- Cone of Cold
 | 
			
		||||
Debuff({ 120, 8492, 10159, 10160, 10161, 27087, 42930, 42931 }, { buffType = "magic" }, "MAGE") -- Cone of Cold
 | 
			
		||||
Debuff({ 12484, 12485, 12486 }, { .5 }) -- Improved Blizzard (Chilled)
 | 
			
		||||
Debuff({ 6136, 7321, 18101, 20005, 16927, 15850, 31257}, { buffType = "magic" }, "MAGE") -- Frost/Ice Armor (Chilled)
 | 
			
		||||
Debuff({ 116, 205, 837, 7322, 8406, 8407, 8408, 10179, 10180, 10181, 25304, 27071, 27072, 38697 }, { buffType = "magic" }, "MAGE") -- Frostbolt
 | 
			
		||||
Debuff({ 116, 205, 837, 7322, 8406, 8407, 8408, 10179, 10180, 10181, 25304, 27071, 27072, 38697, 42841, 42842 }, { buffType = "magic" }, "MAGE") -- Frostbolt
 | 
			
		||||
Debuff({ 12494 }, { buffType = "magic" }, "MAGE") -- Frostbite
 | 
			
		||||
Debuff({ 122, 865, 6131, 10230 }, { buffType = "magic" }, "MAGE") -- Frost Nova
 | 
			
		||||
Debuff({ 122, 865, 6131, 10230, 27088, 42917 }, { buffType = "magic" }, "MAGE") -- Frost Nova
 | 
			
		||||
Debuff({ 31589 }, { buffType = "magic" }, "MAGE") -- Slow
 | 
			
		||||
Debuff({ 41425 }, { buffType = "immune" }, "MAGE") -- Hypothermia
 | 
			
		||||
Debuff({ 41425 }, { buffType = "immune" }, "MAGE") -- Hypothermia
 | 
			
		||||
Debuff({ 44572 }, { buffType = "magic" }, "MAGE") -- Deep Freeze
 | 
			
		||||
Debuff({ 55360 }, { buffType = "magic" }, "MAGE") -- Living Bomb
 | 
			
		||||
Debuff({ 64346 }, { buffType = "magic" }, "MAGE") -- Fiery Payback
 | 
			
		||||
Debuff({ 44614, 47610 }, { buffType = "magic" }, "MAGE") -- Frostfire Bolt
 | 
			
		||||
Debuff({ 31661, 33041, 33042, 33043, 42949, 42950 }, { buffType = "magic" }, "MAGE") -- Dragon's Breath
 | 
			
		||||
Debuff({ 36032 }, { }, "MAGE") -- Arcane Blast
 | 
			
		||||
Debuff({ 55080 }, { buffType = "magic" }, "MAGE") -- Shattered Barrier
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
-------------
 | 
			
		||||
-- Death Knight
 | 
			
		||||
-------------
 | 
			
		||||
Debuff({ 55095 }, { buffType = "disease" }, "DEATHKNIGHT") -- Frost Fever
 | 
			
		||||
Debuff({ 55078 }, { buffType = "disease" }, "DEATHKNIGHT") -- Blood Plague
 | 
			
		||||
Debuff({ 50510 }, { buffType = "disease" }, "DEATHKNIGHT") -- Crypt Fever
 | 
			
		||||
Debuff({ 51735 }, { buffType = "disease" }, "DEATHKNIGHT") -- Ebon Plague
 | 
			
		||||
Debuff({ 50536 }, { buffType = "physical" }, "DEATHKNIGHT") -- Unholy Blight
 | 
			
		||||
Debuff({ 51209	}, { buffType = "magic" }, "DEATHKNIGHT") -- Hungering Cold
 | 
			
		||||
Debuff({ 47476	}, { buffType = "magic" }, "DEATHKNIGHT") -- Strangulate
 | 
			
		||||
Debuff({ 43265, 49936, 49937, 49938 }, { buffType = "physical" }, "DEATHKNIGHT") -- Death and decay
 | 
			
		||||
Debuff({ 45524 }, { buffType = "magic" }, "DEATHKNIGHT") -- Chains of Ice
 | 
			
		||||
Debuff({ 66803 }, { buffType = "physical" }, "DEATHKNIGHT") -- Desecration
 | 
			
		||||
Debuff({ 50436 }, { buffType = "physical" }, "DEATHKNIGHT") -- Icy Clutch
 | 
			
		||||
Debuff({ 49005 }, { buffType = "physical" }, "DEATHKNIGHT") -- Mark of Blood
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -9,20 +9,31 @@ LibClassAuras.buffs = {}
 | 
			
		||||
LibClassAuras.buffToId = {}
 | 
			
		||||
LibClassAuras.altNames = {}
 | 
			
		||||
 | 
			
		||||
LibClassAuras.gameExpansion = ({
 | 
			
		||||
    [WOW_PROJECT_MAINLINE] = "retail",
 | 
			
		||||
    [WOW_PROJECT_CLASSIC] = "classic",
 | 
			
		||||
    [WOW_PROJECT_BURNING_CRUSADE_CLASSIC or 5] = "tbc"
 | 
			
		||||
})[WOW_PROJECT_ID]
 | 
			
		||||
 | 
			
		||||
local function Spell(id, opts, class, spellTable, idTable)
 | 
			
		||||
    if not opts or not class then
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    local lastRankID
 | 
			
		||||
    local spellName
 | 
			
		||||
    if type(id) == "table" then
 | 
			
		||||
        local clones = id
 | 
			
		||||
        lastRankID = clones[#clones]
 | 
			
		||||
        local realIds = {}
 | 
			
		||||
        for i = 1, #id do
 | 
			
		||||
            if GetSpellInfo(id[i]) then
 | 
			
		||||
                tinsert(realIds, id[i])
 | 
			
		||||
                spellName = GetSpellInfo(id[i])
 | 
			
		||||
            end
 | 
			
		||||
        end
 | 
			
		||||
        id = realIds
 | 
			
		||||
    else
 | 
			
		||||
        lastRankID = id
 | 
			
		||||
        spellName = GetSpellInfo(id)
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    local spellName = GetSpellInfo(lastRankID)
 | 
			
		||||
    
 | 
			
		||||
    if not spellName then
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										711
									
								
								Libs/LibCustomGlow-1.0/LibCustomGlow-1.0.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										711
									
								
								Libs/LibCustomGlow-1.0/LibCustomGlow-1.0.lua
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,711 @@
 | 
			
		||||
--[[
 | 
			
		||||
This library contains work of Hendrick "nevcairiel" Leppkes
 | 
			
		||||
https://www.wowace.com/projects/libbuttonglow-1-0
 | 
			
		||||
]]
 | 
			
		||||
 | 
			
		||||
-- luacheck: globals CreateFromMixins ObjectPoolMixin CreateTexturePool CreateFramePool
 | 
			
		||||
 | 
			
		||||
local MAJOR_VERSION = "LibCustomGlow-1.0"
 | 
			
		||||
local MINOR_VERSION = 16
 | 
			
		||||
if not LibStub then error(MAJOR_VERSION .. " requires LibStub.") end
 | 
			
		||||
local lib, oldversion = LibStub:NewLibrary(MAJOR_VERSION, MINOR_VERSION)
 | 
			
		||||
if not lib then return end
 | 
			
		||||
local Masque = LibStub("Masque", true)
 | 
			
		||||
 | 
			
		||||
local isRetail = WOW_PROJECT_ID == WOW_PROJECT_MAINLINE
 | 
			
		||||
local textureList = {
 | 
			
		||||
    empty = [[Interface\AdventureMap\BrokenIsles\AM_29]],
 | 
			
		||||
    white = [[Interface\BUTTONS\WHITE8X8]],
 | 
			
		||||
    shine = [[Interface\ItemSocketingFrame\UI-ItemSockets]]
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
local shineCoords = {0.3984375, 0.4453125, 0.40234375, 0.44921875}
 | 
			
		||||
if isRetail then
 | 
			
		||||
    textureList.shine = [[Interface\Artifacts\Artifacts]]
 | 
			
		||||
    shineCoords = {0.8115234375,0.9169921875,0.8798828125,0.9853515625}
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function lib.RegisterTextures(texture,id)
 | 
			
		||||
    textureList[id] = texture
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
lib.glowList = {}
 | 
			
		||||
lib.startList = {}
 | 
			
		||||
lib.stopList = {}
 | 
			
		||||
 | 
			
		||||
local GlowParent = UIParent
 | 
			
		||||
 | 
			
		||||
local GlowMaskPool = CreateFromMixins(ObjectPoolMixin)
 | 
			
		||||
lib.GlowMaskPool = GlowMaskPool
 | 
			
		||||
local function MaskPoolFactory(maskPool)
 | 
			
		||||
    return maskPool.parent:CreateMaskTexture()
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local MaskPoolResetter = function(maskPool,mask)
 | 
			
		||||
    mask:Hide()
 | 
			
		||||
    mask:ClearAllPoints()
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
ObjectPoolMixin.OnLoad(GlowMaskPool,MaskPoolFactory,MaskPoolResetter)
 | 
			
		||||
GlowMaskPool.parent =  GlowParent
 | 
			
		||||
 | 
			
		||||
local TexPoolResetter = function(pool,tex)
 | 
			
		||||
    local maskNum = tex:GetNumMaskTextures()
 | 
			
		||||
    for i = maskNum,1 do
 | 
			
		||||
        tex:RemoveMaskTexture(tex:GetMaskTexture(i))
 | 
			
		||||
    end
 | 
			
		||||
    tex:Hide()
 | 
			
		||||
    tex:ClearAllPoints()
 | 
			
		||||
end
 | 
			
		||||
local GlowTexPool = CreateTexturePool(GlowParent ,"ARTWORK",7,nil,TexPoolResetter)
 | 
			
		||||
lib.GlowTexPool = GlowTexPool
 | 
			
		||||
 | 
			
		||||
local FramePoolResetter = function(framePool,frame)
 | 
			
		||||
    frame:SetScript("OnUpdate",nil)
 | 
			
		||||
    local parent = frame:GetParent()
 | 
			
		||||
    if parent[frame.name] then
 | 
			
		||||
        parent[frame.name] = nil
 | 
			
		||||
    end
 | 
			
		||||
    if frame.textures then
 | 
			
		||||
        for _, texture in pairs(frame.textures) do
 | 
			
		||||
            GlowTexPool:Release(texture)
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
    if frame.bg then
 | 
			
		||||
        GlowTexPool:Release(frame.bg)
 | 
			
		||||
        frame.bg = nil
 | 
			
		||||
    end
 | 
			
		||||
    if frame.masks then
 | 
			
		||||
        for _,mask in pairs(frame.masks) do
 | 
			
		||||
            GlowMaskPool:Release(mask)
 | 
			
		||||
        end
 | 
			
		||||
        frame.masks = nil
 | 
			
		||||
    end
 | 
			
		||||
    frame.textures = {}
 | 
			
		||||
    frame.info = {}
 | 
			
		||||
    frame.name = nil
 | 
			
		||||
    frame.timer = nil
 | 
			
		||||
    frame:Hide()
 | 
			
		||||
    frame:ClearAllPoints()
 | 
			
		||||
end
 | 
			
		||||
local GlowFramePool = CreateFramePool("Frame",GlowParent,nil,FramePoolResetter)
 | 
			
		||||
lib.GlowFramePool = GlowFramePool
 | 
			
		||||
 | 
			
		||||
local function addFrameAndTex(r,color,name,key,N,xOffset,yOffset,texture,texCoord,desaturated,frameLevel)
 | 
			
		||||
    key = key or ""
 | 
			
		||||
	frameLevel = frameLevel or 8
 | 
			
		||||
    if not r[name..key] then
 | 
			
		||||
        r[name..key] = GlowFramePool:Acquire()
 | 
			
		||||
        r[name..key]:SetParent(r)
 | 
			
		||||
        r[name..key].name = name..key
 | 
			
		||||
    end
 | 
			
		||||
    local f = r[name..key]
 | 
			
		||||
	f:SetFrameLevel(r:GetFrameLevel()+frameLevel)
 | 
			
		||||
    f:SetPoint("TOPLEFT",r,"TOPLEFT",-xOffset+0.05,yOffset+0.05)
 | 
			
		||||
    f:SetPoint("BOTTOMRIGHT",r,"BOTTOMRIGHT",xOffset,-yOffset+0.05)
 | 
			
		||||
    f:Show()
 | 
			
		||||
 | 
			
		||||
    if not f.textures then
 | 
			
		||||
        f.textures = {}
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    for i=1,N do
 | 
			
		||||
        if not f.textures[i] then
 | 
			
		||||
            f.textures[i] = GlowTexPool:Acquire()
 | 
			
		||||
            f.textures[i]:SetTexture(texture)
 | 
			
		||||
            f.textures[i]:SetTexCoord(texCoord[1],texCoord[2],texCoord[3],texCoord[4])
 | 
			
		||||
            f.textures[i]:SetDesaturated(desaturated)
 | 
			
		||||
            f.textures[i]:SetParent(f)
 | 
			
		||||
            f.textures[i]:SetDrawLayer("ARTWORK",7)
 | 
			
		||||
            if not isRetail and name == "_AutoCastGlow" then
 | 
			
		||||
                f.textures[i]:SetBlendMode("ADD")
 | 
			
		||||
            end
 | 
			
		||||
        end
 | 
			
		||||
        f.textures[i]:SetVertexColor(color[1],color[2],color[3],color[4])
 | 
			
		||||
        f.textures[i]:Show()
 | 
			
		||||
    end
 | 
			
		||||
    while #f.textures>N do
 | 
			
		||||
        GlowTexPool:Release(f.textures[#f.textures])
 | 
			
		||||
        table.remove(f.textures)
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
--Pixel Glow Functions--
 | 
			
		||||
local pCalc1 = function(progress,s,th,p)
 | 
			
		||||
    local c
 | 
			
		||||
    if progress>p[3] or progress<p[0] then
 | 
			
		||||
        c = 0
 | 
			
		||||
    elseif progress>p[2] then
 | 
			
		||||
        c =s-th-(progress-p[2])/(p[3]-p[2])*(s-th)
 | 
			
		||||
    elseif progress>p[1] then
 | 
			
		||||
        c =s-th
 | 
			
		||||
    else
 | 
			
		||||
        c = (progress-p[0])/(p[1]-p[0])*(s-th)
 | 
			
		||||
    end
 | 
			
		||||
    return math.floor(c+0.5)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local pCalc2 = function(progress,s,th,p)
 | 
			
		||||
    local c
 | 
			
		||||
    if progress>p[3] then
 | 
			
		||||
        c = s-th-(progress-p[3])/(p[0]+1-p[3])*(s-th)
 | 
			
		||||
    elseif progress>p[2] then
 | 
			
		||||
        c = s-th
 | 
			
		||||
    elseif progress>p[1] then
 | 
			
		||||
        c = (progress-p[1])/(p[2]-p[1])*(s-th)
 | 
			
		||||
    elseif progress>p[0] then
 | 
			
		||||
        c = 0
 | 
			
		||||
    else
 | 
			
		||||
        c = s-th-(progress+1-p[3])/(p[0]+1-p[3])*(s-th)
 | 
			
		||||
    end
 | 
			
		||||
    return math.floor(c+0.5)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local  pUpdate = function(self,elapsed)
 | 
			
		||||
    self.timer = self.timer+elapsed/self.info.period
 | 
			
		||||
    if self.timer>1 or self.timer <-1 then
 | 
			
		||||
        self.timer = self.timer%1
 | 
			
		||||
    end
 | 
			
		||||
    local progress = self.timer
 | 
			
		||||
    local width,height = self:GetSize()
 | 
			
		||||
    if width ~= self.info.width or height ~= self.info.height then
 | 
			
		||||
        local perimeter = 2*(width+height)
 | 
			
		||||
        if not (perimeter>0) then
 | 
			
		||||
            return
 | 
			
		||||
        end
 | 
			
		||||
        self.info.width = width
 | 
			
		||||
        self.info.height = height
 | 
			
		||||
        self.info.pTLx = {
 | 
			
		||||
            [0] = (height+self.info.length/2)/perimeter,
 | 
			
		||||
            [1] = (height+width+self.info.length/2)/perimeter,
 | 
			
		||||
            [2] = (2*height+width-self.info.length/2)/perimeter,
 | 
			
		||||
            [3] = 1-self.info.length/2/perimeter
 | 
			
		||||
        }
 | 
			
		||||
        self.info.pTLy ={
 | 
			
		||||
            [0] = (height-self.info.length/2)/perimeter,
 | 
			
		||||
            [1] = (height+width+self.info.length/2)/perimeter,
 | 
			
		||||
            [2] = (height*2+width+self.info.length/2)/perimeter,
 | 
			
		||||
            [3] = 1-self.info.length/2/perimeter
 | 
			
		||||
        }
 | 
			
		||||
        self.info.pBRx ={
 | 
			
		||||
            [0] = self.info.length/2/perimeter,
 | 
			
		||||
            [1] = (height-self.info.length/2)/perimeter,
 | 
			
		||||
            [2] = (height+width-self.info.length/2)/perimeter,
 | 
			
		||||
            [3] = (height*2+width+self.info.length/2)/perimeter
 | 
			
		||||
        }
 | 
			
		||||
        self.info.pBRy ={
 | 
			
		||||
            [0] = self.info.length/2/perimeter,
 | 
			
		||||
            [1] = (height+self.info.length/2)/perimeter,
 | 
			
		||||
            [2] = (height+width-self.info.length/2)/perimeter,
 | 
			
		||||
            [3] = (height*2+width-self.info.length/2)/perimeter
 | 
			
		||||
        }
 | 
			
		||||
    end
 | 
			
		||||
    if self:IsShown() then
 | 
			
		||||
        if not (self.masks[1]:IsShown()) then
 | 
			
		||||
            self.masks[1]:Show()
 | 
			
		||||
            self.masks[1]:SetPoint("TOPLEFT",self,"TOPLEFT",self.info.th,-self.info.th)
 | 
			
		||||
            self.masks[1]:SetPoint("BOTTOMRIGHT",self,"BOTTOMRIGHT",-self.info.th,self.info.th)
 | 
			
		||||
        end
 | 
			
		||||
        if self.masks[2] and not(self.masks[2]:IsShown()) then
 | 
			
		||||
            self.masks[2]:Show()
 | 
			
		||||
            self.masks[2]:SetPoint("TOPLEFT",self,"TOPLEFT",self.info.th+1,-self.info.th-1)
 | 
			
		||||
            self.masks[2]:SetPoint("BOTTOMRIGHT",self,"BOTTOMRIGHT",-self.info.th-1,self.info.th+1)
 | 
			
		||||
        end
 | 
			
		||||
        if self.bg and not(self.bg:IsShown()) then
 | 
			
		||||
            self.bg:Show()
 | 
			
		||||
        end
 | 
			
		||||
        for k,line  in pairs(self.textures) do
 | 
			
		||||
            line:SetPoint("TOPLEFT",self,"TOPLEFT",pCalc1((progress+self.info.step*(k-1))%1,width,self.info.th,self.info.pTLx),-pCalc2((progress+self.info.step*(k-1))%1,height,self.info.th,self.info.pTLy))
 | 
			
		||||
            line:SetPoint("BOTTOMRIGHT",self,"TOPLEFT",self.info.th+pCalc2((progress+self.info.step*(k-1))%1,width,self.info.th,self.info.pBRx),-height+pCalc1((progress+self.info.step*(k-1))%1,height,self.info.th,self.info.pBRy))
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function lib.PixelGlow_Start(r,color,N,frequency,length,th,xOffset,yOffset,border,key,frameLevel)
 | 
			
		||||
    if not r then
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
    if not color then
 | 
			
		||||
        color = {0.95,0.95,0.32,1}
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    if not(N and N>0) then
 | 
			
		||||
        N = 8
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    local period
 | 
			
		||||
    if frequency then
 | 
			
		||||
        if not(frequency>0 or frequency<0) then
 | 
			
		||||
            period = 4
 | 
			
		||||
        else
 | 
			
		||||
            period = 1/frequency
 | 
			
		||||
        end
 | 
			
		||||
    else
 | 
			
		||||
        period = 4
 | 
			
		||||
    end
 | 
			
		||||
    local width,height = r:GetSize()
 | 
			
		||||
    length = length or math.floor((width+height)*(2/N-0.1))
 | 
			
		||||
    length = min(length,min(width,height))
 | 
			
		||||
    th = th or 1
 | 
			
		||||
    xOffset = xOffset or 0
 | 
			
		||||
    yOffset = yOffset or 0
 | 
			
		||||
    key = key or ""
 | 
			
		||||
 | 
			
		||||
    addFrameAndTex(r,color,"_PixelGlow",key,N,xOffset,yOffset,textureList.white,{0,1,0,1},nil,frameLevel)
 | 
			
		||||
    local f = r["_PixelGlow"..key]
 | 
			
		||||
    if not f.masks then
 | 
			
		||||
        f.masks = {}
 | 
			
		||||
    end
 | 
			
		||||
    if not f.masks[1] then
 | 
			
		||||
        f.masks[1] = GlowMaskPool:Acquire()
 | 
			
		||||
        f.masks[1]:SetTexture(textureList.empty, "CLAMPTOWHITE","CLAMPTOWHITE")
 | 
			
		||||
        f.masks[1]:Show()
 | 
			
		||||
    end
 | 
			
		||||
    f.masks[1]:SetPoint("TOPLEFT",f,"TOPLEFT",th,-th)
 | 
			
		||||
    f.masks[1]:SetPoint("BOTTOMRIGHT",f,"BOTTOMRIGHT",-th,th)
 | 
			
		||||
 | 
			
		||||
    if not(border==false) then
 | 
			
		||||
        if not f.masks[2] then
 | 
			
		||||
            f.masks[2] = GlowMaskPool:Acquire()
 | 
			
		||||
            f.masks[2]:SetTexture(textureList.empty, "CLAMPTOWHITE","CLAMPTOWHITE")
 | 
			
		||||
        end
 | 
			
		||||
        f.masks[2]:SetPoint("TOPLEFT",f,"TOPLEFT",th+1,-th-1)
 | 
			
		||||
        f.masks[2]:SetPoint("BOTTOMRIGHT",f,"BOTTOMRIGHT",-th-1,th+1)
 | 
			
		||||
 | 
			
		||||
        if not f.bg then
 | 
			
		||||
            f.bg = GlowTexPool:Acquire()
 | 
			
		||||
            f.bg:SetColorTexture(0.1,0.1,0.1,0.8)
 | 
			
		||||
            f.bg:SetParent(f)
 | 
			
		||||
            f.bg:SetAllPoints(f)
 | 
			
		||||
            f.bg:SetDrawLayer("ARTWORK",6)
 | 
			
		||||
            f.bg:AddMaskTexture(f.masks[2])
 | 
			
		||||
        end
 | 
			
		||||
    else
 | 
			
		||||
        if f.bg then
 | 
			
		||||
            GlowTexPool:Release(f.bg)
 | 
			
		||||
            f.bg = nil
 | 
			
		||||
        end
 | 
			
		||||
        if f.masks[2] then
 | 
			
		||||
            GlowMaskPool:Release(f.masks[2])
 | 
			
		||||
            f.masks[2] = nil
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
    for _,tex in pairs(f.textures) do
 | 
			
		||||
        if tex:GetNumMaskTextures() < 1 then
 | 
			
		||||
            tex:AddMaskTexture(f.masks[1])
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
    f.timer = f.timer or 0
 | 
			
		||||
    f.info = f.info or {}
 | 
			
		||||
    f.info.step = 1/N
 | 
			
		||||
    f.info.period = period
 | 
			
		||||
    f.info.th = th
 | 
			
		||||
    if f.info.length ~= length then
 | 
			
		||||
        f.info.width = nil
 | 
			
		||||
        f.info.length = length
 | 
			
		||||
    end
 | 
			
		||||
    pUpdate(f, 0)
 | 
			
		||||
    f:SetScript("OnUpdate",pUpdate)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function lib.PixelGlow_Stop(r,key)
 | 
			
		||||
    if not r then
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
    key = key or ""
 | 
			
		||||
    if not r["_PixelGlow"..key] then
 | 
			
		||||
        return false
 | 
			
		||||
    else
 | 
			
		||||
        GlowFramePool:Release(r["_PixelGlow"..key])
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
table.insert(lib.glowList, "Pixel Glow")
 | 
			
		||||
lib.startList["Pixel Glow"] = lib.PixelGlow_Start
 | 
			
		||||
lib.stopList["Pixel Glow"] = lib.PixelGlow_Stop
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
--Autocast Glow Funcitons--
 | 
			
		||||
local function acUpdate(self,elapsed)
 | 
			
		||||
    local width,height = self:GetSize()
 | 
			
		||||
    if width ~= self.info.width or height ~= self.info.height then
 | 
			
		||||
        if width*height == 0 then return end -- Avoid division by zero
 | 
			
		||||
        self.info.width = width
 | 
			
		||||
        self.info.height = height
 | 
			
		||||
        self.info.perimeter = 2*(width+height)
 | 
			
		||||
        self.info.bottomlim = height*2+width
 | 
			
		||||
        self.info.rightlim = height+width
 | 
			
		||||
        self.info.space = self.info.perimeter/self.info.N
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    local texIndex = 0;
 | 
			
		||||
    for k=1,4 do
 | 
			
		||||
        self.timer[k] = self.timer[k]+elapsed/(self.info.period*k)
 | 
			
		||||
        if self.timer[k] > 1 or self.timer[k] <-1 then
 | 
			
		||||
            self.timer[k] = self.timer[k]%1
 | 
			
		||||
        end
 | 
			
		||||
        for i = 1,self.info.N do
 | 
			
		||||
            texIndex = texIndex+1
 | 
			
		||||
            local position = (self.info.space*i+self.info.perimeter*self.timer[k])%self.info.perimeter
 | 
			
		||||
            if position>self.info.bottomlim then
 | 
			
		||||
                self.textures[texIndex]: SetPoint("CENTER",self,"BOTTOMRIGHT",-position+self.info.bottomlim,0)
 | 
			
		||||
            elseif position>self.info.rightlim then
 | 
			
		||||
                self.textures[texIndex]: SetPoint("CENTER",self,"TOPRIGHT",0,-position+self.info.rightlim)
 | 
			
		||||
            elseif position>self.info.height then
 | 
			
		||||
                self.textures[texIndex]: SetPoint("CENTER",self,"TOPLEFT",position-self.info.height,0)
 | 
			
		||||
            else
 | 
			
		||||
                self.textures[texIndex]: SetPoint("CENTER",self,"BOTTOMLEFT",0,position)
 | 
			
		||||
            end
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function lib.AutoCastGlow_Start(r,color,N,frequency,scale,xOffset,yOffset,key,frameLevel)
 | 
			
		||||
    if not r then
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    if not color then
 | 
			
		||||
        color = {0.95,0.95,0.32,1}
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    if not(N and N>0) then
 | 
			
		||||
        N = 4
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    local period
 | 
			
		||||
    if frequency then
 | 
			
		||||
        if not(frequency>0 or frequency<0) then
 | 
			
		||||
            period = 8
 | 
			
		||||
        else
 | 
			
		||||
            period = 1/frequency
 | 
			
		||||
        end
 | 
			
		||||
    else
 | 
			
		||||
        period = 8
 | 
			
		||||
    end
 | 
			
		||||
    scale = scale or 1
 | 
			
		||||
    xOffset = xOffset or 0
 | 
			
		||||
    yOffset = yOffset or 0
 | 
			
		||||
    key = key or ""
 | 
			
		||||
 | 
			
		||||
    addFrameAndTex(r,color,"_AutoCastGlow",key,N*4,xOffset,yOffset,textureList.shine,shineCoords, true, frameLevel)
 | 
			
		||||
    local f = r["_AutoCastGlow"..key]
 | 
			
		||||
    local sizes = {7,6,5,4}
 | 
			
		||||
    for k,size in pairs(sizes) do
 | 
			
		||||
        for i = 1,N do
 | 
			
		||||
            f.textures[i+N*(k-1)]:SetSize(size*scale,size*scale)
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
    f.timer = f.timer or {0,0,0,0}
 | 
			
		||||
    f.info = f.info or {}
 | 
			
		||||
    f.info.N = N
 | 
			
		||||
    f.info.period = period
 | 
			
		||||
    f:SetScript("OnUpdate",acUpdate)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function lib.AutoCastGlow_Stop(r,key)
 | 
			
		||||
    if not r then
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    key = key or ""
 | 
			
		||||
    if not r["_AutoCastGlow"..key] then
 | 
			
		||||
        return false
 | 
			
		||||
    else
 | 
			
		||||
        GlowFramePool:Release(r["_AutoCastGlow"..key])
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
table.insert(lib.glowList, "Autocast Shine")
 | 
			
		||||
lib.startList["Autocast Shine"] = lib.AutoCastGlow_Start
 | 
			
		||||
lib.stopList["Autocast Shine"] = lib.AutoCastGlow_Stop
 | 
			
		||||
 | 
			
		||||
--Action Button Glow--
 | 
			
		||||
local function ButtonGlowResetter(framePool,frame)
 | 
			
		||||
    frame:SetScript("OnUpdate",nil)
 | 
			
		||||
    local parent = frame:GetParent()
 | 
			
		||||
    if parent._ButtonGlow then
 | 
			
		||||
        parent._ButtonGlow = nil
 | 
			
		||||
    end
 | 
			
		||||
    frame:Hide()
 | 
			
		||||
    frame:ClearAllPoints()
 | 
			
		||||
end
 | 
			
		||||
local ButtonGlowPool = CreateFramePool("Frame",GlowParent,nil,ButtonGlowResetter)
 | 
			
		||||
lib.ButtonGlowPool = ButtonGlowPool
 | 
			
		||||
 | 
			
		||||
local function CreateScaleAnim(group, target, order, duration, x, y, delay)
 | 
			
		||||
    local scale = group:CreateAnimation("Scale")
 | 
			
		||||
    scale:SetChildKey(target)
 | 
			
		||||
    scale:SetOrder(order)
 | 
			
		||||
    scale:SetDuration(duration)
 | 
			
		||||
    scale:SetScale(x, y)
 | 
			
		||||
 | 
			
		||||
    if delay then
 | 
			
		||||
        scale:SetStartDelay(delay)
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local function CreateAlphaAnim(group, target, order, duration, fromAlpha, toAlpha, delay, appear)
 | 
			
		||||
    local alpha = group:CreateAnimation("Alpha")
 | 
			
		||||
    alpha:SetChildKey(target)
 | 
			
		||||
    alpha:SetOrder(order)
 | 
			
		||||
    alpha:SetDuration(duration)
 | 
			
		||||
    alpha:SetFromAlpha(fromAlpha)
 | 
			
		||||
    alpha:SetToAlpha(toAlpha)
 | 
			
		||||
    if delay then
 | 
			
		||||
        alpha:SetStartDelay(delay)
 | 
			
		||||
    end
 | 
			
		||||
    if appear then
 | 
			
		||||
        table.insert(group.appear, alpha)
 | 
			
		||||
    else
 | 
			
		||||
        table.insert(group.fade, alpha)
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local function AnimIn_OnPlay(group)
 | 
			
		||||
    local frame = group:GetParent()
 | 
			
		||||
    local frameWidth, frameHeight = frame:GetSize()
 | 
			
		||||
    frame.spark:SetSize(frameWidth, frameHeight)
 | 
			
		||||
    frame.spark:SetAlpha(not(frame.color) and 1.0 or 0.3*frame.color[4])
 | 
			
		||||
    frame.innerGlow:SetSize(frameWidth / 2, frameHeight / 2)
 | 
			
		||||
    frame.innerGlow:SetAlpha(not(frame.color) and 1.0 or frame.color[4])
 | 
			
		||||
    frame.innerGlowOver:SetAlpha(not(frame.color) and 1.0 or frame.color[4])
 | 
			
		||||
    frame.outerGlow:SetSize(frameWidth * 2, frameHeight * 2)
 | 
			
		||||
    frame.outerGlow:SetAlpha(not(frame.color) and 1.0 or frame.color[4])
 | 
			
		||||
    frame.outerGlowOver:SetAlpha(not(frame.color) and 1.0 or frame.color[4])
 | 
			
		||||
    frame.ants:SetSize(frameWidth * 0.85, frameHeight * 0.85)
 | 
			
		||||
    frame.ants:SetAlpha(0)
 | 
			
		||||
    frame:Show()
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local function AnimIn_OnFinished(group)
 | 
			
		||||
    local frame = group:GetParent()
 | 
			
		||||
    local frameWidth, frameHeight = frame:GetSize()
 | 
			
		||||
    frame.spark:SetAlpha(0)
 | 
			
		||||
    frame.innerGlow:SetAlpha(0)
 | 
			
		||||
    frame.innerGlow:SetSize(frameWidth, frameHeight)
 | 
			
		||||
    frame.innerGlowOver:SetAlpha(0.0)
 | 
			
		||||
    frame.outerGlow:SetSize(frameWidth, frameHeight)
 | 
			
		||||
    frame.outerGlowOver:SetAlpha(0.0)
 | 
			
		||||
    frame.outerGlowOver:SetSize(frameWidth, frameHeight)
 | 
			
		||||
    frame.ants:SetAlpha(not(frame.color) and 1.0 or frame.color[4])
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local function AnimIn_OnStop(group)
 | 
			
		||||
    local frame = group:GetParent()
 | 
			
		||||
    local frameWidth, frameHeight = frame:GetSize()
 | 
			
		||||
    frame.spark:SetAlpha(0)
 | 
			
		||||
    frame.innerGlow:SetAlpha(0)
 | 
			
		||||
    frame.innerGlowOver:SetAlpha(0.0)
 | 
			
		||||
    frame.outerGlowOver:SetAlpha(0.0)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local function bgHide(self)
 | 
			
		||||
    if self.animOut:IsPlaying() then
 | 
			
		||||
        self.animOut:Stop()
 | 
			
		||||
        ButtonGlowPool:Release(self)
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local function bgUpdate(self, elapsed)
 | 
			
		||||
    AnimateTexCoords(self.ants, 256, 256, 48, 48, 22, elapsed, self.throttle);
 | 
			
		||||
    local cooldown = self:GetParent().cooldown;
 | 
			
		||||
    if(cooldown and cooldown:IsShown() and cooldown:GetCooldownDuration() > 3000) then
 | 
			
		||||
        self:SetAlpha(0.5);
 | 
			
		||||
    else
 | 
			
		||||
        self:SetAlpha(1.0);
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local function configureButtonGlow(f,alpha)
 | 
			
		||||
    f.spark = f:CreateTexture(nil, "BACKGROUND")
 | 
			
		||||
    f.spark:SetPoint("CENTER")
 | 
			
		||||
    f.spark:SetAlpha(0)
 | 
			
		||||
    f.spark:SetTexture([[Interface\SpellActivationOverlay\IconAlert]])
 | 
			
		||||
    f.spark:SetTexCoord(0.00781250, 0.61718750, 0.00390625, 0.26953125)
 | 
			
		||||
 | 
			
		||||
    -- inner glow
 | 
			
		||||
    f.innerGlow = f:CreateTexture(nil, "ARTWORK")
 | 
			
		||||
    f.innerGlow:SetPoint("CENTER")
 | 
			
		||||
    f.innerGlow:SetAlpha(0)
 | 
			
		||||
    f.innerGlow:SetTexture([[Interface\SpellActivationOverlay\IconAlert]])
 | 
			
		||||
    f.innerGlow:SetTexCoord(0.00781250, 0.50781250, 0.27734375, 0.52734375)
 | 
			
		||||
 | 
			
		||||
    -- inner glow over
 | 
			
		||||
    f.innerGlowOver = f:CreateTexture(nil, "ARTWORK")
 | 
			
		||||
    f.innerGlowOver:SetPoint("TOPLEFT", f.innerGlow, "TOPLEFT")
 | 
			
		||||
    f.innerGlowOver:SetPoint("BOTTOMRIGHT", f.innerGlow, "BOTTOMRIGHT")
 | 
			
		||||
    f.innerGlowOver:SetAlpha(0)
 | 
			
		||||
    f.innerGlowOver:SetTexture([[Interface\SpellActivationOverlay\IconAlert]])
 | 
			
		||||
    f.innerGlowOver:SetTexCoord(0.00781250, 0.50781250, 0.53515625, 0.78515625)
 | 
			
		||||
 | 
			
		||||
    -- outer glow
 | 
			
		||||
    f.outerGlow = f:CreateTexture(nil, "ARTWORK")
 | 
			
		||||
    f.outerGlow:SetPoint("CENTER")
 | 
			
		||||
    f.outerGlow:SetAlpha(0)
 | 
			
		||||
    f.outerGlow:SetTexture([[Interface\SpellActivationOverlay\IconAlert]])
 | 
			
		||||
    f.outerGlow:SetTexCoord(0.00781250, 0.50781250, 0.27734375, 0.52734375)
 | 
			
		||||
 | 
			
		||||
    -- outer glow over
 | 
			
		||||
    f.outerGlowOver = f:CreateTexture(nil, "ARTWORK")
 | 
			
		||||
    f.outerGlowOver:SetPoint("TOPLEFT", f.outerGlow, "TOPLEFT")
 | 
			
		||||
    f.outerGlowOver:SetPoint("BOTTOMRIGHT", f.outerGlow, "BOTTOMRIGHT")
 | 
			
		||||
    f.outerGlowOver:SetAlpha(0)
 | 
			
		||||
    f.outerGlowOver:SetTexture([[Interface\SpellActivationOverlay\IconAlert]])
 | 
			
		||||
    f.outerGlowOver:SetTexCoord(0.00781250, 0.50781250, 0.53515625, 0.78515625)
 | 
			
		||||
 | 
			
		||||
    -- ants
 | 
			
		||||
    f.ants = f:CreateTexture(nil, "OVERLAY")
 | 
			
		||||
    f.ants:SetPoint("CENTER")
 | 
			
		||||
    f.ants:SetAlpha(0)
 | 
			
		||||
    f.ants:SetTexture([[Interface\SpellActivationOverlay\IconAlertAnts]])
 | 
			
		||||
 | 
			
		||||
    f.animIn = f:CreateAnimationGroup()
 | 
			
		||||
    f.animIn.appear = {}
 | 
			
		||||
    f.animIn.fade = {}
 | 
			
		||||
    CreateScaleAnim(f.animIn, "spark",          1, 0.2, 1.5, 1.5)
 | 
			
		||||
    CreateAlphaAnim(f.animIn, "spark",          1, 0.2, 0, alpha, nil, true)
 | 
			
		||||
    CreateScaleAnim(f.animIn, "innerGlow",      1, 0.3, 2, 2)
 | 
			
		||||
    CreateScaleAnim(f.animIn, "innerGlowOver",  1, 0.3, 2, 2)
 | 
			
		||||
    CreateAlphaAnim(f.animIn, "innerGlowOver",  1, 0.3, alpha, 0, nil, false)
 | 
			
		||||
    CreateScaleAnim(f.animIn, "outerGlow",      1, 0.3, 0.5, 0.5)
 | 
			
		||||
    CreateScaleAnim(f.animIn, "outerGlowOver",  1, 0.3, 0.5, 0.5)
 | 
			
		||||
    CreateAlphaAnim(f.animIn, "outerGlowOver",  1, 0.3, alpha, 0, nil, false)
 | 
			
		||||
    CreateScaleAnim(f.animIn, "spark",          1, 0.2, 2/3, 2/3, 0.2)
 | 
			
		||||
    CreateAlphaAnim(f.animIn, "spark",          1, 0.2, alpha, 0, 0.2, false)
 | 
			
		||||
    CreateAlphaAnim(f.animIn, "innerGlow",      1, 0.2, alpha, 0, 0.3, false)
 | 
			
		||||
    CreateAlphaAnim(f.animIn, "ants",           1, 0.2, 0, alpha, 0.3, true)
 | 
			
		||||
    f.animIn:SetScript("OnPlay", AnimIn_OnPlay)
 | 
			
		||||
    f.animIn:SetScript("OnStop", AnimIn_OnStop)
 | 
			
		||||
    f.animIn:SetScript("OnFinished", AnimIn_OnFinished)
 | 
			
		||||
 | 
			
		||||
    f.animOut = f:CreateAnimationGroup()
 | 
			
		||||
    f.animOut.appear = {}
 | 
			
		||||
    f.animOut.fade = {}
 | 
			
		||||
    CreateAlphaAnim(f.animOut, "outerGlowOver", 1, 0.2, 0, alpha, nil, true)
 | 
			
		||||
    CreateAlphaAnim(f.animOut, "ants",          1, 0.2, alpha, 0, nil, false)
 | 
			
		||||
    CreateAlphaAnim(f.animOut, "outerGlowOver", 2, 0.2, alpha, 0, nil, false)
 | 
			
		||||
    CreateAlphaAnim(f.animOut, "outerGlow",     2, 0.2, alpha, 0, nil, false)
 | 
			
		||||
    f.animOut:SetScript("OnFinished", function(self) ButtonGlowPool:Release(self:GetParent())  end)
 | 
			
		||||
 | 
			
		||||
    f:SetScript("OnHide", bgHide)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local function updateAlphaAnim(f,alpha)
 | 
			
		||||
    for _,anim in pairs(f.animIn.appear) do
 | 
			
		||||
        anim:SetToAlpha(alpha)
 | 
			
		||||
    end
 | 
			
		||||
    for _,anim in pairs(f.animIn.fade) do
 | 
			
		||||
        anim:SetFromAlpha(alpha)
 | 
			
		||||
    end
 | 
			
		||||
    for _,anim in pairs(f.animOut.appear) do
 | 
			
		||||
        anim:SetToAlpha(alpha)
 | 
			
		||||
    end
 | 
			
		||||
    for _,anim in pairs(f.animOut.fade) do
 | 
			
		||||
        anim:SetFromAlpha(alpha)
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local ButtonGlowTextures = {["spark"] = true,["innerGlow"] = true,["innerGlowOver"] = true,["outerGlow"] = true,["outerGlowOver"] = true,["ants"] = true}
 | 
			
		||||
 | 
			
		||||
function lib.ButtonGlow_Start(r,color,frequency,frameLevel)
 | 
			
		||||
    if not r then
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
	frameLevel = frameLevel or 8;
 | 
			
		||||
    local throttle
 | 
			
		||||
    if frequency and frequency > 0 then
 | 
			
		||||
        throttle = 0.25/frequency*0.01
 | 
			
		||||
    else
 | 
			
		||||
        throttle = 0.01
 | 
			
		||||
    end
 | 
			
		||||
    if r._ButtonGlow then
 | 
			
		||||
        local f = r._ButtonGlow
 | 
			
		||||
        local width,height = r:GetSize()
 | 
			
		||||
        f:SetFrameLevel(r:GetFrameLevel()+frameLevel)
 | 
			
		||||
        f:SetSize(width*1.4 , height*1.4)
 | 
			
		||||
        f:SetPoint("TOPLEFT", r, "TOPLEFT", -width * 0.2, height * 0.2)
 | 
			
		||||
        f:SetPoint("BOTTOMRIGHT", r, "BOTTOMRIGHT", width * 0.2, -height * 0.2)
 | 
			
		||||
        f.ants:SetSize(width*1.4*0.85, height*1.4*0.85)
 | 
			
		||||
		AnimIn_OnFinished(f.animIn)
 | 
			
		||||
		if f.animOut:IsPlaying() then
 | 
			
		||||
            f.animOut:Stop()
 | 
			
		||||
            f.animIn:Play()
 | 
			
		||||
        end
 | 
			
		||||
 | 
			
		||||
        if not(color) then
 | 
			
		||||
            for texture in pairs(ButtonGlowTextures) do
 | 
			
		||||
                f[texture]:SetDesaturated(nil)
 | 
			
		||||
                f[texture]:SetVertexColor(1,1,1)
 | 
			
		||||
                f[texture]:SetAlpha(f[texture]:GetAlpha()/(f.color and f.color[4] or 1))
 | 
			
		||||
                updateAlphaAnim(f, 1)
 | 
			
		||||
            end
 | 
			
		||||
            f.color = false
 | 
			
		||||
        else
 | 
			
		||||
            for texture in pairs(ButtonGlowTextures) do
 | 
			
		||||
                f[texture]:SetDesaturated(1)
 | 
			
		||||
                f[texture]:SetVertexColor(color[1],color[2],color[3])
 | 
			
		||||
                f[texture]:SetAlpha(f[texture]:GetAlpha()/(f.color and f.color[4] or 1)*color[4])
 | 
			
		||||
                updateAlphaAnim(f,color and color[4] or 1)
 | 
			
		||||
            end
 | 
			
		||||
            f.color = color
 | 
			
		||||
        end
 | 
			
		||||
        f.throttle = throttle
 | 
			
		||||
    else
 | 
			
		||||
        local f, new = ButtonGlowPool:Acquire()
 | 
			
		||||
        if new then
 | 
			
		||||
            configureButtonGlow(f,color and color[4] or 1)
 | 
			
		||||
        else
 | 
			
		||||
            updateAlphaAnim(f,color and color[4] or 1)
 | 
			
		||||
        end
 | 
			
		||||
        r._ButtonGlow = f
 | 
			
		||||
        local width,height = r:GetSize()
 | 
			
		||||
        f:SetParent(r)
 | 
			
		||||
        f:SetFrameLevel(r:GetFrameLevel()+frameLevel)
 | 
			
		||||
        f:SetSize(width * 1.4, height * 1.4)
 | 
			
		||||
        f:SetPoint("TOPLEFT", r, "TOPLEFT", -width * 0.2, height * 0.2)
 | 
			
		||||
        f:SetPoint("BOTTOMRIGHT", r, "BOTTOMRIGHT", width * 0.2, -height * 0.2)
 | 
			
		||||
        if not(color) then
 | 
			
		||||
            f.color = false
 | 
			
		||||
            for texture in pairs(ButtonGlowTextures) do
 | 
			
		||||
                f[texture]:SetDesaturated(nil)
 | 
			
		||||
                f[texture]:SetVertexColor(1,1,1)
 | 
			
		||||
            end
 | 
			
		||||
        else
 | 
			
		||||
            f.color = color
 | 
			
		||||
            for texture in pairs(ButtonGlowTextures) do
 | 
			
		||||
                f[texture]:SetDesaturated(1)
 | 
			
		||||
                f[texture]:SetVertexColor(color[1],color[2],color[3])
 | 
			
		||||
            end
 | 
			
		||||
        end
 | 
			
		||||
        f.throttle = throttle
 | 
			
		||||
        f:SetScript("OnUpdate", bgUpdate)
 | 
			
		||||
 | 
			
		||||
        f.animIn:Play()
 | 
			
		||||
 | 
			
		||||
        if Masque and Masque.UpdateSpellAlert and (not r.overlay or not issecurevariable(r, "overlay")) then
 | 
			
		||||
            local old_overlay = r.overlay
 | 
			
		||||
            r.overlay = f
 | 
			
		||||
            Masque:UpdateSpellAlert(r)
 | 
			
		||||
            r.overlay = old_overlay
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function lib.ButtonGlow_Stop(r)
 | 
			
		||||
    if r._ButtonGlow then
 | 
			
		||||
        if r._ButtonGlow.animIn:IsPlaying() then
 | 
			
		||||
            r._ButtonGlow.animIn:Stop()
 | 
			
		||||
            ButtonGlowPool:Release(r._ButtonGlow)
 | 
			
		||||
        elseif r:IsVisible() then
 | 
			
		||||
            r._ButtonGlow.animOut:Play()
 | 
			
		||||
        else
 | 
			
		||||
            ButtonGlowPool:Release(r._ButtonGlow)
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
table.insert(lib.glowList, "Action Button Glow")
 | 
			
		||||
lib.startList["Action Button Glow"] = lib.ButtonGlow_Start
 | 
			
		||||
lib.stopList["Action Button Glow"] = lib.ButtonGlow_Stop
 | 
			
		||||
							
								
								
									
										12
									
								
								Libs/LibCustomGlow-1.0/LibCustomGlow-1.0.toc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								Libs/LibCustomGlow-1.0/LibCustomGlow-1.0.toc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,12 @@
 | 
			
		||||
## Interface: 80200
 | 
			
		||||
## Title: Lib: CustomGlow
 | 
			
		||||
## Notes: Creates custom glow functions
 | 
			
		||||
## Author: deezo
 | 
			
		||||
## X-Category: Library
 | 
			
		||||
## X-License: BSD
 | 
			
		||||
## Version: f15e6de
 | 
			
		||||
## OptionalDeps: Masque
 | 
			
		||||
 | 
			
		||||
LibStub\LibStub.lua
 | 
			
		||||
 | 
			
		||||
LibCustomGlow-1.0.xml
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
 | 
			
		||||
..\FrameXML\UI.xsd">
 | 
			
		||||
	<Script file="DRData-1.0.lua"/>
 | 
			
		||||
  <Script file = "LibCustomGlow-1.0.lua"/>
 | 
			
		||||
</Ui>
 | 
			
		||||
							
								
								
									
										51
									
								
								Libs/LibCustomGlow-1.0/README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										51
									
								
								Libs/LibCustomGlow-1.0/README.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,51 @@
 | 
			
		||||
Adds functions:
 | 
			
		||||
 | 
			
		||||
`PixelGlow_Start(frame[, color[, N[, frequency[, length[, th[, xOffset[, yOffset[, border[ ,key]]]]]]]])`
 | 
			
		||||
 | 
			
		||||
Starts glow over target frame with set parameters:
 | 
			
		||||
 | 
			
		||||
- frame - target frame to set glowing;
 | 
			
		||||
- color - {r,g,b,a}, color of lines and opacity, from 0 to 1. Defaul value is {0.95, 0.95, 0.32, 1};
 | 
			
		||||
- N - number of lines. Defaul value is 8;
 | 
			
		||||
- frequency - frequency, set to negative to inverse direction of rotation. Default value is 0.25;
 | 
			
		||||
- length - length of lines. Default value depends on region size and number of lines;
 | 
			
		||||
- th - thickness of lines. Default value is 2;
 | 
			
		||||
- xOffset,yOffset - offset of glow relative to region border;
 | 
			
		||||
- border - set to true to create border under lines;
 | 
			
		||||
- key - key of glow, allows for multiple glows on one frame;
 | 
			
		||||
 | 
			
		||||
`PixelGlow_Stop(frame[, key])`
 | 
			
		||||
 | 
			
		||||
Stops glow with set key over target frame
 | 
			
		||||
 | 
			
		||||
`AutoCastGlow_Start(frame[, color[, N[, frequency[, scale[, xOffset[, yOffset[, key]]]]]]])`
 | 
			
		||||
 | 
			
		||||
Starts glow over target frame with set parameters:
 | 
			
		||||
 | 
			
		||||
- frame - target frame to set glowing;
 | 
			
		||||
- color - {r,g,b,a}, color of particles and opacity, from 0 to 1. Defaul value is {0.95, 0.95, 0.32, 1};
 | 
			
		||||
- N - number of particle groups. Each group contains 4 particles. Defaul value is 4;
 | 
			
		||||
- frequency - frequency, set to negative to inverse direction of rotation. Default value is 0.125;
 | 
			
		||||
- scale - scale of particles;
 | 
			
		||||
- xOffset,yOffset - offset of glow relative to region border;
 | 
			
		||||
- key - key of glow, allows for multiple glows on one frame;
 | 
			
		||||
 | 
			
		||||
`AutoCastGlow_Stop(frame[, key])`
 | 
			
		||||
 | 
			
		||||
Stops glow with set key over target frame
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Blizzard glow is based heavily on https://www.wowace.com/projects/libbuttonglow-1-0
 | 
			
		||||
 | 
			
		||||
`ButtonGlow_Start(frame[, color[, frequency]]])`
 | 
			
		||||
 | 
			
		||||
Starts glow over target frame with set parameters:
 | 
			
		||||
 | 
			
		||||
- frame - target frame to set glowing;
 | 
			
		||||
- color - {r,g,b,a}, color of particles and opacity, from 0 to 1. Defaul value is {0.95, 0.95, 0.32, 1};
 | 
			
		||||
- frequency - frequency. Default value is 0.125;
 | 
			
		||||
- frameLevel - frameLevel. Default value is 8;
 | 
			
		||||
 | 
			
		||||
`ButtonGlow_Stop(frame)`
 | 
			
		||||
 | 
			
		||||
Stops glow over target frame
 | 
			
		||||
@@ -91,7 +91,7 @@ function Announcements:CAST_START(unit, spell)
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    if (self.RES_SPELLS[spell]) then
 | 
			
		||||
        self:Send(L["RESURRECTING: %s (%s)"]:format(button.name, button.classLoc), 3, RAID_CLASS_COLORS[button.class])
 | 
			
		||||
        self:Send(L["RESURRECTING: %s (%s)"]:format(button.name, button.classLoc), 3, RAID_CLASS_COLORS[button.class], unit)
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
@@ -105,7 +105,7 @@ function Announcements:ENEMY_SPOTTED(unit)
 | 
			
		||||
        if button.name == "Unknown" then
 | 
			
		||||
            button.name = UnitName(unit)
 | 
			
		||||
        end
 | 
			
		||||
        self:Send("ENEMY SPOTTED:" .. ("%s (%s)"):format(button.name, button.classLoc), 0, RAID_CLASS_COLORS[button.class])
 | 
			
		||||
        self:Send("ENEMY SPOTTED:" .. ("%s (%s)"):format(button.name, button.classLoc), 0, RAID_CLASS_COLORS[button.class], unit)
 | 
			
		||||
        self.enemy[unit] = true
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
@@ -118,7 +118,7 @@ function Announcements:UNIT_SPEC(unit, spec)
 | 
			
		||||
    if button.name == "Unknown" then
 | 
			
		||||
        button.name = UnitName(unit)
 | 
			
		||||
    end
 | 
			
		||||
    self:Send(L["SPEC DETECTED: %s - %s (%s)"]:format(button.name, spec, button.classLoc), 0, RAID_CLASS_COLORS[button.class])
 | 
			
		||||
    self:Send(L["SPEC DETECTED: %s - %s (%s)"]:format(button.name, spec, button.classLoc), 1, RAID_CLASS_COLORS[button.class], unit)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function Announcements:UNIT_HEALTH(unit, health, healthMax)
 | 
			
		||||
@@ -129,7 +129,7 @@ function Announcements:UNIT_HEALTH(unit, health, healthMax)
 | 
			
		||||
 | 
			
		||||
    local healthPercent = floor(health * 100 / healthMax)
 | 
			
		||||
    if (healthPercent < Gladdy.db.announcements.healthThreshold) then
 | 
			
		||||
        self:Send(L["LOW HEALTH: %s (%s)"]:format(button.name, button.classLoc), 10, RAID_CLASS_COLORS[button.class])
 | 
			
		||||
        self:Send(L["LOW HEALTH: %s (%s)"]:format(button.name, button.classLoc), 10, RAID_CLASS_COLORS[button.class], unit)
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
@@ -139,7 +139,7 @@ function Announcements:TRINKET_USED(unit)
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    self:Send(L["TRINKET USED: %s (%s)"]:format(button.name, button.classLoc), 0, RAID_CLASS_COLORS[button.class])
 | 
			
		||||
    self:Send(L["TRINKET USED: %s (%s)"]:format(button.name, button.classLoc), 1, RAID_CLASS_COLORS[button.class], unit)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function Announcements:TRINKET_READY(unit)
 | 
			
		||||
@@ -148,15 +148,15 @@ function Announcements:TRINKET_READY(unit)
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    self:Send(L["TRINKET READY: %s (%s)"]:format(button.name, button.classLoc), 3, RAID_CLASS_COLORS[button.class])
 | 
			
		||||
    self:Send(L["TRINKET READY: %s (%s)"]:format(button.name, button.classLoc), 1, RAID_CLASS_COLORS[button.class], unit)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function Announcements:SPELL_INTERRUPT(destUnit,spellID,spellName,spellSchool,extraSpellId,extraSpellName,extraSpellSchool)
 | 
			
		||||
    local button = Gladdy.buttons[destUnit]
 | 
			
		||||
function Announcements:SPELL_INTERRUPT(unit,spellID,spellName,spellSchool,extraSpellId,extraSpellName,extraSpellSchool)
 | 
			
		||||
    local button = Gladdy.buttons[unit]
 | 
			
		||||
    if (not button or not Gladdy.db.announcements.spellInterrupt) then
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
    self:Send(L["INTERRUPTED: %s (%s)"]:format(extraSpellName, button.name or ""), nil, RAID_CLASS_COLORS[button.class])
 | 
			
		||||
    self:Send(L["INTERRUPTED: %s (%s)"]:format(extraSpellName, button.name or ""), nil, RAID_CLASS_COLORS[button.class], unit)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function Announcements:AURA_GAIN(unit, auraType, spellID, spellName)
 | 
			
		||||
@@ -166,7 +166,7 @@ function Announcements:AURA_GAIN(unit, auraType, spellID, spellName)
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    if (spellName == self.DRINK_AURA) then
 | 
			
		||||
        self:Send(L["DRINKING: %s (%s)"]:format(button.name, button.classLoc), 3, RAID_CLASS_COLORS[button.class])
 | 
			
		||||
        self:Send(L["DRINKING: %s (%s)"]:format(button.name, button.classLoc), 3, RAID_CLASS_COLORS[button.class], unit)
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
@@ -174,16 +174,17 @@ function Announcements:SHADOWSIGHT(msg)
 | 
			
		||||
    self:Send(msg, 2)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function Announcements:Send(msg, throttle, color)
 | 
			
		||||
function Announcements:Send(msg, throttle, color, unit)
 | 
			
		||||
    if (throttle and throttle > 0) then
 | 
			
		||||
        if (not self.throttled[msg]) then
 | 
			
		||||
            self.throttled[msg] = GetTime() + throttle
 | 
			
		||||
            Gladdy:Debug("INFO", msg, "- NOT THROTTLED -", self.throttled[msg])
 | 
			
		||||
        elseif (self.throttled[msg] < GetTime()) then
 | 
			
		||||
            Gladdy:Debug("INFO", msg, "- THROTTLED OVER -", self.throttled[msg])
 | 
			
		||||
            self.throttled[msg] = GetTime() + throttle
 | 
			
		||||
        local throttledMsg = unit and msg .. unit or msg
 | 
			
		||||
        if (not self.throttled[throttledMsg]) then
 | 
			
		||||
            self.throttled[throttledMsg] = GetTime() + throttle
 | 
			
		||||
            Gladdy:Debug("INFO", throttledMsg, "- NOT THROTTLED -", self.throttled[throttledMsg])
 | 
			
		||||
        elseif (self.throttled[throttledMsg] < GetTime()) then
 | 
			
		||||
            Gladdy:Debug("INFO", throttledMsg, "- THROTTLED OVER -", self.throttled[throttledMsg])
 | 
			
		||||
            self.throttled[throttledMsg] = GetTime() + throttle
 | 
			
		||||
        else
 | 
			
		||||
            Gladdy:Debug("INFO", msg, "- THROTTLED -", self.throttled[msg])
 | 
			
		||||
            Gladdy:Debug("INFO", throttledMsg, "- THROTTLED -", self.throttled[throttledMsg])
 | 
			
		||||
            return
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,5 @@
 | 
			
		||||
local floor, str_len, tostring, str_sub, str_find, pairs = math.floor, string.len, tostring, string.sub, string.find, pairs
 | 
			
		||||
local str_find, pairs = string.find, pairs
 | 
			
		||||
local CreateFrame = CreateFrame
 | 
			
		||||
local GetTime = GetTime
 | 
			
		||||
 | 
			
		||||
local Gladdy = LibStub("Gladdy")
 | 
			
		||||
local L = Gladdy.L
 | 
			
		||||
@@ -17,7 +16,6 @@ end
 | 
			
		||||
 | 
			
		||||
function ACDFrame:Initialize()
 | 
			
		||||
    self.locale = Gladdy:GetArenaTimer()
 | 
			
		||||
    self.hidden = false
 | 
			
		||||
    self.countdown = -1
 | 
			
		||||
    self.texturePath = "Interface\\AddOns\\Gladdy\\Images\\Countdown\\";
 | 
			
		||||
 | 
			
		||||
@@ -53,6 +51,7 @@ function ACDFrame:Initialize()
 | 
			
		||||
        self:RegisterMessage("UNIT_SPEC")
 | 
			
		||||
    end
 | 
			
		||||
    self.faction = UnitFactionGroup("player")
 | 
			
		||||
    self:SetScript("OnEvent", ACDFrame.OnEvent)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function ACDFrame:UpdateFrameOnce()
 | 
			
		||||
@@ -83,55 +82,72 @@ function ACDFrame:UpdateFrameOnce()
 | 
			
		||||
    self.ACDNumOne:SetPoint("CENTER", self.ACDNumFrame, "CENTER", 0, 0)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function ACDFrame.OnUpdate(self, elapse)
 | 
			
		||||
    if (self.countdown > 0 and Gladdy.db.countdown) then
 | 
			
		||||
        self.hidden = false;
 | 
			
		||||
function ACDFrame:HideAll()
 | 
			
		||||
    self.ACDNumFrame:Hide()
 | 
			
		||||
    self.ACDNumTens:Hide()
 | 
			
		||||
    self.ACDNumOnes:Hide()
 | 
			
		||||
    self.ACDNumOne:Hide()
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function ACDFrame:CreateTicker(countdown)
 | 
			
		||||
    self.countdown = countdown
 | 
			
		||||
    if self.ticker and not self.ticker:IsCancelled() then
 | 
			
		||||
        self.ticker:Cancel()
 | 
			
		||||
    end
 | 
			
		||||
    self.ticker = C_Timer.NewTicker(1, ACDFrame.Ticker)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function ACDFrame.Ticker()
 | 
			
		||||
    local self = ACDFrame
 | 
			
		||||
    if (Gladdy.db.countdown) then
 | 
			
		||||
        self.ACDNumFrame:Show()
 | 
			
		||||
        if ((floor(self.countdown) ~= floor(self.countdown - elapse)) and (floor(self.countdown - elapse) >= 0)) then
 | 
			
		||||
            local str = tostring(floor(self.countdown - elapse));
 | 
			
		||||
        if (self.countdown and self.countdown >= 10 and self.countdown <= 60) then
 | 
			
		||||
            -- Display has 2 digits
 | 
			
		||||
            local ones = self.countdown % 10
 | 
			
		||||
            local tens = (self.countdown / 10) % 10
 | 
			
		||||
            self.ACDNumOne:Hide()
 | 
			
		||||
            self.ACDNumTens:Show()
 | 
			
		||||
            self.ACDNumOnes:Show()
 | 
			
		||||
 | 
			
		||||
            if (str_len(str) == 2) then
 | 
			
		||||
                -- Display has 2 digits
 | 
			
		||||
                self.ACDNumOne:Hide();
 | 
			
		||||
                self.ACDNumTens:Show();
 | 
			
		||||
                self.ACDNumOnes:Show();
 | 
			
		||||
 | 
			
		||||
                self.ACDNumTens:SetTexture(self.texturePath .. str_sub(str, 0, 1));
 | 
			
		||||
                self.ACDNumOnes:SetTexture(self.texturePath .. str_sub(str, 2, 2));
 | 
			
		||||
                self.ACDNumFrame:SetScale(0.7)
 | 
			
		||||
            elseif (str_len(str) == 1) then
 | 
			
		||||
                -- Display has 1 digit
 | 
			
		||||
                local numStr = str_sub(str, 0, 1)
 | 
			
		||||
                local path = numStr == "0" and self.faction or numStr
 | 
			
		||||
                self.ACDNumOne:Show();
 | 
			
		||||
                self.ACDNumOne:SetTexture(self.texturePath .. path);
 | 
			
		||||
                self.ACDNumOnes:Hide();
 | 
			
		||||
                self.ACDNumTens:Hide();
 | 
			
		||||
                self.ACDNumFrame:SetScale(1.0)
 | 
			
		||||
            self.ACDNumTens:SetTexture(self.texturePath .. tens)
 | 
			
		||||
            self.ACDNumOnes:SetTexture(self.texturePath .. ones)
 | 
			
		||||
            self.ACDNumFrame:SetScale(0.7)
 | 
			
		||||
        elseif (self.countdown and self.countdown < 10 and self.countdown > -1) then
 | 
			
		||||
            -- Display has 1 digit
 | 
			
		||||
            local path = self.countdown <= 0 and self.faction or self.countdown
 | 
			
		||||
            self.ACDNumOne:Show()
 | 
			
		||||
            self.ACDNumOne:SetTexture(self.texturePath .. path)
 | 
			
		||||
            self.ACDNumOnes:Hide()
 | 
			
		||||
            self.ACDNumTens:Hide()
 | 
			
		||||
            self.ACDNumFrame:SetScale(1.0)
 | 
			
		||||
        else
 | 
			
		||||
            ACDFrame:HideAll()
 | 
			
		||||
            if (self.countdown and self.countdown < -1) then
 | 
			
		||||
                self.ticker:Cancel()
 | 
			
		||||
            end
 | 
			
		||||
        end
 | 
			
		||||
        self.countdown = self.countdown - elapse;
 | 
			
		||||
        self.countdown = self.countdown and self.countdown - 1
 | 
			
		||||
    else
 | 
			
		||||
        self.hidden = true;
 | 
			
		||||
        self.ACDNumFrame:Hide()
 | 
			
		||||
        self.ACDNumTens:Hide();
 | 
			
		||||
        self.ACDNumOnes:Hide();
 | 
			
		||||
        self.ACDNumOne:Hide();
 | 
			
		||||
    end
 | 
			
		||||
    if (GetTime() > self.endTime) then
 | 
			
		||||
        self:SetScript("OnUpdate", nil)
 | 
			
		||||
        ACDFrame:HideAll()
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function ACDFrame:JOINED_ARENA()
 | 
			
		||||
    if Gladdy.db.countdown then
 | 
			
		||||
        self:CreateTicker(nil)
 | 
			
		||||
        self:RegisterEvent("CHAT_MSG_BG_SYSTEM_NEUTRAL")
 | 
			
		||||
        self:SetScript("OnEvent", ACDFrame.OnEvent)
 | 
			
		||||
        self.endTime = GetTime() + 70
 | 
			
		||||
        self:SetScript("OnUpdate", ACDFrame.OnUpdate)
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function ACDFrame:Reset()
 | 
			
		||||
    if self.ticker and not self.ticker:IsCancelled() then
 | 
			
		||||
        self.ticker:Cancel()
 | 
			
		||||
    end
 | 
			
		||||
    self.countdown = nil
 | 
			
		||||
    self:UnregisterEvent("CHAT_MSG_BG_SYSTEM_NEUTRAL")
 | 
			
		||||
    ACDFrame:HideAll()
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function ACDFrame:ENEMY_SPOTTED()
 | 
			
		||||
    if not Gladdy.frame.testing then
 | 
			
		||||
        ACDFrame:Reset()
 | 
			
		||||
@@ -147,30 +163,16 @@ end
 | 
			
		||||
function ACDFrame:CHAT_MSG_BG_SYSTEM_NEUTRAL(msg)
 | 
			
		||||
    for k,v in pairs(self.locale) do
 | 
			
		||||
        if str_find(msg, v) then
 | 
			
		||||
            if k == 0 then
 | 
			
		||||
                ACDFrame:Reset()
 | 
			
		||||
            else
 | 
			
		||||
                self.countdown = k
 | 
			
		||||
            if self.countdown and self.countdown == 0 then
 | 
			
		||||
                return
 | 
			
		||||
            end
 | 
			
		||||
            self.countdown = k
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function ACDFrame:TestOnce()
 | 
			
		||||
    self.countdown = 30
 | 
			
		||||
    self:JOINED_ARENA()
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function ACDFrame:Reset()
 | 
			
		||||
    self.endTime = 0
 | 
			
		||||
    self.countdown = 0
 | 
			
		||||
    self:UnregisterEvent("CHAT_MSG_BG_SYSTEM_NEUTRAL")
 | 
			
		||||
    self:SetScript("OnUpdate", nil)
 | 
			
		||||
    self.hidden = true;
 | 
			
		||||
    self.ACDNumFrame:Hide()
 | 
			
		||||
    self.ACDNumTens:Hide();
 | 
			
		||||
    self.ACDNumOnes:Hide();
 | 
			
		||||
    self.ACDNumOne:Hide();
 | 
			
		||||
    self:CreateTicker(30)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function ACDFrame:GetOptions()
 | 
			
		||||
 
 | 
			
		||||
@@ -47,11 +47,13 @@ local Auras = Gladdy:NewModule("Auras", nil, {
 | 
			
		||||
    auraYOffset = 0,
 | 
			
		||||
    auraSize = 60 + 20 + 1,
 | 
			
		||||
    auraWidthFactor = 0.9,
 | 
			
		||||
    auraIconZoomed = false,
 | 
			
		||||
    auraInterruptDetached = false,
 | 
			
		||||
    auraInterruptXOffset = 0,
 | 
			
		||||
    auraInterruptYOffset = 0,
 | 
			
		||||
    auraInterruptSize = 60 + 20 + 1,
 | 
			
		||||
    auraInterruptWidthFactor = 0.9,
 | 
			
		||||
    auraInterruptIconZoomed = false,
 | 
			
		||||
    auraFrameStrata = "MEDIUM",
 | 
			
		||||
    auraFrameLevel = 5,
 | 
			
		||||
    auraInterruptFrameStrata = "MEDIUM",
 | 
			
		||||
@@ -101,6 +103,7 @@ function Auras:CreateFrame(unit)
 | 
			
		||||
    auraFrame.icon = auraFrame.frame:CreateTexture(nil, "BACKGROUND")
 | 
			
		||||
    auraFrame.icon:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
 | 
			
		||||
    auraFrame.icon:SetAllPoints(auraFrame)
 | 
			
		||||
    auraFrame.icon.masked = true
 | 
			
		||||
 | 
			
		||||
    auraFrame.icon.overlay = auraFrame.cooldownFrame:CreateTexture(nil, "OVERLAY")
 | 
			
		||||
    auraFrame.icon.overlay:SetAllPoints(auraFrame)
 | 
			
		||||
@@ -174,6 +177,7 @@ function Auras:CreateInterrupt(unit)
 | 
			
		||||
    interruptFrame.icon = interruptFrame.frame:CreateTexture(nil, "BACKGROUND")
 | 
			
		||||
    interruptFrame.icon:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
 | 
			
		||||
    interruptFrame.icon:SetAllPoints(interruptFrame.frame)
 | 
			
		||||
    interruptFrame.icon.masked = true
 | 
			
		||||
 | 
			
		||||
    interruptFrame.icon.overlay = interruptFrame.cooldownFrame:CreateTexture(nil, "OVERLAY")
 | 
			
		||||
    interruptFrame.icon.overlay:SetAllPoints(interruptFrame.frame)
 | 
			
		||||
@@ -287,6 +291,8 @@ function Auras:UpdateFrame(unit)
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    local testAgain = false
 | 
			
		||||
 | 
			
		||||
    auraFrame:SetWidth(width)
 | 
			
		||||
    auraFrame:SetHeight(height)
 | 
			
		||||
    auraFrame.frame:SetWidth(height)
 | 
			
		||||
@@ -296,8 +302,13 @@ function Auras:UpdateFrame(unit)
 | 
			
		||||
 | 
			
		||||
    auraFrame.cooldown:ClearAllPoints()
 | 
			
		||||
    auraFrame.cooldown:SetPoint("CENTER", auraFrame, "CENTER")
 | 
			
		||||
    auraFrame.cooldown:SetWidth(width - width/16)
 | 
			
		||||
    auraFrame.cooldown:SetHeight(height - height/16)
 | 
			
		||||
    if Gladdy.db.auraIconZoomed then
 | 
			
		||||
        auraFrame.cooldown:SetWidth(width)
 | 
			
		||||
        auraFrame.cooldown:SetHeight(height)
 | 
			
		||||
    else
 | 
			
		||||
        auraFrame.cooldown:SetWidth(width - width/16)
 | 
			
		||||
        auraFrame.cooldown:SetHeight(height - height/16)
 | 
			
		||||
    end
 | 
			
		||||
    auraFrame.cooldown:SetAlpha(Gladdy.db.auraCooldownAlpha)
 | 
			
		||||
 | 
			
		||||
    auraFrame.text:SetFont(Gladdy:SMFetch("font", "auraFont"), (width/2 - 1) * Gladdy.db.auraFontSizeScale, "OUTLINE")
 | 
			
		||||
@@ -317,7 +328,31 @@ function Auras:UpdateFrame(unit)
 | 
			
		||||
    if Gladdy.db.auraDisableCircle then
 | 
			
		||||
        auraFrame.cooldown:SetAlpha(0)
 | 
			
		||||
    end
 | 
			
		||||
    self:UpdateInterruptFrame(unit)
 | 
			
		||||
 | 
			
		||||
    if Gladdy.db.auraIconZoomed then
 | 
			
		||||
        if auraFrame.icon.masked then
 | 
			
		||||
            auraFrame.icon:SetMask(nil)
 | 
			
		||||
            auraFrame.icon:SetTexCoord(0.1,0.9,0.1,0.9)
 | 
			
		||||
            auraFrame.icon.masked = nil
 | 
			
		||||
        end
 | 
			
		||||
    else
 | 
			
		||||
        if not auraFrame.icon.masked then
 | 
			
		||||
            auraFrame.icon:SetMask(nil)
 | 
			
		||||
            auraFrame.icon:SetTexCoord(0,1,0,1)
 | 
			
		||||
            auraFrame.icon:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
 | 
			
		||||
            auraFrame.icon.masked = true
 | 
			
		||||
            if Gladdy.frame.testing then
 | 
			
		||||
                testAgain = true
 | 
			
		||||
            end
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    testAgain = testAgain or self:UpdateInterruptFrame(unit)
 | 
			
		||||
 | 
			
		||||
    if testAgain then
 | 
			
		||||
        Auras:ResetUnit(unit)
 | 
			
		||||
        Auras:Test(unit)
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function Auras:UpdateInterruptFrame(unit)
 | 
			
		||||
@@ -405,6 +440,8 @@ function Auras:UpdateInterruptFrame(unit)
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    local testAgain = false
 | 
			
		||||
 | 
			
		||||
    interruptFrame:SetWidth(width)
 | 
			
		||||
    interruptFrame:SetHeight(height)
 | 
			
		||||
    interruptFrame.frame:SetWidth(width)
 | 
			
		||||
@@ -414,8 +451,14 @@ function Auras:UpdateInterruptFrame(unit)
 | 
			
		||||
 | 
			
		||||
    interruptFrame.cooldown:ClearAllPoints()
 | 
			
		||||
    interruptFrame.cooldown:SetPoint("CENTER", interruptFrame, "CENTER")
 | 
			
		||||
    interruptFrame.cooldown:SetWidth(width - width/16)
 | 
			
		||||
    interruptFrame.cooldown:SetHeight(height - height/16)
 | 
			
		||||
    if Gladdy.db.auraInterruptIconZoomed then
 | 
			
		||||
        interruptFrame.cooldown:SetWidth(width)
 | 
			
		||||
        interruptFrame.cooldown:SetHeight(height)
 | 
			
		||||
 | 
			
		||||
    else
 | 
			
		||||
        interruptFrame.cooldown:SetWidth(width - width/16)
 | 
			
		||||
        interruptFrame.cooldown:SetHeight(height - height/16)
 | 
			
		||||
    end
 | 
			
		||||
    interruptFrame.cooldown:SetAlpha(Gladdy.db.auraCooldownAlpha)
 | 
			
		||||
 | 
			
		||||
    interruptFrame.text:SetFont(Gladdy:SMFetch("font", "auraFont"), (width/2 - 1) * Gladdy.db.auraFontSizeScale, "OUTLINE")
 | 
			
		||||
@@ -433,6 +476,25 @@ function Auras:UpdateInterruptFrame(unit)
 | 
			
		||||
    if Gladdy.db.auraDisableCircle then
 | 
			
		||||
        interruptFrame.cooldown:SetAlpha(0)
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    if Gladdy.db.auraInterruptIconZoomed then
 | 
			
		||||
        if interruptFrame.icon.masked then
 | 
			
		||||
            interruptFrame.icon:SetMask(nil)
 | 
			
		||||
            interruptFrame.icon:SetTexCoord(0.1,0.9,0.1,0.9)
 | 
			
		||||
            interruptFrame.icon.masked = nil
 | 
			
		||||
        end
 | 
			
		||||
    else
 | 
			
		||||
        if not interruptFrame.icon.masked then
 | 
			
		||||
            interruptFrame.icon:SetMask(nil)
 | 
			
		||||
            interruptFrame.icon:SetTexCoord(0,1,0,1)
 | 
			
		||||
            interruptFrame.icon:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
 | 
			
		||||
            interruptFrame.icon.masked = true
 | 
			
		||||
            if Gladdy.frame.testing then
 | 
			
		||||
                testAgain = true
 | 
			
		||||
            end
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
    return testAgain
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function Auras:ResetUnit(unit)
 | 
			
		||||
@@ -483,12 +545,13 @@ function Auras:Test(unit)
 | 
			
		||||
        if Gladdy.exceptionNames[spellid] then
 | 
			
		||||
            spellName = Gladdy.exceptionNames[spellid]
 | 
			
		||||
        end
 | 
			
		||||
        local duration = math.random(2,10)
 | 
			
		||||
        if (unit == "arena2") then
 | 
			
		||||
            if (v.value.track == AURA_TYPE_BUFF) then
 | 
			
		||||
                self:AURA_GAIN(unit,v.value.track, spellid, spellName, icon, self.auras[spellName].duration, GetTime() + self.auras[spellName].duration)
 | 
			
		||||
                self:AURA_GAIN(unit,v.value.track, spellid, spellName, icon, duration, GetTime() + duration)
 | 
			
		||||
            end
 | 
			
		||||
        else
 | 
			
		||||
            self:AURA_GAIN(unit,v.value.track, spellid, spellName, icon, self.auras[spellName].duration, GetTime() + self.auras[spellName].duration)
 | 
			
		||||
            self:AURA_GAIN(unit,v.value.track, spellid, spellName, icon, duration, GetTime() + duration)
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
    -- /run LibStub("Gladdy").modules["Auras"]:Test("arena1")
 | 
			
		||||
@@ -541,7 +604,9 @@ function Auras:AURA_GAIN(unit, auraType, spellID, spellName, icon, duration, exp
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
    -- don't use spellId from combatlog, in case of different spellrank
 | 
			
		||||
    if not Gladdy.db.auraListDefault[tostring(self.auras[spellName].spellID)] or not Gladdy.db.auraListDefault[tostring(self.auras[spellName].spellID)].enabled then
 | 
			
		||||
    if not Gladdy.db.auraListDefault[tostring(self.auras[spellName].spellID)]
 | 
			
		||||
            or not Gladdy.db.auraListDefault[tostring(self.auras[spellName].spellID)].enabled
 | 
			
		||||
            or Gladdy.db.auraListDefault[tostring(self.auras[spellName].spellID)].track ~= auraType then
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
@@ -789,6 +854,21 @@ function Auras:GetOptions()
 | 
			
		||||
                            order = 2,
 | 
			
		||||
                            width = "full"
 | 
			
		||||
                        }),
 | 
			
		||||
                        headerIcon = {
 | 
			
		||||
                            type = "header",
 | 
			
		||||
                            name = L["Icon"],
 | 
			
		||||
                            order = 5,
 | 
			
		||||
                        },
 | 
			
		||||
                        auraIconZoomed = Gladdy:option({
 | 
			
		||||
                            type = "toggle",
 | 
			
		||||
                            name = L["Zoomed Icon"],
 | 
			
		||||
                            desc = L["Zoomes the icon to remove borders"],
 | 
			
		||||
                            disabled = function()
 | 
			
		||||
                                return not Gladdy.db.auraDetached
 | 
			
		||||
                            end,
 | 
			
		||||
                            order = 6,
 | 
			
		||||
                            width = "full",
 | 
			
		||||
                        }),
 | 
			
		||||
                        headerAuraSize = {
 | 
			
		||||
                            type = "header",
 | 
			
		||||
                            name = L["Size"],
 | 
			
		||||
@@ -893,6 +973,21 @@ function Auras:GetOptions()
 | 
			
		||||
                            order = 2,
 | 
			
		||||
                            width = "full"
 | 
			
		||||
                        }),
 | 
			
		||||
                        headerIcon = {
 | 
			
		||||
                            type = "header",
 | 
			
		||||
                            name = L["Icon"],
 | 
			
		||||
                            order = 5,
 | 
			
		||||
                        },
 | 
			
		||||
                        auraInterruptIconZoomed = Gladdy:option({
 | 
			
		||||
                            type = "toggle",
 | 
			
		||||
                            name = L["Zoomed Icon"],
 | 
			
		||||
                            desc = L["Zoomes the icon to remove borders"],
 | 
			
		||||
                            disabled = function()
 | 
			
		||||
                                return not Gladdy.db.auraInterruptDetached
 | 
			
		||||
                            end,
 | 
			
		||||
                            order = 6,
 | 
			
		||||
                            width = "full",
 | 
			
		||||
                        }),
 | 
			
		||||
                        headerAuraSize = {
 | 
			
		||||
                            type = "header",
 | 
			
		||||
                            name = L["Size"],
 | 
			
		||||
@@ -981,10 +1076,29 @@ function Auras:GetOptions()
 | 
			
		||||
                        }),
 | 
			
		||||
                    }
 | 
			
		||||
                },
 | 
			
		||||
                icon = {
 | 
			
		||||
                    type = "group",
 | 
			
		||||
                    name = L["Icon"],
 | 
			
		||||
                    order = 1,
 | 
			
		||||
                    args = {
 | 
			
		||||
                        headerIcon = {
 | 
			
		||||
                            type = "header",
 | 
			
		||||
                            name = L["Icon"],
 | 
			
		||||
                            order = 1,
 | 
			
		||||
                        },
 | 
			
		||||
                        auraIconZoomed = Gladdy:option({
 | 
			
		||||
                            type = "toggle",
 | 
			
		||||
                            name = L["Zoomed Icon"],
 | 
			
		||||
                            desc = L["Zoomes the icon to remove borders"],
 | 
			
		||||
                            order = 2,
 | 
			
		||||
                            width = "full",
 | 
			
		||||
                        }),
 | 
			
		||||
                    },
 | 
			
		||||
                },
 | 
			
		||||
                cooldown = {
 | 
			
		||||
                    type = "group",
 | 
			
		||||
                    name = L["Cooldown"],
 | 
			
		||||
                    order = 1,
 | 
			
		||||
                    order = 2,
 | 
			
		||||
                    args = {
 | 
			
		||||
                        headerAuras = {
 | 
			
		||||
                            type = "header",
 | 
			
		||||
@@ -1027,7 +1141,7 @@ function Auras:GetOptions()
 | 
			
		||||
                font = {
 | 
			
		||||
                    type = "group",
 | 
			
		||||
                    name = L["Font"],
 | 
			
		||||
                    order = 2,
 | 
			
		||||
                    order = 3,
 | 
			
		||||
                    args = {
 | 
			
		||||
                        headerAuras = {
 | 
			
		||||
                            type = "header",
 | 
			
		||||
@@ -1064,7 +1178,7 @@ function Auras:GetOptions()
 | 
			
		||||
                border = {
 | 
			
		||||
                    type = "group",
 | 
			
		||||
                    name = L["Border"],
 | 
			
		||||
                    order = 3,
 | 
			
		||||
                    order = 4,
 | 
			
		||||
                    args = borderArgs
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 
 | 
			
		||||
@@ -20,10 +20,12 @@ local BuffsDebuffs = Gladdy:NewModule("Buffs and Debuffs", nil, {
 | 
			
		||||
    buffsAlpha = 1,
 | 
			
		||||
    buffsIconSize = 30,
 | 
			
		||||
    buffsWidthFactor = 1,
 | 
			
		||||
    buffsIconZoomed = false,
 | 
			
		||||
    buffsIconPadding = 1,
 | 
			
		||||
    buffsBuffsAlpha = 1,
 | 
			
		||||
    buffsBuffsIconSize = 30,
 | 
			
		||||
    buffsBuffsWidthFactor = 1,
 | 
			
		||||
    buffsBuffsIconZoomed = false,
 | 
			
		||||
    buffsBuffsIconPadding = 1,
 | 
			
		||||
    buffsDisableCircle = false,
 | 
			
		||||
    buffsCooldownAlpha = 1,
 | 
			
		||||
@@ -42,25 +44,30 @@ local BuffsDebuffs = Gladdy:NewModule("Buffs and Debuffs", nil, {
 | 
			
		||||
    buffsBorderColorsEnabled = true,
 | 
			
		||||
    trackedDebuffs = defaultTrackedDebuffs,
 | 
			
		||||
    trackedBuffs = defaultTrackedBuffs,
 | 
			
		||||
    buffsBorderColorCurse = Gladdy:GetAuraTypeColor()["curse"],
 | 
			
		||||
    buffsBorderColorMagic = Gladdy:GetAuraTypeColor()["magic"],
 | 
			
		||||
    buffsBorderColorPoison = Gladdy:GetAuraTypeColor()["poison"],
 | 
			
		||||
    buffsBorderColorPhysical = Gladdy:GetAuraTypeColor()["none"],
 | 
			
		||||
    buffsBorderColorImmune = Gladdy:GetAuraTypeColor()["immune"],
 | 
			
		||||
    buffsBorderColorDisease = Gladdy:GetAuraTypeColor()["disease"],
 | 
			
		||||
    buffsBorderColorForm = Gladdy:GetAuraTypeColor()["form"],
 | 
			
		||||
    buffsBorderColorAura = Gladdy:GetAuraTypeColor()["aura"],
 | 
			
		||||
    buffsBorderColorEnrage = Gladdy:GetDispelTypeColors()["enrage"],
 | 
			
		||||
    buffsBorderColorCurse = Gladdy:GetDispelTypeColors()["curse"],
 | 
			
		||||
    buffsBorderColorMagic = Gladdy:GetDispelTypeColors()["magic"],
 | 
			
		||||
    buffsBorderColorPoison = Gladdy:GetDispelTypeColors()["poison"],
 | 
			
		||||
    buffsBorderColorPhysical = Gladdy:GetDispelTypeColors()["none"],
 | 
			
		||||
    buffsBorderColorImmune = Gladdy:GetDispelTypeColors()["immune"],
 | 
			
		||||
    buffsBorderColorDisease = Gladdy:GetDispelTypeColors()["disease"],
 | 
			
		||||
    buffsBorderColorForm = Gladdy:GetDispelTypeColors()["form"],
 | 
			
		||||
    buffsBorderColorAura = Gladdy:GetDispelTypeColors()["aura"],
 | 
			
		||||
    buffFrameStrata = "MEDIUM",
 | 
			
		||||
    buffsFrameLevel = 9,
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
local spellSchoolToOptionValueTable
 | 
			
		||||
local function spellSchoolToOptionValue(spellSchool)
 | 
			
		||||
    if Gladdy.db.buffsBorderColorsEnabled and spellSchool then
 | 
			
		||||
        return spellSchoolToOptionValueTable[spellSchool].r,
 | 
			
		||||
        spellSchoolToOptionValueTable[spellSchool].g,
 | 
			
		||||
        spellSchoolToOptionValueTable[spellSchool].b,
 | 
			
		||||
        spellSchoolToOptionValueTable[spellSchool].a
 | 
			
		||||
local dispelTypeToOptionValueTable
 | 
			
		||||
local function dispelTypeToOptionValue(dispelType)
 | 
			
		||||
    if Gladdy.db.buffsBorderColorsEnabled then
 | 
			
		||||
        dispelType = dispelType and lower(dispelType) or "physical"
 | 
			
		||||
        if not dispelTypeToOptionValueTable[dispelType] then
 | 
			
		||||
            dispelType = "physical"
 | 
			
		||||
        end
 | 
			
		||||
        return dispelTypeToOptionValueTable[dispelType].r,
 | 
			
		||||
        dispelTypeToOptionValueTable[dispelType].g,
 | 
			
		||||
        dispelTypeToOptionValueTable[dispelType].b,
 | 
			
		||||
        dispelTypeToOptionValueTable[dispelType].a
 | 
			
		||||
    else
 | 
			
		||||
        return Gladdy:SetColor(Gladdy.db.buffsBorderColor)
 | 
			
		||||
    end
 | 
			
		||||
@@ -86,14 +93,18 @@ function BuffsDebuffs:Initialize()
 | 
			
		||||
                "AURA_GAIN_LIMIT")
 | 
			
		||||
        self:SetScript("OnEvent", BuffsDebuffs.OnEvent)
 | 
			
		||||
    end
 | 
			
		||||
    spellSchoolToOptionValueTable = {
 | 
			
		||||
        curse = Gladdy.db.buffsBorderColorCurse,
 | 
			
		||||
    dispelTypeToOptionValueTable = {
 | 
			
		||||
        none = Gladdy.db.buffsBorderColorPhysical,
 | 
			
		||||
        magic = Gladdy.db.buffsBorderColorMagic,
 | 
			
		||||
        curse = Gladdy.db.buffsBorderColorCurse,
 | 
			
		||||
        disease = Gladdy.db.buffsBorderColorDisease,
 | 
			
		||||
        poison = Gladdy.db.buffsBorderColorPoison,
 | 
			
		||||
        stealth = Gladdy.db.buffsBorderColorPhysical,
 | 
			
		||||
        invisibility = Gladdy.db.buffsBorderColorPhysical,
 | 
			
		||||
        physical = Gladdy.db.buffsBorderColorPhysical,
 | 
			
		||||
        immune = Gladdy.db.buffsBorderColorImmune,
 | 
			
		||||
        disease = Gladdy.db.buffsBorderColorDisease,
 | 
			
		||||
        form = Gladdy.db.buffsBorderColorForm,
 | 
			
		||||
        enrage = Gladdy.db.buffsBorderColorEnrage,
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
end
 | 
			
		||||
@@ -137,7 +148,7 @@ end
 | 
			
		||||
 | 
			
		||||
function BuffsDebuffs:Test(unit)
 | 
			
		||||
    if Gladdy.db.buffsEnabled then
 | 
			
		||||
        local spellSchools = { "physical", "magic", "curse", "poison", "disease", "immune" }
 | 
			
		||||
        local dispelTypes = { "physical", "magic", "curse", "poison", "disease", "immune", "enrage"}
 | 
			
		||||
 | 
			
		||||
        BuffsDebuffs:AURA_FADE(unit, AURA_TYPE_DEBUFF)
 | 
			
		||||
        BuffsDebuffs:AURA_FADE(unit, AURA_TYPE_BUFF)
 | 
			
		||||
@@ -149,7 +160,7 @@ function BuffsDebuffs:Test(unit)
 | 
			
		||||
                break
 | 
			
		||||
            end
 | 
			
		||||
            if enabled then
 | 
			
		||||
                BuffsDebuffs:AddOrRefreshAura(unit, spellID, AURA_TYPE_DEBUFF, 15, 15, random(1,5), spellSchools[random(1,6)], select(3, GetSpellInfo(spellID)), i)
 | 
			
		||||
                BuffsDebuffs:AddOrRefreshAura(unit, spellID, AURA_TYPE_DEBUFF, 15, 15, random(1,5), dispelTypes[random(1,#dispelTypes)], select(3, GetSpellInfo(spellID)), i)
 | 
			
		||||
                i = i + 1
 | 
			
		||||
            end
 | 
			
		||||
        end
 | 
			
		||||
@@ -159,7 +170,7 @@ function BuffsDebuffs:Test(unit)
 | 
			
		||||
                break
 | 
			
		||||
            end
 | 
			
		||||
            if enabled then
 | 
			
		||||
                BuffsDebuffs:AddOrRefreshAura(unit, spellID, AURA_TYPE_BUFF, 15, 15, random(1,5), spellSchools[random(1,6)], select(3, GetSpellInfo(spellID)), i)
 | 
			
		||||
                BuffsDebuffs:AddOrRefreshAura(unit, spellID, AURA_TYPE_BUFF, 15, 15, random(1,5), dispelTypes[random(1,#dispelTypes)], select(3, GetSpellInfo(spellID)), i)
 | 
			
		||||
                i = i + 1
 | 
			
		||||
            end
 | 
			
		||||
        end
 | 
			
		||||
@@ -196,7 +207,7 @@ function BuffsDebuffs:AURA_GAIN_LIMIT(unit, auraType, limit)
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function BuffsDebuffs:AURA_GAIN(unit, auraType, spellID, spellName, texture, duration, expirationTime, count, spellSchool)
 | 
			
		||||
function BuffsDebuffs:AURA_GAIN(unit, auraType, spellID, spellName, texture, duration, expirationTime, count, dispelType)
 | 
			
		||||
    if (not self.frames[unit] or not Gladdy.db.buffsEnabled) then
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
@@ -227,7 +238,7 @@ function BuffsDebuffs:AURA_GAIN(unit, auraType, spellID, spellName, texture, dur
 | 
			
		||||
            auraFrame.numBuffs = auraFrame.numBuffs + 1
 | 
			
		||||
            index = auraFrame.numBuffs
 | 
			
		||||
        end
 | 
			
		||||
        BuffsDebuffs:AddOrRefreshAura(unit,spellID, auraType, duration, expirationTime - GetTime(), count, spellSchool and lower(spellSchool) or "physical", texture, index)
 | 
			
		||||
        BuffsDebuffs:AddOrRefreshAura(unit,spellID, auraType, duration, expirationTime - GetTime(), count, dispelType, texture, index)
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
@@ -280,17 +291,44 @@ local function styleIcon(aura, auraType)
 | 
			
		||||
        aura.cooldowncircle:SetAlpha(Gladdy.db.buffsCooldownAlpha)
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    local zoomedOption, testAgain
 | 
			
		||||
    if auraType == AURA_TYPE_BUFF then
 | 
			
		||||
        zoomedOption = Gladdy.db.buffsBuffsIconZoomed
 | 
			
		||||
    else
 | 
			
		||||
        zoomedOption = Gladdy.db.buffsIconZoomed
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    if zoomedOption then
 | 
			
		||||
        if aura.texture.masked then
 | 
			
		||||
            aura.texture:SetMask(nil)
 | 
			
		||||
            aura.texture:SetTexCoord(0.1,0.9,0.1,0.9)
 | 
			
		||||
            aura.texture.masked = nil
 | 
			
		||||
        end
 | 
			
		||||
    else
 | 
			
		||||
        if not aura.texture.masked then
 | 
			
		||||
            aura.texture:SetMask(nil)
 | 
			
		||||
            aura.texture:SetTexCoord(0,1,0,1)
 | 
			
		||||
            aura.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
 | 
			
		||||
            aura.texture.masked = true
 | 
			
		||||
            if Gladdy.frame.testing then
 | 
			
		||||
                testAgain = true
 | 
			
		||||
            end
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    aura:SetFrameStrata(Gladdy.db.buffFrameStrata)
 | 
			
		||||
    aura:SetFrameLevel(Gladdy.db.buffsFrameLevel)
 | 
			
		||||
    aura.cooldowncircle:SetFrameLevel(Gladdy.db.buffsFrameLevel + 1)
 | 
			
		||||
    aura.overlay:SetFrameLevel(Gladdy.db.buffsFrameLevel + 2)
 | 
			
		||||
 | 
			
		||||
    aura.border:SetTexture(Gladdy.db.buffsBorderStyle)
 | 
			
		||||
    aura.border:SetVertexColor(spellSchoolToOptionValue(aura.spellSchool))
 | 
			
		||||
    aura.border:SetVertexColor(dispelTypeToOptionValue(aura.dispelType))
 | 
			
		||||
    aura.cooldown:SetFont(Gladdy:SMFetch("font", "buffsFont"), (Gladdy.db.buffsIconSize/2 - 1) * Gladdy.db.buffsFontScale, "OUTLINE")
 | 
			
		||||
    aura.cooldown:SetTextColor(Gladdy.db.buffsFontColor.r, Gladdy.db.buffsFontColor.g, Gladdy.db.buffsFontColor.b, Gladdy.db.buffsFontColor.a)
 | 
			
		||||
    aura.stacks:SetFont(Gladdy:SMFetch("font", "buffsFont"), (Gladdy.db.buffsIconSize/3 - 1) * Gladdy.db.buffsFontScale, "OUTLINE")
 | 
			
		||||
    aura.stacks:SetTextColor(Gladdy.db.buffsFontColor.r, Gladdy.db.buffsFontColor.g, Gladdy.db.buffsFontColor.b, 1)
 | 
			
		||||
 | 
			
		||||
    return testAgain
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function BuffsDebuffs:UpdateFrameOnce()
 | 
			
		||||
@@ -330,16 +368,23 @@ function BuffsDebuffs:UpdateFrame(unit)
 | 
			
		||||
                0, 0, "buffsEnabled")
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    local testBuffsAgain, testDebuffsAgain
 | 
			
		||||
 | 
			
		||||
    for i=1, #self.frames[unit].auras[AURA_TYPE_BUFF] do
 | 
			
		||||
        styleIcon(self.frames[unit].auras[AURA_TYPE_BUFF][i], AURA_TYPE_BUFF)
 | 
			
		||||
        testBuffsAgain = styleIcon(self.frames[unit].auras[AURA_TYPE_BUFF][i], AURA_TYPE_BUFF)
 | 
			
		||||
    end
 | 
			
		||||
    for i=1, #self.frames[unit].auras[AURA_TYPE_DEBUFF] do
 | 
			
		||||
        styleIcon(self.frames[unit].auras[AURA_TYPE_DEBUFF][i], AURA_TYPE_DEBUFF)
 | 
			
		||||
        testDebuffsAgain = styleIcon(self.frames[unit].auras[AURA_TYPE_DEBUFF][i], AURA_TYPE_DEBUFF)
 | 
			
		||||
    end
 | 
			
		||||
    for i=1, #self.framePool do
 | 
			
		||||
        styleIcon(self.framePool[i])
 | 
			
		||||
    end
 | 
			
		||||
    self:UpdateAurasOnUnit(unit)
 | 
			
		||||
 | 
			
		||||
    if Gladdy.frame.testing and (testBuffsAgain or testDebuffsAgain) then
 | 
			
		||||
        self:ResetUnit(unit)
 | 
			
		||||
        self:Test(unit)
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
---------------------------
 | 
			
		||||
@@ -404,11 +449,12 @@ local function iconTimer(auraFrame, elapsed)
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function BuffsDebuffs:AddAura(unit, spellID, auraType, duration, timeLeft, stacks, spellSchool, icon, index)
 | 
			
		||||
function BuffsDebuffs:AddAura(unit, spellID, auraType, duration, timeLeft, stacks, dispelType, icon, index)
 | 
			
		||||
    local aura
 | 
			
		||||
    if not self.frames[unit].auras[auraType][index] then
 | 
			
		||||
        if #self.framePool > 0 then
 | 
			
		||||
            aura = tremove(self.framePool, #self.framePool)
 | 
			
		||||
            styleIcon(aura)
 | 
			
		||||
        else
 | 
			
		||||
            aura = CreateFrame("Frame")
 | 
			
		||||
            aura:EnableMouse(false)
 | 
			
		||||
@@ -416,6 +462,7 @@ function BuffsDebuffs:AddAura(unit, spellID, auraType, duration, timeLeft, stack
 | 
			
		||||
            aura:SetFrameLevel(Gladdy.db.buffsFrameLevel)
 | 
			
		||||
            aura.texture = aura:CreateTexture(nil, "BACKGROUND")
 | 
			
		||||
            aura.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
 | 
			
		||||
            aura.texture.masked = true
 | 
			
		||||
            aura.texture:SetAllPoints(aura)
 | 
			
		||||
            aura.cooldowncircle = CreateFrame("Cooldown", nil, aura, "CooldownFrameTemplate")
 | 
			
		||||
            aura.cooldowncircle:SetFrameLevel(Gladdy.db.buffsFrameLevel + 1)
 | 
			
		||||
@@ -457,12 +504,12 @@ function BuffsDebuffs:AddAura(unit, spellID, auraType, duration, timeLeft, stack
 | 
			
		||||
    aura.spellID = spellID
 | 
			
		||||
    aura.type = auraType
 | 
			
		||||
    aura.unit = unit
 | 
			
		||||
    aura.spellSchool = spellSchool
 | 
			
		||||
    aura.border:SetVertexColor(spellSchoolToOptionValue(spellSchool))
 | 
			
		||||
    aura.dispelType = dispelType
 | 
			
		||||
    aura.border:SetVertexColor(dispelTypeToOptionValue(dispelType))
 | 
			
		||||
    aura:Show()
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function BuffsDebuffs:AddOrRefreshAura(unit, spellID, auraType, duration, timeLeft, stacks, spellSchool, icon, index)
 | 
			
		||||
function BuffsDebuffs:AddOrRefreshAura(unit, spellID, auraType, duration, timeLeft, stacks, dispelType, icon, index)
 | 
			
		||||
    if self.frames[unit].auras[auraType][index] and self.frames[unit].auras[auraType][index].spellID == spellID then -- refresh
 | 
			
		||||
        if duration == 0 then
 | 
			
		||||
            self.frames[unit].auras[auraType][index].endtime = "undefined"
 | 
			
		||||
@@ -478,7 +525,7 @@ function BuffsDebuffs:AddOrRefreshAura(unit, spellID, auraType, duration, timeLe
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
    --add
 | 
			
		||||
    self:AddAura(unit, spellID, auraType, duration, timeLeft, stacks, spellSchool, icon, index)
 | 
			
		||||
    self:AddAura(unit, spellID, auraType, duration, timeLeft, stacks, dispelType, icon, index)
 | 
			
		||||
    self:UpdateAurasOnUnit(unit)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
@@ -520,14 +567,21 @@ function BuffsDebuffs:GetOptions()
 | 
			
		||||
                    args = {
 | 
			
		||||
                        size = {
 | 
			
		||||
                            type = "group",
 | 
			
		||||
                            name = L["Size & Padding"],
 | 
			
		||||
                            name = L["Icon"],
 | 
			
		||||
                            order = 1,
 | 
			
		||||
                            args = {
 | 
			
		||||
                                header = {
 | 
			
		||||
                                    type = "header",
 | 
			
		||||
                                    name = L["Size & Padding"],
 | 
			
		||||
                                    order = 5,
 | 
			
		||||
                                    name = L["Icon"],
 | 
			
		||||
                                    order = 1,
 | 
			
		||||
                                },
 | 
			
		||||
                                buffsBuffsIconZoomed = Gladdy:option({
 | 
			
		||||
                                    type = "toggle",
 | 
			
		||||
                                    name = L["Zoomed Icon"],
 | 
			
		||||
                                    desc = L["Zoomes the icon to remove borders"],
 | 
			
		||||
                                    order = 2,
 | 
			
		||||
                                    width = "full",
 | 
			
		||||
                                }),
 | 
			
		||||
                                buffsBuffsIconSize = Gladdy:option({
 | 
			
		||||
                                    type = "range",
 | 
			
		||||
                                    name = L["Icon Size"],
 | 
			
		||||
@@ -630,14 +684,21 @@ function BuffsDebuffs:GetOptions()
 | 
			
		||||
                    args = {
 | 
			
		||||
                        size = {
 | 
			
		||||
                            type = "group",
 | 
			
		||||
                            name = L["Size & Padding"],
 | 
			
		||||
                            name = L["Icon"],
 | 
			
		||||
                            order = 1,
 | 
			
		||||
                            args = {
 | 
			
		||||
                                header = {
 | 
			
		||||
                                    type = "header",
 | 
			
		||||
                                    name = L["Size & Padding"],
 | 
			
		||||
                                    order = 5,
 | 
			
		||||
                                    name = L["Icon"],
 | 
			
		||||
                                    order = 1,
 | 
			
		||||
                                },
 | 
			
		||||
                                buffsIconZoomed = Gladdy:option({
 | 
			
		||||
                                    type = "toggle",
 | 
			
		||||
                                    name = L["Zoomed Icon"],
 | 
			
		||||
                                    desc = L["Zoomes the icon to remove borders"],
 | 
			
		||||
                                    order = 2,
 | 
			
		||||
                                    width = "full",
 | 
			
		||||
                                }),
 | 
			
		||||
                                buffsIconSize = Gladdy:option({
 | 
			
		||||
                                    type = "range",
 | 
			
		||||
                                    name = L["Icon Size"],
 | 
			
		||||
@@ -903,6 +964,13 @@ function BuffsDebuffs:GetOptions()
 | 
			
		||||
                            order = 49,
 | 
			
		||||
                            hasAlpha = true,
 | 
			
		||||
                        }),
 | 
			
		||||
                        buffsBorderColorEnrage = Gladdy:colorOption({
 | 
			
		||||
                            type = "color",
 | 
			
		||||
                            name = L["Enrage"],
 | 
			
		||||
                            desc = L["Color of the border"],
 | 
			
		||||
                            order = 50,
 | 
			
		||||
                            hasAlpha = true,
 | 
			
		||||
                        }),
 | 
			
		||||
                    },
 | 
			
		||||
                },
 | 
			
		||||
                frameStrata = {
 | 
			
		||||
 
 | 
			
		||||
@@ -23,6 +23,7 @@ local Castbar = Gladdy:NewModule("Cast Bar", 70, {
 | 
			
		||||
    castBarHeight = 20,
 | 
			
		||||
    castBarWidth = 160,
 | 
			
		||||
    castBarIconSize = 22,
 | 
			
		||||
    castBarIconZoomed = false,
 | 
			
		||||
    castBarBorderSize = 8,
 | 
			
		||||
    castBarFontSize = 12,
 | 
			
		||||
    castBarFontOutline = false,
 | 
			
		||||
@@ -104,10 +105,17 @@ function Castbar:CreateFrame(unit)
 | 
			
		||||
    castBar.icon.texture = castBar.icon:CreateTexture(nil, "BACKGROUND")
 | 
			
		||||
    castBar.icon.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
 | 
			
		||||
    castBar.icon.texture:SetAllPoints(castBar.icon)
 | 
			
		||||
    castBar.icon.texture.masked = true
 | 
			
		||||
    castBar.icon.texture.overlay = castBar.icon:CreateTexture(nil, "BORDER")
 | 
			
		||||
    castBar.icon.texture.overlay:SetAllPoints(castBar.icon.texture)
 | 
			
		||||
    castBar.icon.texture.overlay:SetTexture(Gladdy.db.castBarIconStyle)
 | 
			
		||||
 | 
			
		||||
    castBar.shield = castBar.icon:CreateTexture(nil, "OVERLAY")
 | 
			
		||||
    castBar.shield:SetTexture("Interface\\AddOns\\Gladdy\\Images\\castbar-shield")
 | 
			
		||||
    castBar.shield:SetHeight(80)
 | 
			
		||||
    castBar.shield:SetWidth(80)
 | 
			
		||||
    castBar.shield:SetPoint("CENTER", castBar.icon, "CENTER", 0, -1.5)
 | 
			
		||||
 | 
			
		||||
    castBar.icon:ClearAllPoints()
 | 
			
		||||
    if (Gladdy.db.castBarIconPos == "LEFT") then
 | 
			
		||||
        castBar.icon:SetPoint("RIGHT", castBar, "LEFT", -3, 0) -- Icon of castbar
 | 
			
		||||
@@ -121,7 +129,7 @@ function Castbar:CreateFrame(unit)
 | 
			
		||||
    castBar.spellText:SetShadowOffset(1, -1)
 | 
			
		||||
    castBar.spellText:SetShadowColor(0, 0, 0, 1)
 | 
			
		||||
    castBar.spellText:SetJustifyH("CENTER")
 | 
			
		||||
    castBar.spellText:SetPoint("LEFT", 7, 0) -- Text of the spell
 | 
			
		||||
    castBar.spellText:SetPoint("LEFT", 10, 0) -- Text of the spell
 | 
			
		||||
 | 
			
		||||
    castBar.timeText = castBar:CreateFontString(nil, "LOW")
 | 
			
		||||
    castBar.timeText:SetFont(Gladdy:SMFetch("font", "auraFont"), Gladdy.db.castBarFontSize, Gladdy.db.castBarFontOutline and "OUTLINE")
 | 
			
		||||
@@ -151,6 +159,8 @@ function Castbar:UpdateFrame(unit)
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    local testAgain = false
 | 
			
		||||
 | 
			
		||||
    castBar:SetFrameStrata(Gladdy.db.castBarFrameStrata)
 | 
			
		||||
    castBar:SetFrameLevel(Gladdy.db.castBarFrameLevel)
 | 
			
		||||
    castBar.backdrop:SetFrameStrata(Gladdy.db.castBarFrameStrata)
 | 
			
		||||
@@ -185,12 +195,27 @@ function Castbar:UpdateFrame(unit)
 | 
			
		||||
    castBar.icon:SetWidth(Gladdy.db.castBarIconSize)
 | 
			
		||||
    castBar.icon:SetHeight(Gladdy.db.castBarIconSize)
 | 
			
		||||
    castBar.icon.texture:SetAllPoints(castBar.icon)
 | 
			
		||||
    castBar.icon:ClearAllPoints()
 | 
			
		||||
    if Gladdy.db.castBarIconEnabled then
 | 
			
		||||
        castBar.icon:Show()
 | 
			
		||||
    if Gladdy.db.castBarIconZoomed then
 | 
			
		||||
        if castBar.icon.texture.masked then
 | 
			
		||||
            castBar.icon.texture:SetMask(nil)
 | 
			
		||||
            castBar.icon.texture:SetTexCoord(0.1,0.9,0.1,0.9)
 | 
			
		||||
            castBar.icon.texture.masked = nil
 | 
			
		||||
        end
 | 
			
		||||
    else
 | 
			
		||||
        castBar.icon:Hide()
 | 
			
		||||
        if not castBar.icon.texture.masked then
 | 
			
		||||
            castBar.icon.texture:SetMask(nil)
 | 
			
		||||
            castBar.icon.texture:SetTexCoord(0,1,0,1)
 | 
			
		||||
            castBar.icon.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
 | 
			
		||||
            castBar.icon.texture.masked = true
 | 
			
		||||
            if Gladdy.frame.testing then
 | 
			
		||||
                testAgain = true
 | 
			
		||||
            end
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
    castBar.icon:ClearAllPoints()
 | 
			
		||||
 | 
			
		||||
    castBar.shield:SetWidth(Gladdy.db.castBarIconSize * 3.2)
 | 
			
		||||
    castBar.shield:SetHeight(Gladdy.db.castBarIconSize * 3.2)
 | 
			
		||||
 | 
			
		||||
    local rightMargin = 0
 | 
			
		||||
    local leftMargin = 0
 | 
			
		||||
@@ -221,6 +246,16 @@ function Castbar:UpdateFrame(unit)
 | 
			
		||||
    if not Gladdy.db.castBarEnabled then
 | 
			
		||||
        self:CAST_STOP(unit)
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    if Gladdy.db.castBarIconEnabled then
 | 
			
		||||
        castBar.icon:Show()
 | 
			
		||||
        if testAgain then
 | 
			
		||||
            self:ResetUnit(unit)
 | 
			
		||||
            self:Test(unit)
 | 
			
		||||
        end
 | 
			
		||||
    else
 | 
			
		||||
        castBar.icon:Hide()
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
---------------------------
 | 
			
		||||
@@ -280,7 +315,7 @@ end
 | 
			
		||||
 | 
			
		||||
Castbar.CastEventsFunc = {}
 | 
			
		||||
Castbar.CastEventsFunc["UNIT_SPELLCAST_START"] = function(castBar, event, ...)
 | 
			
		||||
    local name, text, texture, startTime, endTime, isTradeSkill, castID = UnitCastingInfo(castBar.unit)
 | 
			
		||||
    local name, text, texture, startTime, endTime, isTradeSkill, castID, notInterruptible, spellId = UnitCastingInfo(castBar.unit)
 | 
			
		||||
    if ( not name or (not castBar.showTradeSkills and isTradeSkill)) then
 | 
			
		||||
        castBar:SetAlpha(0)
 | 
			
		||||
        return
 | 
			
		||||
@@ -376,7 +411,7 @@ Castbar.CastEventsFunc["UNIT_SPELLCAST_DELAYED"] = function(castBar, event, ...)
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
Castbar.CastEventsFunc["UNIT_SPELLCAST_CHANNEL_START"] = function(castBar, event, ...)
 | 
			
		||||
    local name, text, texture, startTime, endTime, isTradeSkill, spellID = UnitChannelInfo(castBar.unit)
 | 
			
		||||
    local name, text, texture, startTime, endTime, isTradeSkill, notInterruptible, spellId = UnitChannelInfo(castBar.unit)
 | 
			
		||||
 | 
			
		||||
    if ( not name or (not castBar.showTradeSkills and isTradeSkill)) then
 | 
			
		||||
        castBar:SetAlpha(0)
 | 
			
		||||
@@ -414,7 +449,7 @@ function Castbar.OnEvent(self, event, ...)
 | 
			
		||||
    Castbar.CastEventsFunc[event](self, event, ...)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function Castbar:CAST_START(unit, spell, icon, value, maxValue, test)
 | 
			
		||||
function Castbar:CAST_START(unit, spell, icon, value, maxValue, notInterruptible, test)
 | 
			
		||||
    local castBar = self.frames[unit]
 | 
			
		||||
    if (not castBar) then
 | 
			
		||||
        return
 | 
			
		||||
@@ -426,7 +461,12 @@ function Castbar:CAST_START(unit, spell, icon, value, maxValue, test)
 | 
			
		||||
        castBar.channeling = test == "channel"
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    castBar.bar:SetStatusBarColor(Gladdy:SetColor(Gladdy.db.castBarColor))
 | 
			
		||||
    if notInterruptible then
 | 
			
		||||
        castBar.bar:SetStatusBarColor(.8,.8,.8,1)
 | 
			
		||||
    else
 | 
			
		||||
        castBar.bar:SetStatusBarColor(Gladdy:SetColor(Gladdy.db.castBarColor))
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    castBar.value = value
 | 
			
		||||
    castBar.maxValue = maxValue
 | 
			
		||||
    castBar.bar:SetMinMaxValues(0, maxValue)
 | 
			
		||||
@@ -440,6 +480,11 @@ function Castbar:CAST_START(unit, spell, icon, value, maxValue, test)
 | 
			
		||||
    if Gladdy.db.castBarSparkEnabled then
 | 
			
		||||
        castBar.spark:Show()
 | 
			
		||||
    end
 | 
			
		||||
    if notInterruptible then
 | 
			
		||||
        castBar.shield:Show()
 | 
			
		||||
    else
 | 
			
		||||
        castBar.shield:Hide()
 | 
			
		||||
    end
 | 
			
		||||
    castBar:SetAlpha(1)
 | 
			
		||||
    if Gladdy.db.castBarIconEnabled then
 | 
			
		||||
        castBar.icon:Show()
 | 
			
		||||
@@ -467,6 +512,7 @@ function Castbar:CAST_STOP(unit, ...)
 | 
			
		||||
        castBar.backdrop:Hide()
 | 
			
		||||
        castBar.spark:Hide()
 | 
			
		||||
        castBar.icon:Hide()
 | 
			
		||||
        castBar.shield:Hide()
 | 
			
		||||
    else
 | 
			
		||||
        castBar.bar:SetStatusBarColor(...)
 | 
			
		||||
    end
 | 
			
		||||
@@ -541,7 +587,8 @@ function Castbar:Test(unit)
 | 
			
		||||
        end
 | 
			
		||||
 | 
			
		||||
        if (spell) then
 | 
			
		||||
            self:CAST_START(unit, spell, icon, value, maxValue, event)
 | 
			
		||||
            local nonInterruptable = unit == "arena1" and Gladdy.expansion == "Wrath"
 | 
			
		||||
            self:CAST_START(unit, spell, icon, value, maxValue, nonInterruptable, event)
 | 
			
		||||
        end
 | 
			
		||||
    else
 | 
			
		||||
        self:CAST_STOP(unit)
 | 
			
		||||
@@ -691,7 +738,7 @@ function Castbar:GetOptions()
 | 
			
		||||
                    args = {
 | 
			
		||||
                        headerSize = {
 | 
			
		||||
                            type = "header",
 | 
			
		||||
                            name = L["Icon Size"],
 | 
			
		||||
                            name = L["Icon"],
 | 
			
		||||
                            order = 1,
 | 
			
		||||
                        },
 | 
			
		||||
                        castBarIconEnabled = option({
 | 
			
		||||
@@ -700,6 +747,13 @@ function Castbar:GetOptions()
 | 
			
		||||
                            order = 2,
 | 
			
		||||
                            width = "full",
 | 
			
		||||
                        }),
 | 
			
		||||
                        castBarIconZoomed = Gladdy:option({
 | 
			
		||||
                            type = "toggle",
 | 
			
		||||
                            name = L["Zoomed Icon"],
 | 
			
		||||
                            desc = L["Zoomes the icon to remove borders"],
 | 
			
		||||
                            order = 3,
 | 
			
		||||
                            width = "full",
 | 
			
		||||
                        }),
 | 
			
		||||
                        castBarIconSize = option({
 | 
			
		||||
                            type = "range",
 | 
			
		||||
                            name = L["Icon size"],
 | 
			
		||||
 
 | 
			
		||||
@@ -8,6 +8,7 @@ local Classicon = Gladdy:NewModule("Class Icon", 81, {
 | 
			
		||||
    classIconEnabled = true,
 | 
			
		||||
    classIconSize = 60 + 20 + 1,
 | 
			
		||||
    classIconWidthFactor = 0.9,
 | 
			
		||||
    classIconZoomed = false,
 | 
			
		||||
    classIconBorderStyle = "Interface\\AddOns\\Gladdy\\Images\\Border_rounded_blp",
 | 
			
		||||
    classIconBorderColor = { r = 0, g = 0, b = 0, a = 1 },
 | 
			
		||||
    classIconSpecIcon = false,
 | 
			
		||||
@@ -22,6 +23,7 @@ local Classicon = Gladdy:NewModule("Class Icon", 81, {
 | 
			
		||||
local classIconPath = "Interface\\Addons\\Gladdy\\Images\\Classes\\"
 | 
			
		||||
local classIcons = {
 | 
			
		||||
    ["DRUID"] = classIconPath .. "inv_misc_monsterclaw_04",
 | 
			
		||||
    ["DEATHKNIGHT"] = select(3, GetSpellInfo(49023)), --Might of Mograine
 | 
			
		||||
    ["HUNTER"] = classIconPath .. "inv_weapon_bow_07",
 | 
			
		||||
    ["MAGE"] = classIconPath .. "inv_staff_13",
 | 
			
		||||
    ["PALADIN"] = classIconPath .. "inv_hammer_01",
 | 
			
		||||
@@ -39,6 +41,11 @@ local specIcons = {
 | 
			
		||||
        [L["Feral"]] = select(3, GetSpellInfo(27545)), -- Cat Form
 | 
			
		||||
        [L["Restoration"]] = select(3, GetSpellInfo(5185)), -- Healing Touch
 | 
			
		||||
    },
 | 
			
		||||
    ["DEATHKNIGHT"] = {
 | 
			
		||||
        [L["Unholy"]] = select(3, GetSpellInfo(48265)), -- Unholy Presence
 | 
			
		||||
        [L["Blood"]] = select(3, GetSpellInfo(48266)), -- Blood Presence
 | 
			
		||||
        [L["Frost"]] = select(3, GetSpellInfo(48263)), -- Frost Presence
 | 
			
		||||
    },
 | 
			
		||||
    ["HUNTER"] = {
 | 
			
		||||
        [L["Beast Mastery"]] = select(3, GetSpellInfo(1515)), -- Tame Beast
 | 
			
		||||
        [L["Marksmanship"]] = select(3, GetSpellInfo(42243)), -- Volley
 | 
			
		||||
@@ -109,6 +116,7 @@ function Classicon:CreateFrame(unit)
 | 
			
		||||
    classIcon.texture = classIcon:CreateTexture(nil, "BACKGROUND")
 | 
			
		||||
    classIcon.texture:SetAllPoints(classIcon)
 | 
			
		||||
    classIcon.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
 | 
			
		||||
    classIcon.texture.masked = true
 | 
			
		||||
 | 
			
		||||
    classIcon.texture.overlay = classIcon:CreateTexture(nil, "BORDER")
 | 
			
		||||
    classIcon.texture.overlay:SetAllPoints(classIcon)
 | 
			
		||||
@@ -127,12 +135,32 @@ function Classicon:UpdateFrame(unit)
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    local testAgain = false
 | 
			
		||||
 | 
			
		||||
    classIcon:SetFrameStrata(Gladdy.db.classIconFrameStrata)
 | 
			
		||||
    classIcon:SetFrameLevel(Gladdy.db.classIconFrameLevel)
 | 
			
		||||
 | 
			
		||||
    classIcon:SetWidth(Gladdy.db.classIconSize * Gladdy.db.classIconWidthFactor)
 | 
			
		||||
    classIcon:SetHeight(Gladdy.db.classIconSize)
 | 
			
		||||
 | 
			
		||||
    if Gladdy.db.classIconZoomed then
 | 
			
		||||
        if classIcon.texture.masked then
 | 
			
		||||
            classIcon.texture:SetMask(nil)
 | 
			
		||||
            classIcon.texture:SetTexCoord(0.1,0.9,0.1,0.9)
 | 
			
		||||
            classIcon.texture.masked = nil
 | 
			
		||||
        end
 | 
			
		||||
    else
 | 
			
		||||
        if not classIcon.texture.masked then
 | 
			
		||||
            classIcon.texture:SetMask(nil)
 | 
			
		||||
            classIcon.texture:SetTexCoord(0,1,0,1)
 | 
			
		||||
            classIcon.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
 | 
			
		||||
            classIcon.texture.masked = true
 | 
			
		||||
            if Gladdy.frame.testing then
 | 
			
		||||
                testAgain = true
 | 
			
		||||
            end
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    Gladdy:SetPosition(classIcon, unit, "classIconXOffset", "classIconYOffset", Classicon:LegacySetPosition(classIcon, unit), Classicon)
 | 
			
		||||
 | 
			
		||||
    if (Gladdy.db.classIconGroup) then
 | 
			
		||||
@@ -167,6 +195,10 @@ function Classicon:UpdateFrame(unit)
 | 
			
		||||
    classIcon.texture.overlay:SetVertexColor(Gladdy:SetColor(Gladdy.db.classIconBorderColor))
 | 
			
		||||
    if Gladdy.db.classIconEnabled then
 | 
			
		||||
        classIcon:Show()
 | 
			
		||||
        if testAgain then
 | 
			
		||||
            Classicon:ResetUnit(unit)
 | 
			
		||||
            Classicon:ENEMY_SPOTTED(unit)
 | 
			
		||||
        end
 | 
			
		||||
    else
 | 
			
		||||
        classIcon:Hide()
 | 
			
		||||
    end
 | 
			
		||||
@@ -261,17 +293,24 @@ function Classicon:GetOptions()
 | 
			
		||||
            args = {
 | 
			
		||||
                size = {
 | 
			
		||||
                    type = "group",
 | 
			
		||||
                    name = L["Icon size"],
 | 
			
		||||
                    name = L["Icon"],
 | 
			
		||||
                    order = 1,
 | 
			
		||||
                    args = {
 | 
			
		||||
                        header = {
 | 
			
		||||
                            type = "header",
 | 
			
		||||
                            name = L["Icon size"],
 | 
			
		||||
                            name = L["Icon"],
 | 
			
		||||
                            order = 1,
 | 
			
		||||
                        },
 | 
			
		||||
                        classIconZoomed = Gladdy:option({
 | 
			
		||||
                            type = "toggle",
 | 
			
		||||
                            name = L["Zoomed Icon"],
 | 
			
		||||
                            desc = L["Zoomes the icon to remove borders"],
 | 
			
		||||
                            order = 2,
 | 
			
		||||
                            width = "full",
 | 
			
		||||
                        }),
 | 
			
		||||
                        classIconSize = Gladdy:option({
 | 
			
		||||
                            type = "range",
 | 
			
		||||
                            name = L["Icon size"],
 | 
			
		||||
                            name = L["Size"],
 | 
			
		||||
                            min = 3,
 | 
			
		||||
                            max = 100,
 | 
			
		||||
                            step = .1,
 | 
			
		||||
 
 | 
			
		||||
@@ -3,8 +3,10 @@ local tbl_sort = table.sort
 | 
			
		||||
local GetTime = GetTime
 | 
			
		||||
local CreateFrame = CreateFrame
 | 
			
		||||
local GetSpellInfo = GetSpellInfo
 | 
			
		||||
local AURA_TYPE_BUFF = AURA_TYPE_BUFF
 | 
			
		||||
 | 
			
		||||
local Gladdy = LibStub("Gladdy")
 | 
			
		||||
local LCG = LibStub("LibCustomGlow-1.0")
 | 
			
		||||
local L = Gladdy.L
 | 
			
		||||
 | 
			
		||||
local function tableLength(tbl)
 | 
			
		||||
@@ -56,6 +58,10 @@ local Cooldowns = Gladdy:NewModule("Cooldowns", nil, {
 | 
			
		||||
    cooldownYOffset = 0,
 | 
			
		||||
    cooldownXOffset = 0,
 | 
			
		||||
    cooldownSize = 30,
 | 
			
		||||
    cooldownIconGlow = true,
 | 
			
		||||
    cooldownIconZoomed = false,
 | 
			
		||||
    cooldownIconDesaturateOnCooldown = false,
 | 
			
		||||
    cooldownIconAlphaOnCooldown = 1,
 | 
			
		||||
    cooldownWidthFactor = 1,
 | 
			
		||||
    cooldownIconPadding = 1,
 | 
			
		||||
    cooldownMaxIconsPerLine = 10,
 | 
			
		||||
@@ -94,6 +100,7 @@ function Cooldowns:Initialize()
 | 
			
		||||
    self:RegisterMessage("UNIT_SPEC")
 | 
			
		||||
    self:RegisterMessage("UNIT_DEATH")
 | 
			
		||||
    self:RegisterMessage("UNIT_DESTROYED")
 | 
			
		||||
    self:RegisterMessage("AURA_GAIN")
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
---------------------
 | 
			
		||||
@@ -123,6 +130,7 @@ function Cooldowns:CreateIcon() -- returns iconFrame
 | 
			
		||||
 | 
			
		||||
        icon.texture = icon:CreateTexture(nil, "BACKGROUND")
 | 
			
		||||
        icon.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
 | 
			
		||||
        icon.texture.masked = true
 | 
			
		||||
        icon.texture:SetAllPoints(icon)
 | 
			
		||||
 | 
			
		||||
        icon.cooldown = CreateFrame("Cooldown", nil, icon, "CooldownFrameTemplate")
 | 
			
		||||
@@ -158,8 +166,13 @@ function Cooldowns:UpdateIcon(icon)
 | 
			
		||||
    icon.cooldownFont:SetFont(Gladdy:SMFetch("font", "cooldownFont"), Gladdy.db.cooldownSize / 2 * Gladdy.db.cooldownFontScale, "OUTLINE")
 | 
			
		||||
    icon.cooldownFont:SetTextColor(Gladdy:SetColor(Gladdy.db.cooldownFontColor))
 | 
			
		||||
 | 
			
		||||
    icon.cooldown:SetWidth(icon:GetWidth() - icon:GetWidth()/16)
 | 
			
		||||
    icon.cooldown:SetHeight(icon:GetHeight() - icon:GetHeight()/16)
 | 
			
		||||
    if Gladdy.db.cooldownIconZoomed then
 | 
			
		||||
        icon.cooldown:SetWidth(icon:GetWidth())
 | 
			
		||||
        icon.cooldown:SetHeight(icon:GetHeight())
 | 
			
		||||
    else
 | 
			
		||||
        icon.cooldown:SetWidth(icon:GetWidth() - icon:GetWidth()/16)
 | 
			
		||||
        icon.cooldown:SetHeight(icon:GetHeight() - icon:GetHeight()/16)
 | 
			
		||||
    end
 | 
			
		||||
    icon.cooldown:ClearAllPoints()
 | 
			
		||||
    icon.cooldown:SetPoint("CENTER", icon, "CENTER")
 | 
			
		||||
    icon.cooldown:SetAlpha(Gladdy.db.cooldownCooldownAlpha)
 | 
			
		||||
@@ -169,6 +182,31 @@ function Cooldowns:UpdateIcon(icon)
 | 
			
		||||
 | 
			
		||||
    icon.border:SetTexture(Gladdy.db.cooldownBorderStyle)
 | 
			
		||||
    icon.border:SetVertexColor(Gladdy:SetColor(Gladdy.db.cooldownBorderColor))
 | 
			
		||||
 | 
			
		||||
    if Gladdy.db.cooldownIconZoomed then
 | 
			
		||||
        if icon.texture.masked then
 | 
			
		||||
            icon.texture:SetMask(nil)
 | 
			
		||||
            icon.texture:SetTexCoord(0.1,0.9,0.1,0.9)
 | 
			
		||||
            icon.texture.masked = nil
 | 
			
		||||
        end
 | 
			
		||||
    else
 | 
			
		||||
        if not icon.texture.masked then
 | 
			
		||||
            icon.texture:SetMask(nil)
 | 
			
		||||
            icon.texture:SetTexCoord(0,1,0,1)
 | 
			
		||||
            icon.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
 | 
			
		||||
            icon.texture.masked = true
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
    if Gladdy.db.cooldownIconDesaturateOnCooldown and icon.active then
 | 
			
		||||
        icon.texture:SetDesaturated(true)
 | 
			
		||||
    else
 | 
			
		||||
        icon.texture:SetDesaturated(false)
 | 
			
		||||
    end
 | 
			
		||||
    if Gladdy.db.cooldownIconAlphaOnCooldown < 1 and icon.active then
 | 
			
		||||
        icon.texture:SetAlpha(Gladdy.db.cooldownIconAlphaOnCooldown)
 | 
			
		||||
    else
 | 
			
		||||
        icon.texture:SetAlpha(1)
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function Cooldowns:IconsSetPoint(button)
 | 
			
		||||
@@ -221,6 +259,7 @@ end
 | 
			
		||||
function Cooldowns:UpdateFrame(unit)
 | 
			
		||||
    local button = Gladdy.buttons[unit]
 | 
			
		||||
    -- Cooldown frame
 | 
			
		||||
    local testAgain = false
 | 
			
		||||
    if (Gladdy.db.cooldown) then
 | 
			
		||||
        button.spellCooldownFrame:SetHeight(Gladdy.db.cooldownSize)
 | 
			
		||||
        button.spellCooldownFrame:SetWidth(1)
 | 
			
		||||
@@ -246,13 +285,25 @@ function Cooldowns:UpdateFrame(unit)
 | 
			
		||||
 | 
			
		||||
        -- Update each cooldown icon
 | 
			
		||||
        for _,icon in pairs(button.spellCooldownFrame.icons) do
 | 
			
		||||
            testAgain = icon.texture.masked
 | 
			
		||||
            self:UpdateIcon(icon)
 | 
			
		||||
            if icon.texture.masked ~= testAgain then
 | 
			
		||||
                testAgain = true
 | 
			
		||||
            else
 | 
			
		||||
                testAgain = false
 | 
			
		||||
            end
 | 
			
		||||
        end
 | 
			
		||||
        self:IconsSetPoint(button)
 | 
			
		||||
        button.spellCooldownFrame:Show()
 | 
			
		||||
    else
 | 
			
		||||
        button.spellCooldownFrame:Hide()
 | 
			
		||||
    end
 | 
			
		||||
    if testAgain and Gladdy.frame.testing then
 | 
			
		||||
        Cooldowns:ResetUnit(unit)
 | 
			
		||||
        Cooldowns:ENEMY_SPOTTED(unit)
 | 
			
		||||
        Cooldowns:UNIT_SPEC(unit)
 | 
			
		||||
        Cooldowns:Test(unit)
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function Cooldowns:ResetUnit(unit)
 | 
			
		||||
@@ -290,6 +341,7 @@ function Cooldowns:ClearIcon(button, index, spellId, icon)
 | 
			
		||||
    icon.cooldown:Hide()
 | 
			
		||||
    icon.cooldownFont:SetText("")
 | 
			
		||||
    icon:SetScript("OnUpdate", nil)
 | 
			
		||||
    LCG:ButtonGlow_Stop(icon)
 | 
			
		||||
    tinsert(self.iconCache, icon)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
@@ -301,6 +353,7 @@ function Cooldowns:Test(unit)
 | 
			
		||||
    if Gladdy.frame.testing then
 | 
			
		||||
        self:UpdateTestCooldowns(unit)
 | 
			
		||||
    end
 | 
			
		||||
    Cooldowns:AURA_GAIN(_, AURA_TYPE_BUFF, "22812", "Barkskin", _, 20, _, _, _, _, unit, true) -- unit, auraType, spellID, spellName, texture, duration, expirationTime
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function Cooldowns:UpdateTestCooldowns(unit)
 | 
			
		||||
@@ -338,7 +391,45 @@ function Cooldowns:UNIT_SPEC(unit)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function Cooldowns:UNIT_DESTROYED(unit)
 | 
			
		||||
    self:ResetUnit(unit)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
--[[
 | 
			
		||||
    /run local a=LibStub("Gladdy").modules["Cooldowns"] a:AURA_GAIN("arena1",22812)
 | 
			
		||||
    /run local a=LibStub("Gladdy").modules["Cooldowns"] a:AURA_FADE("arena1",22812)
 | 
			
		||||
--]]
 | 
			
		||||
function Cooldowns:AURA_GAIN(_, auraType, spellID, spellName, _, duration, _, _, _, _, unitCaster, test)
 | 
			
		||||
    local arenaUnit = test and unitCaster or Gladdy:GetArenaUnit(unitCaster, true)
 | 
			
		||||
    if not Gladdy.db.cooldownIconGlow or not arenaUnit or not Gladdy.buttons[arenaUnit] or auraType ~= AURA_TYPE_BUFF then
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
    local cooldownFrame = Gladdy.buttons[arenaUnit].spellCooldownFrame
 | 
			
		||||
 | 
			
		||||
    local spellId = Cooldowns.cooldownSpellIds[spellName] -- don't use spellId from combatlog, in case of different spellrank
 | 
			
		||||
    if spellID == 16188 or spellID == 17116 then -- Nature's Swiftness (same name for druid and shaman)
 | 
			
		||||
        spellId = spellID
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    for _,icon in pairs(cooldownFrame.icons) do
 | 
			
		||||
        if (icon.spellId == spellId) then
 | 
			
		||||
            if icon._ButtonGlow and not icon._ButtonGlow.animIn:IsPlaying() or not icon._ButtonGlow then
 | 
			
		||||
                LCG.ButtonGlow_Start(icon, nil, 0.15)
 | 
			
		||||
                C_Timer.NewTimer(duration, function() LCG.ButtonGlow_Stop(icon) end)
 | 
			
		||||
            end
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function Cooldowns:AURA_FADE(unit, spellID)
 | 
			
		||||
    if not Gladdy.buttons[unit] then
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
    local cooldownFrame = Gladdy.buttons[unit].spellCooldownFrame
 | 
			
		||||
    for _,icon in pairs(cooldownFrame.icons) do
 | 
			
		||||
        if (icon.spellId == spellID) then
 | 
			
		||||
            LCG.ButtonGlow_Stop(icon)
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
---------------------
 | 
			
		||||
@@ -355,6 +446,13 @@ function Cooldowns:CooldownStart(button, spellId, duration, start)
 | 
			
		||||
            icon.active = true
 | 
			
		||||
            icon.timeLeft = start and start - GetTime() + duration or duration
 | 
			
		||||
            if (not Gladdy.db.cooldownDisableCircle) then icon.cooldown:SetCooldown(start or GetTime(), duration) end
 | 
			
		||||
            if Gladdy.db.cooldownIconDesaturateOnCooldown then
 | 
			
		||||
                icon.texture:SetDesaturated(true)
 | 
			
		||||
            end
 | 
			
		||||
            if Gladdy.db.cooldownIconAlphaOnCooldown < 1 then
 | 
			
		||||
                icon.texture:SetAlpha(Gladdy.db.cooldownIconAlphaOnCooldown)
 | 
			
		||||
            end
 | 
			
		||||
            --if math.random(1, 30 ) > 10 then LCG.ButtonGlow_Start(icon, nil, 0.15) end
 | 
			
		||||
            icon:SetScript("OnUpdate", function(self, elapsed)
 | 
			
		||||
                self.timeLeft = self.timeLeft - elapsed
 | 
			
		||||
                local timeLeft = ceil(self.timeLeft)
 | 
			
		||||
@@ -378,21 +476,29 @@ function Cooldowns:CooldownStart(button, spellId, duration, start)
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local function resetIcon(icon)
 | 
			
		||||
    if Gladdy.db.cooldownIconDesaturateOnCooldown then
 | 
			
		||||
        icon.texture:SetDesaturated(false)
 | 
			
		||||
    end
 | 
			
		||||
    if Gladdy.db.cooldownIconAlphaOnCooldown < 1 then
 | 
			
		||||
        icon.texture:SetAlpha(1)
 | 
			
		||||
    end
 | 
			
		||||
    icon.active = false
 | 
			
		||||
    icon.cooldown:Hide()
 | 
			
		||||
    icon.cooldownFont:SetText("")
 | 
			
		||||
    icon:SetScript("OnUpdate", nil)
 | 
			
		||||
    --LCG.ButtonGlow_Stop(icon)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function Cooldowns:CooldownReady(button, spellId, frame)
 | 
			
		||||
    if (frame == false) then
 | 
			
		||||
        for _,icon in pairs(button.spellCooldownFrame.icons) do
 | 
			
		||||
            if (icon.spellId == spellId) then
 | 
			
		||||
                icon.active = false
 | 
			
		||||
                icon.cooldown:Hide()
 | 
			
		||||
                icon.cooldownFont:SetText("")
 | 
			
		||||
                icon:SetScript("OnUpdate", nil)
 | 
			
		||||
                resetIcon(icon)
 | 
			
		||||
            end
 | 
			
		||||
        end
 | 
			
		||||
    else
 | 
			
		||||
        frame.active = false
 | 
			
		||||
        frame.cooldown:Hide()
 | 
			
		||||
        frame.cooldownFont:SetText("")
 | 
			
		||||
        frame:SetScript("OnUpdate", nil)
 | 
			
		||||
        resetIcon(frame)
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
@@ -495,7 +601,7 @@ function Cooldowns:AddCooldown(spellID, value, button)
 | 
			
		||||
        icon.texture:SetTexture(self.spellTextures[spellID])
 | 
			
		||||
        tinsert(button.spellCooldownFrame.icons, icon)
 | 
			
		||||
        self:IconsSetPoint(button)
 | 
			
		||||
        Gladdy:Debug("Cooldowns:AddCooldown", button.unit, GetSpellInfo(spellID))
 | 
			
		||||
        Gladdy:Debug("INFO", "Cooldowns:AddCooldown", button.unit, GetSpellInfo(spellID))
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
@@ -569,11 +675,18 @@ function Cooldowns:GetOptions()
 | 
			
		||||
                            name = L["Icon"],
 | 
			
		||||
                            order = 2,
 | 
			
		||||
                        },
 | 
			
		||||
                        cooldownIconZoomed = Gladdy:option({
 | 
			
		||||
                            type = "toggle",
 | 
			
		||||
                            name = L["Zoomed Icon"],
 | 
			
		||||
                            desc = L["Zoomes the icon to remove borders"],
 | 
			
		||||
                            order = 4,
 | 
			
		||||
                            width = "full",
 | 
			
		||||
                        }),
 | 
			
		||||
                        cooldownSize = Gladdy:option({
 | 
			
		||||
                            type = "range",
 | 
			
		||||
                            name = L["Cooldown size"],
 | 
			
		||||
                            desc = L["Size of each cd icon"],
 | 
			
		||||
                            order = 4,
 | 
			
		||||
                            order = 5,
 | 
			
		||||
                            min = 5,
 | 
			
		||||
                            max = 50,
 | 
			
		||||
                            width = "full",
 | 
			
		||||
@@ -582,7 +695,7 @@ function Cooldowns:GetOptions()
 | 
			
		||||
                            type = "range",
 | 
			
		||||
                            name = L["Icon Width Factor"],
 | 
			
		||||
                            desc = L["Stretches the icon"],
 | 
			
		||||
                            order = 5,
 | 
			
		||||
                            order = 6,
 | 
			
		||||
                            min = 0.5,
 | 
			
		||||
                            max = 2,
 | 
			
		||||
                            step = 0.05,
 | 
			
		||||
@@ -592,7 +705,7 @@ function Cooldowns:GetOptions()
 | 
			
		||||
                            type = "range",
 | 
			
		||||
                            name = L["Icon Padding"],
 | 
			
		||||
                            desc = L["Space between Icons"],
 | 
			
		||||
                            order = 6,
 | 
			
		||||
                            order = 7,
 | 
			
		||||
                            min = 0,
 | 
			
		||||
                            max = 10,
 | 
			
		||||
                            step = 0.1,
 | 
			
		||||
@@ -610,6 +723,35 @@ function Cooldowns:GetOptions()
 | 
			
		||||
                            name = L["Cooldown"],
 | 
			
		||||
                            order = 2,
 | 
			
		||||
                        },
 | 
			
		||||
                        cooldownIconGlow = Gladdy:option({
 | 
			
		||||
                            type = "toggle",
 | 
			
		||||
                            name = L["Glow Icon"],
 | 
			
		||||
                            desc = L["Glow the icon when cooldown active"],
 | 
			
		||||
                            order = 3,
 | 
			
		||||
                            width = "full",
 | 
			
		||||
                        }),
 | 
			
		||||
                        cooldownIconDesaturateOnCooldown = Gladdy:option({
 | 
			
		||||
                            type = "toggle",
 | 
			
		||||
                            name = L["Desaturate Icon"],
 | 
			
		||||
                            order = 4,
 | 
			
		||||
                            width = "full",
 | 
			
		||||
                        }),
 | 
			
		||||
                        cooldownIconAlphaOnCooldown = Gladdy:option({
 | 
			
		||||
                            type = "range",
 | 
			
		||||
                            name = L["Cooldown alpha on CD"],
 | 
			
		||||
                            desc = L["Alpha of the icon when cooldown active"],
 | 
			
		||||
                            desc = L["changes "],
 | 
			
		||||
                            order = 5,
 | 
			
		||||
                            min = 0,
 | 
			
		||||
                            max = 1,
 | 
			
		||||
                            step = 0.1,
 | 
			
		||||
                            width = "full",
 | 
			
		||||
                        }),
 | 
			
		||||
                        headerCircle = {
 | 
			
		||||
                            type = "header",
 | 
			
		||||
                            name = L["Cooldowncircle"],
 | 
			
		||||
                            order = 6,
 | 
			
		||||
                        },
 | 
			
		||||
                        cooldownDisableCircle = Gladdy:option({
 | 
			
		||||
                            type = "toggle",
 | 
			
		||||
                            name = L["No Cooldown Circle"],
 | 
			
		||||
 
 | 
			
		||||
@@ -7,7 +7,8 @@ local CreateFrame = CreateFrame
 | 
			
		||||
local GetTime = GetTime
 | 
			
		||||
 | 
			
		||||
local Gladdy = LibStub("Gladdy")
 | 
			
		||||
local DRData = LibStub("DRData-1.0-BCC")
 | 
			
		||||
--local DRData = LibStub("DRData-1.0-BCC")
 | 
			
		||||
local DRData = LibStub("DRList-1.0")
 | 
			
		||||
local L = Gladdy.L
 | 
			
		||||
local function defaultCategories()
 | 
			
		||||
    local categories = {}
 | 
			
		||||
@@ -36,6 +37,7 @@ local Diminishings = Gladdy:NewModule("Diminishings", nil, {
 | 
			
		||||
    drXOffset = 0,
 | 
			
		||||
    drYOffset = 0,
 | 
			
		||||
    drIconSize = 36,
 | 
			
		||||
    drIconZoomed = false,
 | 
			
		||||
    drEnabled = true,
 | 
			
		||||
    drBorderStyle = "Interface\\AddOns\\Gladdy\\Images\\Border_Gloss",
 | 
			
		||||
    drBorderColor = { r = 1, g = 1, b = 1, a = 1 },
 | 
			
		||||
@@ -94,21 +96,21 @@ function Diminishings:CreateFrame(unit)
 | 
			
		||||
 | 
			
		||||
    for i = 1, 16 do
 | 
			
		||||
        local icon = CreateFrame("Frame", "GladdyDr" .. unit .. "Icon" .. i, drFrame)
 | 
			
		||||
        icon.drFrame = drFrame
 | 
			
		||||
        icon:Hide()
 | 
			
		||||
        icon:EnableMouse(false)
 | 
			
		||||
        icon:SetFrameStrata(Gladdy.db.drFrameStrata)
 | 
			
		||||
        icon:SetFrameLevel(Gladdy.db.drFrameLevel)
 | 
			
		||||
        icon.texture = icon:CreateTexture(nil, "BACKGROUND")
 | 
			
		||||
        icon.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
 | 
			
		||||
        icon.texture.masked = true
 | 
			
		||||
        icon.texture:SetAllPoints(icon)
 | 
			
		||||
        icon:SetScript("OnUpdate", function(self, elapsed)
 | 
			
		||||
            if (self.active) then
 | 
			
		||||
            if (self.running) then
 | 
			
		||||
                if (self.timeLeft <= 0) then
 | 
			
		||||
                    if (self.factor == drFrame.tracked[self.dr]) then
 | 
			
		||||
                        drFrame.tracked[self.dr] = 0
 | 
			
		||||
                    end
 | 
			
		||||
 | 
			
		||||
                    self.drFrame.tracked[self.dr] = nil
 | 
			
		||||
                    self.active = false
 | 
			
		||||
                    self.running = false
 | 
			
		||||
                    self.dr = nil
 | 
			
		||||
                    self.diminishing = 1.0
 | 
			
		||||
                    self.texture:SetTexture("")
 | 
			
		||||
@@ -215,6 +217,7 @@ function Diminishings:UpdateFrame(unit)
 | 
			
		||||
                0, "drEnabled")
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    local testAgain = false
 | 
			
		||||
    for i = 1, 16 do
 | 
			
		||||
        local icon = drFrame["icon" .. i]
 | 
			
		||||
 | 
			
		||||
@@ -242,8 +245,13 @@ function Diminishings:UpdateFrame(unit)
 | 
			
		||||
            icon.drLevelText:SetTextColor(Gladdy:SetColor(Gladdy.db.drLevelTextColor))
 | 
			
		||||
        end
 | 
			
		||||
 | 
			
		||||
        icon.cooldown:SetWidth(icon:GetWidth() - icon:GetWidth()/16)
 | 
			
		||||
        icon.cooldown:SetHeight(icon:GetHeight() - icon:GetHeight()/16)
 | 
			
		||||
        if Gladdy.db.drIconZoomed then
 | 
			
		||||
            icon.cooldown:SetWidth(icon:GetWidth())
 | 
			
		||||
            icon.cooldown:SetHeight(icon:GetHeight())
 | 
			
		||||
        else
 | 
			
		||||
            icon.cooldown:SetWidth(icon:GetWidth() - icon:GetWidth()/16)
 | 
			
		||||
            icon.cooldown:SetHeight(icon:GetHeight() - icon:GetHeight()/16)
 | 
			
		||||
        end
 | 
			
		||||
        icon.cooldown:ClearAllPoints()
 | 
			
		||||
        icon.cooldown:SetPoint("CENTER", icon, "CENTER")
 | 
			
		||||
        if Gladdy.db.drDisableCircle then
 | 
			
		||||
@@ -285,9 +293,27 @@ function Diminishings:UpdateFrame(unit)
 | 
			
		||||
            icon.border:SetTexture(Gladdy.db.drBorderStyle)
 | 
			
		||||
        end
 | 
			
		||||
 | 
			
		||||
        --icon.texture:SetTexCoord(.1, .9, .1, .9)
 | 
			
		||||
        --icon.texture:SetPoint("TOPLEFT", icon, "TOPLEFT", 2, -2)
 | 
			
		||||
        --icon.texture:SetPoint("BOTTOMRIGHT", icon, "BOTTOMRIGHT", -2, 2)
 | 
			
		||||
        if Gladdy.db.drIconZoomed then
 | 
			
		||||
            if icon.texture.masked then
 | 
			
		||||
                icon.texture:SetMask(nil)
 | 
			
		||||
                icon.texture:SetTexCoord(0.1,0.9,0.1,0.9)
 | 
			
		||||
                icon.texture.masked = nil
 | 
			
		||||
            end
 | 
			
		||||
        else
 | 
			
		||||
            if not icon.texture.masked then
 | 
			
		||||
                icon.texture:SetMask(nil)
 | 
			
		||||
                icon.texture:SetTexCoord(0,1,0,1)
 | 
			
		||||
                icon.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
 | 
			
		||||
                icon.texture.masked = true
 | 
			
		||||
                if Gladdy.frame.testing then
 | 
			
		||||
                    testAgain = true
 | 
			
		||||
                end
 | 
			
		||||
            end
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
    if testAgain then
 | 
			
		||||
        Diminishings:ResetUnit(unit)
 | 
			
		||||
        Diminishings:Test(unit)
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
@@ -302,6 +328,7 @@ function Diminishings:ResetUnit(unit)
 | 
			
		||||
    for i = 1, 16 do
 | 
			
		||||
        local icon = drFrame["icon" .. i]
 | 
			
		||||
        icon.active = false
 | 
			
		||||
        icon.running = false
 | 
			
		||||
        icon.timeLeft = 0
 | 
			
		||||
        icon.texture:SetTexture("")
 | 
			
		||||
        icon.timeText:SetText("")
 | 
			
		||||
@@ -340,12 +367,123 @@ function Diminishings:Test(unit)
 | 
			
		||||
            amount = rand(1,3)
 | 
			
		||||
            index = rand(1, #enabledCategories[i].spellIDs)
 | 
			
		||||
            for _=1, amount do
 | 
			
		||||
                self:AuraGain(unit, enabledCategories[i].spellIDs[index])
 | 
			
		||||
                self:AuraFade(unit, enabledCategories[i].spellIDs[index])
 | 
			
		||||
            end
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
--[[ testcases for show icon with icon.active = true and icon.running = false and no cooldown. Only when AuraFade start set icon.running = true and start cooldown
 | 
			
		||||
    SPELL_AURA_APPLIED
 | 
			
		||||
        Script:     /run local a=LibStub("Gladdy").modules["Diminishings"] a:AuraGain("arena1", 10890)
 | 
			
		||||
        Script:     /run local a=LibStub("Gladdy").modules["Diminishings"] a:AuraGain("arena1", 2637)
 | 
			
		||||
        Script:     /run local a=LibStub("Gladdy").modules["Diminishings"] a:AuraGain("arena1", 10890) a:AuraGain("arena1", 2637)
 | 
			
		||||
        expected:   stale icon AND 1/2 dr
 | 
			
		||||
    SPELL_AURA_REMOVED
 | 
			
		||||
        Script:     /run local a=LibStub("Gladdy").modules["Diminishings"] a:AuraFade("arena1", 10890)
 | 
			
		||||
        Script:     /run local a=LibStub("Gladdy").modules["Diminishings"] a:AuraFade("arena1", 2637)
 | 
			
		||||
        Script:     /run local a=LibStub("Gladdy").modules["Diminishings"] a:AuraFade("arena1", 2637) a:AuraFade("arena1", 10890)
 | 
			
		||||
        expected:   icon 1/2 AND 1/2 dr
 | 
			
		||||
    SPELL_AURA_REFRESH
 | 
			
		||||
        Script:     /run local a=LibStub("Gladdy").modules["Diminishings"] a:AuraGain("arena1", 10890) a:AuraGain("arena1", 10890)
 | 
			
		||||
        expected:   icon 1/4 AND 1/4 dr
 | 
			
		||||
    two different spells with same DR applied and one fades
 | 
			
		||||
        Script:     /run local a=LibStub("Gladdy").modules["Diminishings"] a:AuraGain("arena1", 10890) a:AuraGain("arena1", 2094) a:AuraFade("arena1", 10890)
 | 
			
		||||
        expected:   icon 1/4 AND 1/4 dr
 | 
			
		||||
    two different spells with same DR applied and both fade
 | 
			
		||||
        Script:     /run local a=LibStub("Gladdy").modules["Diminishings"] a:AuraGain("arena1", 10890) a:AuraGain("arena1", 2094) a:AuraFade("arena1", 10890) a:AuraFade("arena1", 2094)
 | 
			
		||||
        expected:   icon 1/4 AND 1/4 dr
 | 
			
		||||
    three different spells with same DR applied and two fade
 | 
			
		||||
        Script:     /run local a=LibStub("Gladdy").modules["Diminishings"] a:AuraGain("arena1", 10890) a:AuraGain("arena1", 2094) a:AuraGain("arena1", 5484) a:AuraFade("arena1", 10890) a:AuraFade("arena1", 2094)
 | 
			
		||||
        expected:   icon 0 AND 0 dr
 | 
			
		||||
--]]
 | 
			
		||||
 | 
			
		||||
function Diminishings:FindLastIcon(unit, drCat)
 | 
			
		||||
    local drFrame = self.frames[unit]
 | 
			
		||||
    if (not drFrame or not drCat) then
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
    if not Gladdy.db.drCategories[drCat].enabled then
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
    local lastIcon
 | 
			
		||||
    for i = 1, 16 do
 | 
			
		||||
        local icon = drFrame["icon" .. i]
 | 
			
		||||
        if ((icon.active) and icon.dr and icon.dr == drCat) then
 | 
			
		||||
            lastIcon = icon
 | 
			
		||||
            break
 | 
			
		||||
        elseif not icon.active and not lastIcon then
 | 
			
		||||
            lastIcon = icon
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
    return lastIcon
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function Diminishings:PrepareIcon(unit, lastIcon, drCat, spellID)
 | 
			
		||||
    local drFrame = self.frames[unit]
 | 
			
		||||
 | 
			
		||||
    lastIcon.dr = drCat
 | 
			
		||||
    lastIcon.diminishing = drFrame.tracked[drCat]
 | 
			
		||||
    if Gladdy.db.drBorderColorsEnabled then
 | 
			
		||||
        lastIcon.border:SetVertexColor(getDiminishColor(lastIcon.diminishing))
 | 
			
		||||
    else
 | 
			
		||||
        lastIcon.border:SetVertexColor(Gladdy:SetColor(Gladdy.db.drBorderColor))
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    if Gladdy.db.drCategories[drCat].forceIcon then
 | 
			
		||||
        lastIcon.texture:SetTexture(Gladdy.db.drCategories[drCat].icon)
 | 
			
		||||
    else
 | 
			
		||||
        lastIcon.texture:SetTexture(select(3, GetSpellInfo(spellID)))
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    if Gladdy.db.drFontColorsEnabled then
 | 
			
		||||
        lastIcon.timeText:SetTextColor(getDiminishColor(lastIcon.diminishing))
 | 
			
		||||
    else
 | 
			
		||||
        lastIcon.timeText:SetTextColor(Gladdy:SetColor(Gladdy.db.drFontColor))
 | 
			
		||||
    end
 | 
			
		||||
    lastIcon.drLevelText:SetText("")
 | 
			
		||||
    if Gladdy.db.drLevelTextColorsEnabled then
 | 
			
		||||
        lastIcon.drLevelText:SetTextColor(getDiminishColor(lastIcon.diminishing))
 | 
			
		||||
    else
 | 
			
		||||
        lastIcon.drLevelText:SetTextColor(Gladdy:SetColor(Gladdy.db.drLevelTextColor))
 | 
			
		||||
    end
 | 
			
		||||
    lastIcon.drLevelText:SetText(getDiminishText(lastIcon.diminishing))
 | 
			
		||||
    lastIcon.active = true
 | 
			
		||||
    self:Positionate(unit)
 | 
			
		||||
    lastIcon:Show()
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function Diminishings:AuraGain(unit, spellID)
 | 
			
		||||
    local drFrame = self.frames[unit]
 | 
			
		||||
    local drCat = DRData:GetSpellCategory(spellID)
 | 
			
		||||
    if (not drFrame or not drCat) then
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
    if not Gladdy.db.drCategories[drCat].enabled then
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    -- due to dynamic DR we reset the DR here if dr == 0
 | 
			
		||||
    if not drFrame.tracked[drCat] or drFrame.tracked[drCat] == 0 then
 | 
			
		||||
        drFrame.tracked[drCat] = DRData:NextDR(1)
 | 
			
		||||
    else
 | 
			
		||||
        drFrame.tracked[drCat] = DRData:NextDR(drFrame.tracked[drCat] == 1.0 and 1 or drFrame.tracked[drCat] == 0.5 and 2 or 3)
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    -- add icon with no timer
 | 
			
		||||
    local lastIcon = Diminishings:FindLastIcon(unit, drCat)
 | 
			
		||||
    if not lastIcon then return end
 | 
			
		||||
 | 
			
		||||
    Diminishings:PrepareIcon(unit, lastIcon, drCat, spellID)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    lastIcon.running = false
 | 
			
		||||
    lastIcon.cooldown:Hide()
 | 
			
		||||
    lastIcon.cooldown:SetCooldown(0, 0)
 | 
			
		||||
    lastIcon.timeText:SetText("")
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function Diminishings:AuraFade(unit, spellID)
 | 
			
		||||
    local drFrame = self.frames[unit]
 | 
			
		||||
    local drCat = DRData:GetSpellCategory(spellID)
 | 
			
		||||
@@ -356,49 +494,16 @@ function Diminishings:AuraFade(unit, spellID)
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    local lastIcon
 | 
			
		||||
    for i = 1, 16 do
 | 
			
		||||
        local icon = drFrame["icon" .. i]
 | 
			
		||||
        if (icon.active and icon.dr and icon.dr == drCat) then
 | 
			
		||||
            lastIcon = icon
 | 
			
		||||
            break
 | 
			
		||||
        elseif not icon.active and not lastIcon then
 | 
			
		||||
            lastIcon = icon
 | 
			
		||||
            lastIcon.diminishing = 1.0
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
    -- find icon and start timer
 | 
			
		||||
    local lastIcon = Diminishings:FindLastIcon(unit, drCat)
 | 
			
		||||
    if not lastIcon then return end
 | 
			
		||||
    lastIcon.dr = drCat
 | 
			
		||||
 | 
			
		||||
    Diminishings:PrepareIcon(unit, lastIcon, drCat, spellID)
 | 
			
		||||
 | 
			
		||||
    lastIcon.timeLeft = Gladdy.db.drDuration
 | 
			
		||||
    lastIcon.diminishing = DRData:NextDR(lastIcon.diminishing)
 | 
			
		||||
    if Gladdy.db.drBorderColorsEnabled then
 | 
			
		||||
        lastIcon.border:SetVertexColor(getDiminishColor(lastIcon.diminishing))
 | 
			
		||||
    else
 | 
			
		||||
        lastIcon.border:SetVertexColor(Gladdy:SetColor(Gladdy.db.drBorderColor))
 | 
			
		||||
    end
 | 
			
		||||
    lastIcon.cooldown:Show()
 | 
			
		||||
    lastIcon.cooldown:SetCooldown(GetTime(), Gladdy.db.drDuration)
 | 
			
		||||
    if Gladdy.db.drCategories[drCat].forceIcon then
 | 
			
		||||
        lastIcon.texture:SetTexture(Gladdy.db.drCategories[drCat].icon)
 | 
			
		||||
    else
 | 
			
		||||
        lastIcon.texture:SetTexture(select(3, GetSpellInfo(spellID)))
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    if Gladdy.db.drFontColorsEnabled then
 | 
			
		||||
        lastIcon.timeText:SetTextColor(getDiminishColor(lastIcon.diminishing))
 | 
			
		||||
    else
 | 
			
		||||
        lastIcon.timeText:SetTextColor(Gladdy:SetColor(Gladdy.db.drFontColor))
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    lastIcon.drLevelText:SetText(getDiminishText(lastIcon.diminishing))
 | 
			
		||||
    if Gladdy.db.drLevelTextColorsEnabled then
 | 
			
		||||
        lastIcon.drLevelText:SetTextColor(getDiminishColor(lastIcon.diminishing))
 | 
			
		||||
    else
 | 
			
		||||
        lastIcon.drLevelText:SetTextColor(Gladdy:SetColor(Gladdy.db.drLevelTextColor))
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    lastIcon.active = true
 | 
			
		||||
    self:Positionate(unit)
 | 
			
		||||
    lastIcon:Show()
 | 
			
		||||
    lastIcon.running = true
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function Diminishings:Positionate(unit)
 | 
			
		||||
@@ -495,11 +600,18 @@ function Diminishings:GetOptions()
 | 
			
		||||
                            name = L["Icon"],
 | 
			
		||||
                            order = 4,
 | 
			
		||||
                        },
 | 
			
		||||
                        drIconZoomed = Gladdy:option({
 | 
			
		||||
                            type = "toggle",
 | 
			
		||||
                            name = L["Zoomed Icon"],
 | 
			
		||||
                            desc = L["Zoomes the icon to remove borders"],
 | 
			
		||||
                            order = 5,
 | 
			
		||||
                            width = "full",
 | 
			
		||||
                        }),
 | 
			
		||||
                        drIconSize = Gladdy:option({
 | 
			
		||||
                            type = "range",
 | 
			
		||||
                            name = L["Icon Size"],
 | 
			
		||||
                            desc = L["Size of the DR Icons"],
 | 
			
		||||
                            order = 5,
 | 
			
		||||
                            order = 6,
 | 
			
		||||
                            min = 5,
 | 
			
		||||
                            max = 80,
 | 
			
		||||
                            step = 1,
 | 
			
		||||
@@ -509,7 +621,7 @@ function Diminishings:GetOptions()
 | 
			
		||||
                            type = "range",
 | 
			
		||||
                            name = L["Icon Width Factor"],
 | 
			
		||||
                            desc = L["Stretches the icon"],
 | 
			
		||||
                            order = 6,
 | 
			
		||||
                            order = 7,
 | 
			
		||||
                            min = 0.5,
 | 
			
		||||
                            max = 2,
 | 
			
		||||
                            step = 0.05,
 | 
			
		||||
@@ -519,7 +631,7 @@ function Diminishings:GetOptions()
 | 
			
		||||
                            type = "range",
 | 
			
		||||
                            name = L["Icon Padding"],
 | 
			
		||||
                            desc = L["Space between Icons"],
 | 
			
		||||
                            order = 7,
 | 
			
		||||
                            order = 8,
 | 
			
		||||
                            min = 0,
 | 
			
		||||
                            max = 10,
 | 
			
		||||
                            step = 0.1,
 | 
			
		||||
 
 | 
			
		||||
@@ -24,6 +24,7 @@ local function table_copy(t, str)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local ExportImport = Gladdy:NewModule("Export Import", nil, {
 | 
			
		||||
    expansion = Gladdy.expansion,
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
local export = AceGUI:Create("Frame")
 | 
			
		||||
@@ -112,6 +113,18 @@ local deletedOptions = { -- backwards compatibility
 | 
			
		||||
    padding = true,
 | 
			
		||||
    growUp = true,
 | 
			
		||||
    powerBarFontSize = true,
 | 
			
		||||
    ["38373"] = true, -- The Beast Within (Auras)
 | 
			
		||||
    ["34692"] = true, -- The Beast Within (Cooldowns)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
local expansionSpecific = {
 | 
			
		||||
    "drCategories",
 | 
			
		||||
    "auraListDefault",
 | 
			
		||||
    "auraListInterrupts",
 | 
			
		||||
    "trackedDebuffs",
 | 
			
		||||
    "trackedBuffs",
 | 
			
		||||
    "cooldownCooldowns",
 | 
			
		||||
    "cooldownCooldownsOrder",
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
local function checkIsDeletedOption(k, str, msg, errorFound, errorMsg)
 | 
			
		||||
@@ -162,7 +175,7 @@ function ExportImport:CheckDeserializedOptions(tbl, refTbl, str)
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    if errorFound then
 | 
			
		||||
        return false, errorMsg
 | 
			
		||||
        --return false, errorMsg
 | 
			
		||||
    end
 | 
			
		||||
    return true
 | 
			
		||||
end
 | 
			
		||||
@@ -227,17 +240,29 @@ function ExportImport:ApplyImport(t, table, str)
 | 
			
		||||
        if (not t.newLayout) then
 | 
			
		||||
            table.newLayout = false
 | 
			
		||||
        end
 | 
			
		||||
        if not t.expansion then
 | 
			
		||||
            t.expansion = "BCC"
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
    for k,v in pairs(t) do
 | 
			
		||||
        if type(v) == "table" then
 | 
			
		||||
            if (table[k] ~= nil) then
 | 
			
		||||
                ExportImport:ApplyImport(v, table[k], str .. "." .. k)
 | 
			
		||||
            else
 | 
			
		||||
                Gladdy:Debug("ERROR", "ApplyImport failed for", str .. "." .. k)
 | 
			
		||||
        local skip = k == "expansion"
 | 
			
		||||
        if t.expansion and t.expansion ~= table.expansion then
 | 
			
		||||
            if Gladdy:contains(k, expansionSpecific) then
 | 
			
		||||
                Gladdy:Debug("WARN", "ExportImport:ApplyImport", "skipped", k, "- import string expansion is", t.expansion, "- current expansion is", table.expansion)
 | 
			
		||||
                skip = true
 | 
			
		||||
            end
 | 
			
		||||
        end
 | 
			
		||||
        if not skip then
 | 
			
		||||
            if type(v) == "table" then
 | 
			
		||||
                if (table[k] ~= nil) then
 | 
			
		||||
                    ExportImport:ApplyImport(v, table[k], str .. "." .. k)
 | 
			
		||||
                else
 | 
			
		||||
                    Gladdy:Debug("ERROR", "ExportImport:ApplyImport", "failed for", str .. "." .. k)
 | 
			
		||||
                end
 | 
			
		||||
 | 
			
		||||
        else
 | 
			
		||||
            table[k] = v
 | 
			
		||||
            else
 | 
			
		||||
                table[k] = v
 | 
			
		||||
            end
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 
 | 
			
		||||
@@ -118,7 +118,7 @@ function Healthbar:CreateFrame(unit)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function Healthbar.OnEvent(self, event, unit)
 | 
			
		||||
    local isDead = UnitExists(unit) and UnitIsDeadOrGhost(unit)
 | 
			
		||||
    local isDead = UnitExists(unit) and UnitIsDeadOrGhost(unit) and not Gladdy:isFeignDeath(unit)
 | 
			
		||||
    if event == "UNIT_HEALTH_FREQUENT" or event == "UNIT_MAXHEALTH" then
 | 
			
		||||
        if isDead then
 | 
			
		||||
            Gladdy:SendMessage("UNIT_DEATH", unit)
 | 
			
		||||
@@ -207,7 +207,7 @@ function Healthbar:SetHealthText(healthBar, health, healthMax)
 | 
			
		||||
    local healthText = ""
 | 
			
		||||
    local healthPercentage = health and healthMax and floor(health * 100 / healthMax)
 | 
			
		||||
 | 
			
		||||
    if health == 0 and UnitExists(healthBar.unit) and UnitIsDeadOrGhost(healthBar.unit) then
 | 
			
		||||
    if health == 0 and UnitExists(healthBar.unit) and UnitIsDeadOrGhost(healthBar.unit) and not Gladdy:isFeignDeath(healthBar.unit) then
 | 
			
		||||
        self:UNIT_DEATH(healthBar.unit)
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
 
 | 
			
		||||
@@ -11,6 +11,7 @@ local Racial = Gladdy:NewModule("Racial", 79, {
 | 
			
		||||
    racialEnabled = true,
 | 
			
		||||
    racialSize = 60 + 20 + 1,
 | 
			
		||||
    racialWidthFactor = 0.9,
 | 
			
		||||
    racialIconZoomed = false,
 | 
			
		||||
    racialXOffset = 0,
 | 
			
		||||
    racialYOffset = 0,
 | 
			
		||||
    racialBorderStyle = "Interface\\AddOns\\Gladdy\\Images\\Border_rounded_blp",
 | 
			
		||||
@@ -32,6 +33,9 @@ function Racial:Initialize()
 | 
			
		||||
        self:RegisterMessage("JOINED_ARENA")
 | 
			
		||||
        self:RegisterMessage("ENEMY_SPOTTED")
 | 
			
		||||
        self:RegisterMessage("RACIAL_USED")
 | 
			
		||||
        if Gladdy.expansion == "Wrath" then
 | 
			
		||||
            self:RegisterMessage("TRINKET_USED")
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
@@ -40,6 +44,9 @@ function Racial:UpdateFrameOnce()
 | 
			
		||||
        self:RegisterMessage("JOINED_ARENA")
 | 
			
		||||
        self:RegisterMessage("ENEMY_SPOTTED")
 | 
			
		||||
        self:RegisterMessage("RACIAL_USED")
 | 
			
		||||
        if Gladdy.expansion == "Wrath" then
 | 
			
		||||
            self:RegisterMessage("TRINKET_USED")
 | 
			
		||||
        end
 | 
			
		||||
    else
 | 
			
		||||
        self:UnregisterAllMessages()
 | 
			
		||||
    end
 | 
			
		||||
@@ -85,6 +92,7 @@ function Racial:CreateFrame(unit)
 | 
			
		||||
    racial.texture = racial:CreateTexture(nil, "BACKGROUND")
 | 
			
		||||
    racial.texture:SetAllPoints(racial)
 | 
			
		||||
    racial.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
 | 
			
		||||
    racial.texture.masked = true
 | 
			
		||||
    --racial.texture:SetTexture("Interface\\Icons\\INV_Jewelry_TrinketPVP_02")
 | 
			
		||||
 | 
			
		||||
    racial.cooldown = CreateFrame("Cooldown", nil, racial, "CooldownFrameTemplate")
 | 
			
		||||
@@ -127,6 +135,7 @@ function Racial:UpdateFrame(unit)
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    local testAgain = false
 | 
			
		||||
    local width, height = Gladdy.db.racialSize * Gladdy.db.racialWidthFactor, Gladdy.db.racialSize
 | 
			
		||||
 | 
			
		||||
    racial:SetFrameStrata(Gladdy.db.racialFrameStrata)
 | 
			
		||||
@@ -140,8 +149,13 @@ function Racial:UpdateFrame(unit)
 | 
			
		||||
 | 
			
		||||
    racial:SetWidth(width)
 | 
			
		||||
    racial:SetHeight(height)
 | 
			
		||||
    racial.cooldown:SetWidth(width - width/16)
 | 
			
		||||
    racial.cooldown:SetHeight(height - height/16)
 | 
			
		||||
    if Gladdy.db.racialIconZoomed then
 | 
			
		||||
        racial.cooldown:SetWidth(width)
 | 
			
		||||
        racial.cooldown:SetHeight(height)
 | 
			
		||||
    else
 | 
			
		||||
        racial.cooldown:SetWidth(width - width/16)
 | 
			
		||||
        racial.cooldown:SetHeight(height - height/16)
 | 
			
		||||
    end
 | 
			
		||||
    racial.cooldown:ClearAllPoints()
 | 
			
		||||
    racial.cooldown:SetPoint("CENTER", racial, "CENTER")
 | 
			
		||||
    racial.cooldown.noCooldownCount = true -- Gladdy.db.racialDisableOmniCC
 | 
			
		||||
@@ -153,6 +167,24 @@ function Racial:UpdateFrame(unit)
 | 
			
		||||
    racial.texture.overlay:SetTexture(Gladdy.db.racialBorderStyle)
 | 
			
		||||
    racial.texture.overlay:SetVertexColor(Gladdy:SetColor(Gladdy.db.racialBorderColor))
 | 
			
		||||
 | 
			
		||||
    if Gladdy.db.racialIconZoomed then
 | 
			
		||||
        if racial.texture.masked then
 | 
			
		||||
            racial.texture:SetMask(nil)
 | 
			
		||||
            racial.texture:SetTexCoord(0.1,0.9,0.1,0.9)
 | 
			
		||||
            racial.texture.masked = nil
 | 
			
		||||
        end
 | 
			
		||||
    else
 | 
			
		||||
        if not racial.texture.masked then
 | 
			
		||||
            racial.texture:SetMask(nil)
 | 
			
		||||
            racial.texture:SetTexCoord(0,1,0,1)
 | 
			
		||||
            racial.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
 | 
			
		||||
            racial.texture.masked = true
 | 
			
		||||
            if Gladdy.frame.testing then
 | 
			
		||||
                testAgain = true
 | 
			
		||||
            end
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    Gladdy:SetPosition(racial, unit, "racialXOffset", "racialYOffset", Racial:LegacySetPosition(racial, unit), Racial)
 | 
			
		||||
 | 
			
		||||
    if (Gladdy.db.racialGroup) then
 | 
			
		||||
@@ -183,6 +215,10 @@ function Racial:UpdateFrame(unit)
 | 
			
		||||
        racial:Hide()
 | 
			
		||||
    else
 | 
			
		||||
        racial:Show()
 | 
			
		||||
        if testAgain then
 | 
			
		||||
            Racial:ResetUnit(unit)
 | 
			
		||||
            Racial:Test(unit)
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
@@ -197,7 +233,7 @@ end
 | 
			
		||||
function Racial:RACIAL_USED(unit, expirationTime, spellName)
 | 
			
		||||
    local racial = self.frames[unit]
 | 
			
		||||
    local button = Gladdy.buttons[unit]
 | 
			
		||||
    if (not racial or not button or not button.race) then
 | 
			
		||||
    if (not racial or not button or not button.race or not Gladdy.db.racialEnabled) then
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
    if expirationTime and Gladdy:Racials()[button.race].spellName ~= spellName then
 | 
			
		||||
@@ -207,6 +243,23 @@ function Racial:RACIAL_USED(unit, expirationTime, spellName)
 | 
			
		||||
    Racial:Used(unit, startTime, Gladdy:Racials()[button.race].duration)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function Racial:TRINKET_USED(unit) -- Wrath only
 | 
			
		||||
    local racial = self.frames[unit]
 | 
			
		||||
    local button = Gladdy.buttons[unit]
 | 
			
		||||
    if (not racial or not button or not button.race) then
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
    if button.race == "Scourge" then
 | 
			
		||||
        if racial.active and racial.timeLeft >= 45 then
 | 
			
		||||
            -- do nothing
 | 
			
		||||
        else
 | 
			
		||||
            self:Used(unit, GetTime(), 45)
 | 
			
		||||
        end
 | 
			
		||||
    elseif button.race == "Human" then
 | 
			
		||||
        self:Used(unit, GetTime(), 120)
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function Racial:Used(unit, startTime, duration)
 | 
			
		||||
    local racial = self.frames[unit]
 | 
			
		||||
    if (not racial) then
 | 
			
		||||
@@ -241,8 +294,8 @@ end
 | 
			
		||||
 | 
			
		||||
function Racial:Test(unit)
 | 
			
		||||
    Racial:ENEMY_SPOTTED(unit)
 | 
			
		||||
    if (unit == "arena1" or unit == "arena3") then
 | 
			
		||||
        Racial:Used(unit, GetTime(), Gladdy:Racials()[Gladdy.buttons[unit].race].duration)
 | 
			
		||||
    if (unit == "arena2" or unit == "arena3") then
 | 
			
		||||
        Gladdy:SendMessage("RACIAL_USED", unit)
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
@@ -288,21 +341,28 @@ function Racial:GetOptions()
 | 
			
		||||
            args = {
 | 
			
		||||
                general = {
 | 
			
		||||
                    type = "group",
 | 
			
		||||
                    name = L["Size"],
 | 
			
		||||
                    name = L["Icon"],
 | 
			
		||||
                    order = 1,
 | 
			
		||||
                    args = {
 | 
			
		||||
                        header = {
 | 
			
		||||
                            type = "header",
 | 
			
		||||
                            name = L["Size"],
 | 
			
		||||
                            name = L["Icon"],
 | 
			
		||||
                            order = 1,
 | 
			
		||||
                        },
 | 
			
		||||
                        racialIconZoomed = Gladdy:option({
 | 
			
		||||
                            type = "toggle",
 | 
			
		||||
                            name = L["Zoomed Icon"],
 | 
			
		||||
                            desc = L["Zoomes the icon to remove borders"],
 | 
			
		||||
                            order = 2,
 | 
			
		||||
                            width = "full",
 | 
			
		||||
                        }),
 | 
			
		||||
                        racialSize = Gladdy:option({
 | 
			
		||||
                            type = "range",
 | 
			
		||||
                            name = L["Icon size"],
 | 
			
		||||
                            min = 5,
 | 
			
		||||
                            max = 100,
 | 
			
		||||
                            step = 1,
 | 
			
		||||
                            order = 2,
 | 
			
		||||
                            order = 3,
 | 
			
		||||
                            width = "full",
 | 
			
		||||
                        }),
 | 
			
		||||
                        racialWidthFactor = Gladdy:option({
 | 
			
		||||
@@ -311,7 +371,7 @@ function Racial:GetOptions()
 | 
			
		||||
                            min = 0.5,
 | 
			
		||||
                            max = 2,
 | 
			
		||||
                            step = 0.05,
 | 
			
		||||
                            order = 3,
 | 
			
		||||
                            order = 4,
 | 
			
		||||
                            width = "full",
 | 
			
		||||
                        }),
 | 
			
		||||
                    },
 | 
			
		||||
 
 | 
			
		||||
@@ -330,7 +330,7 @@ function TotemPulse:CreateCooldownFrame(style)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function TotemPulse:AddTimerFrame(nameplate, timestamp, test)
 | 
			
		||||
    if (nameplate:IsShown() or test) and timestamp then
 | 
			
		||||
    if (nameplate:IsShown() or test) and timestamp and timestamp.id then
 | 
			
		||||
        if not nameplate.totemTick then
 | 
			
		||||
            nameplate.totemTick = TotemPulse:CreateCooldownFrame(Gladdy.db.totemPulseTotems["totem" .. timestamp.id].style)
 | 
			
		||||
        end
 | 
			
		||||
 
 | 
			
		||||
@@ -13,6 +13,7 @@ local Trinket = Gladdy:NewModule("Trinket", 80, {
 | 
			
		||||
    trinketEnabled = true,
 | 
			
		||||
    trinketSize = 60 + 20 + 1,
 | 
			
		||||
    trinketWidthFactor = 0.9,
 | 
			
		||||
    trinketIconZoomed = false,
 | 
			
		||||
    trinketBorderStyle = "Interface\\AddOns\\Gladdy\\Images\\Border_rounded_blp",
 | 
			
		||||
    trinketBorderColor = { r = 0, g = 0, b = 0, a = 1 },
 | 
			
		||||
    trinketDisableCircle = false,
 | 
			
		||||
@@ -33,12 +34,19 @@ function Trinket:Initialize()
 | 
			
		||||
    self.frames = {}
 | 
			
		||||
    if Gladdy.db.trinketEnabled then
 | 
			
		||||
        self:RegisterMessage("JOINED_ARENA")
 | 
			
		||||
        self:RegisterMessage("TRINKET_USED")
 | 
			
		||||
        if Gladdy.expansion == "Wrath" then
 | 
			
		||||
            self:RegisterMessage("RACIAL_USED")
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function Trinket:UpdateFrameOnce()
 | 
			
		||||
    if Gladdy.db.trinketEnabled then
 | 
			
		||||
        self:RegisterMessage("JOINED_ARENA")
 | 
			
		||||
        if Gladdy.expansion == "Wrath" then
 | 
			
		||||
            self:RegisterMessage("RACIAL_USED")
 | 
			
		||||
        end
 | 
			
		||||
    else
 | 
			
		||||
        self:UnregisterAllMessages()
 | 
			
		||||
    end
 | 
			
		||||
@@ -94,6 +102,7 @@ function Trinket:CreateFrame(unit)
 | 
			
		||||
    trinket.texture:SetAllPoints(trinket)
 | 
			
		||||
    trinket.texture:SetTexture("Interface\\Icons\\INV_Jewelry_TrinketPVP_02")
 | 
			
		||||
    trinket.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
 | 
			
		||||
    trinket.texture.masked = true
 | 
			
		||||
 | 
			
		||||
    trinket.cooldown = CreateFrame("Cooldown", nil, trinket, "CooldownFrameTemplate")
 | 
			
		||||
    trinket.cooldown.noCooldownCount = true --Gladdy.db.trinketDisableOmniCC
 | 
			
		||||
@@ -137,17 +146,7 @@ function Trinket:UpdateFrame(unit)
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    if Gladdy.db.trinketColored then
 | 
			
		||||
        if trinket.active then
 | 
			
		||||
            trinket:SetBackdropColor(Gladdy:SetColor(Gladdy.db.trinketColoredCd))
 | 
			
		||||
        else
 | 
			
		||||
            trinket:SetBackdropColor(Gladdy:SetColor(Gladdy.db.trinketColoredNoCd))
 | 
			
		||||
        end
 | 
			
		||||
        trinket.texture:SetTexture()
 | 
			
		||||
    else
 | 
			
		||||
        trinket:SetBackdropColor(0,0,0,0)
 | 
			
		||||
        trinket.texture:SetTexture("Interface\\Icons\\INV_Jewelry_TrinketPVP_02")
 | 
			
		||||
    end
 | 
			
		||||
    local testAgain = false
 | 
			
		||||
 | 
			
		||||
    local width, height = Gladdy.db.trinketSize * Gladdy.db.trinketWidthFactor, Gladdy.db.trinketSize
 | 
			
		||||
 | 
			
		||||
@@ -162,8 +161,14 @@ function Trinket:UpdateFrame(unit)
 | 
			
		||||
 | 
			
		||||
    trinket:SetWidth(width)
 | 
			
		||||
    trinket:SetHeight(height)
 | 
			
		||||
    trinket.cooldown:SetWidth(width - width/16)
 | 
			
		||||
    trinket.cooldown:SetHeight(height - height/16)
 | 
			
		||||
    if Gladdy.db.trinketIconZoomed then
 | 
			
		||||
        trinket.cooldown:SetWidth(width)
 | 
			
		||||
        trinket.cooldown:SetHeight(height)
 | 
			
		||||
 | 
			
		||||
    else
 | 
			
		||||
        trinket.cooldown:SetWidth(width - width/16)
 | 
			
		||||
        trinket.cooldown:SetHeight(height - height/16)
 | 
			
		||||
    end
 | 
			
		||||
    trinket.cooldown:ClearAllPoints()
 | 
			
		||||
    trinket.cooldown:SetPoint("CENTER", trinket, "CENTER")
 | 
			
		||||
    trinket.cooldown.noCooldownCount = true -- Gladdy.db.trinketDisableOmniCC
 | 
			
		||||
@@ -175,6 +180,36 @@ function Trinket:UpdateFrame(unit)
 | 
			
		||||
    trinket.texture.overlay:SetTexture(Gladdy.db.trinketBorderStyle)
 | 
			
		||||
    trinket.texture.overlay:SetVertexColor(Gladdy:SetColor(Gladdy.db.trinketBorderColor))
 | 
			
		||||
 | 
			
		||||
    if Gladdy.db.trinketIconZoomed then
 | 
			
		||||
        if trinket.texture.masked then
 | 
			
		||||
            trinket.texture:SetMask(nil)
 | 
			
		||||
            trinket.texture:SetTexCoord(0.1,0.9,0.1,0.9)
 | 
			
		||||
            trinket.texture.masked = nil
 | 
			
		||||
        end
 | 
			
		||||
    else
 | 
			
		||||
        if not trinket.texture.masked then
 | 
			
		||||
            trinket.texture:SetMask(nil)
 | 
			
		||||
            trinket.texture:SetTexCoord(0,1,0,1)
 | 
			
		||||
            trinket.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask")
 | 
			
		||||
            trinket.texture.masked = true
 | 
			
		||||
            if Gladdy.frame.testing then
 | 
			
		||||
                testAgain = true
 | 
			
		||||
            end
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    if Gladdy.db.trinketColored then
 | 
			
		||||
        if trinket.active then
 | 
			
		||||
            trinket:SetBackdropColor(Gladdy:SetColor(Gladdy.db.trinketColoredCd))
 | 
			
		||||
        else
 | 
			
		||||
            trinket:SetBackdropColor(Gladdy:SetColor(Gladdy.db.trinketColoredNoCd))
 | 
			
		||||
        end
 | 
			
		||||
        trinket.texture:SetTexture()
 | 
			
		||||
    else
 | 
			
		||||
        trinket:SetBackdropColor(0,0,0,0)
 | 
			
		||||
        trinket.texture:SetTexture("Interface\\Icons\\INV_Jewelry_TrinketPVP_02")
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    Gladdy:SetPosition(trinket, unit, "trinketXOffset", "trinketYOffset", Trinket:LegacySetPosition(trinket, unit), Trinket)
 | 
			
		||||
 | 
			
		||||
    if (Gladdy.db.trinketGroup) then
 | 
			
		||||
@@ -214,6 +249,10 @@ function Trinket:UpdateFrame(unit)
 | 
			
		||||
        trinket:Hide()
 | 
			
		||||
    else
 | 
			
		||||
        trinket:Show()
 | 
			
		||||
        if testAgain then
 | 
			
		||||
            Trinket:ResetUnit(unit)
 | 
			
		||||
            Trinket:Test(unit)
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
@@ -228,6 +267,7 @@ function Trinket:ResetUnit(unit)
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    trinket.itemID = nil
 | 
			
		||||
    trinket.timeLeft = nil
 | 
			
		||||
    trinket.active = false
 | 
			
		||||
    trinket.cooldown:Clear()
 | 
			
		||||
@@ -239,13 +279,14 @@ function Trinket:Test(unit)
 | 
			
		||||
    if (not trinket) then
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
    if (unit == "arena2" or unit == "arena3") then
 | 
			
		||||
        self:Used(unit, GetTime() * 1000, 120000)
 | 
			
		||||
    if (unit == "arena1" or unit == "arena2") then
 | 
			
		||||
        Gladdy:SendMessage("TRINKET_USED", unit)
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function Trinket:JOINED_ARENA()
 | 
			
		||||
    self:RegisterEvent("ARENA_COOLDOWNS_UPDATE")
 | 
			
		||||
    self:RegisterEvent("ARENA_CROWD_CONTROL_SPELL_UPDATE")
 | 
			
		||||
    self:SetScript("OnEvent", function(self, event, ...)
 | 
			
		||||
        if self[event] then
 | 
			
		||||
            self[event](self, ...)
 | 
			
		||||
@@ -253,13 +294,52 @@ function Trinket:JOINED_ARENA()
 | 
			
		||||
    end)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function Trinket:ARENA_CROWD_CONTROL_SPELL_UPDATE(...)
 | 
			
		||||
    local unitID, spellID, itemID = ...
 | 
			
		||||
    Gladdy:Debug("INFO", "Trinket:ARENA_CROWD_CONTROL_SPELL_UPDATE", unitID, spellID, itemID)
 | 
			
		||||
    if Gladdy.buttons[unitID] and Gladdy:GetPvpTrinkets()[itemID] then
 | 
			
		||||
        Gladdy.buttons[unitID].trinket.itemID = itemID
 | 
			
		||||
        if not Gladdy.db.trinketColored then
 | 
			
		||||
            self.frames[unitID].texture:SetTexture(GetItemIcon(itemID))
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function Trinket:TRINKET_USED(unit)
 | 
			
		||||
    if Gladdy.buttons[unit] then
 | 
			
		||||
        self:Used(unit, GetTime() * 1000,
 | 
			
		||||
                Gladdy.buttons[unit].trinket.itemID and Gladdy:GetPvpTrinkets()[Gladdy.buttons[unit].trinket.itemID]
 | 
			
		||||
                        or 120000)
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function Trinket:RACIAL_USED(unit) -- Wrath only
 | 
			
		||||
    local trinket = self.frames[unit]
 | 
			
		||||
    if (not trinket) then
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
    if Gladdy.buttons[unit].race == "Scourge" then
 | 
			
		||||
        if trinket.active and trinket.timeLeft >= 45 then
 | 
			
		||||
            -- do nothing
 | 
			
		||||
        else
 | 
			
		||||
            self:Used(unit, GetTime() * 1000, 45000)
 | 
			
		||||
        end
 | 
			
		||||
    elseif Gladdy.buttons[unit].race == "Human" then
 | 
			
		||||
        self:Used(unit, GetTime() * 1000, 120000)
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function Trinket:ARENA_COOLDOWNS_UPDATE()
 | 
			
		||||
    for i=1, Gladdy.curBracket do
 | 
			
		||||
        local unit = "arena" .. i
 | 
			
		||||
        local spellID, itemID, startTime, duration = C_PvP.GetArenaCrowdControlInfo(unit);
 | 
			
		||||
        local unitID = "arena" .. i
 | 
			
		||||
        local spellID, itemID, startTime, duration = C_PvP.GetArenaCrowdControlInfo(unitID)
 | 
			
		||||
        if (spellID) then
 | 
			
		||||
            Gladdy:Debug("INFO", "Trinket:ARENA_COOLDOWNS_UPDATE", spellID, itemID, startTime, duration)
 | 
			
		||||
            if not Gladdy.db.trinketColored and Gladdy:GetPvpTrinkets()[itemID] then
 | 
			
		||||
                self.frames[unitID].texture:SetTexture(GetItemIcon(itemID))
 | 
			
		||||
            end
 | 
			
		||||
            if (startTime ~= 0 and duration ~= 0) then
 | 
			
		||||
                self:Used(unit, startTime, duration)
 | 
			
		||||
                self:Used(unitID, startTime, duration)
 | 
			
		||||
            end
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
@@ -267,18 +347,17 @@ end
 | 
			
		||||
 | 
			
		||||
function Trinket:Used(unit, startTime, duration)
 | 
			
		||||
    local trinket = self.frames[unit]
 | 
			
		||||
    if (not trinket) then
 | 
			
		||||
    if (not trinket or not Gladdy.db.trinketEnabled) then
 | 
			
		||||
        return
 | 
			
		||||
    end
 | 
			
		||||
    if not trinket.active then
 | 
			
		||||
    --if not trinket.active then
 | 
			
		||||
        trinket.timeLeft = (startTime/1000.0 + duration/1000.0) - GetTime()
 | 
			
		||||
        if not Gladdy.db.trinketDisableCircle then trinket.cooldown:SetCooldown(startTime/1000.0, duration/1000.0) end
 | 
			
		||||
        trinket.active = true
 | 
			
		||||
        if Gladdy.db.trinketColored then
 | 
			
		||||
            trinket:SetBackdropColor(Gladdy:SetColor(Gladdy.db.trinketColoredCd))
 | 
			
		||||
        end
 | 
			
		||||
        Gladdy:SendMessage("TRINKET_USED", unit)
 | 
			
		||||
    end
 | 
			
		||||
    --end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function Trinket:GetOptions()
 | 
			
		||||
@@ -346,14 +425,21 @@ function Trinket:GetOptions()
 | 
			
		||||
            args = {
 | 
			
		||||
                general = {
 | 
			
		||||
                    type = "group",
 | 
			
		||||
                    name = L["Size"],
 | 
			
		||||
                    name = L["Icon"],
 | 
			
		||||
                    order = 1,
 | 
			
		||||
                    args = {
 | 
			
		||||
                        header = {
 | 
			
		||||
                            type = "header",
 | 
			
		||||
                            name = L["Size"],
 | 
			
		||||
                            name = L["Icon"],
 | 
			
		||||
                            order = 1,
 | 
			
		||||
                        },
 | 
			
		||||
                        trinketIconZoomed = Gladdy:option({
 | 
			
		||||
                            type = "toggle",
 | 
			
		||||
                            name = L["Zoomed Icon"],
 | 
			
		||||
                            desc = L["Zoomes the icon to remove borders"],
 | 
			
		||||
                            order = 2,
 | 
			
		||||
                            width = "full",
 | 
			
		||||
                        }),
 | 
			
		||||
                        trinketSize = Gladdy:option({
 | 
			
		||||
                            type = "range",
 | 
			
		||||
                            name = L["Size"],
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										14
									
								
								Options.lua
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								Options.lua
									
									
									
									
									
								
							@@ -3,7 +3,6 @@ local tostring, str_match, tonumber, str_format = tostring, string.match, tonumb
 | 
			
		||||
local ceil, floor = ceil, floor
 | 
			
		||||
local ReloadUI = ReloadUI
 | 
			
		||||
 | 
			
		||||
local InterfaceOptionsFrame_OpenToFrame = InterfaceOptionsFrame_OpenToFrame
 | 
			
		||||
local GetSpellInfo = GetSpellInfo
 | 
			
		||||
local LOCALIZED_CLASS_NAMES_MALE = LOCALIZED_CLASS_NAMES_MALE
 | 
			
		||||
local CLASS_ICON_TCOORDS = CLASS_ICON_TCOORDS
 | 
			
		||||
@@ -799,7 +798,7 @@ function Gladdy:SetupOptions()
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function Gladdy:ShowOptions()
 | 
			
		||||
    InterfaceOptionsFrame_OpenToFrame("Gladdy")
 | 
			
		||||
    LibStub("AceConfigDialog-3.0"):Open("Gladdy")
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function Gladdy:GetAuras(auraType)
 | 
			
		||||
@@ -935,6 +934,17 @@ function Gladdy:GetAuras(auraType)
 | 
			
		||||
        end
 | 
			
		||||
        return args
 | 
			
		||||
    end
 | 
			
		||||
    if Gladdy.expansion == "Wrath" then
 | 
			
		||||
        spells.deathknight = {
 | 
			
		||||
            order = 3,
 | 
			
		||||
            type = "group",
 | 
			
		||||
            name = LOCALIZED_CLASS_NAMES_MALE["DEATHKNIGHT"],
 | 
			
		||||
            icon = "Interface\\Glues\\CharacterCreate\\UI-CharacterCreate-Classes",
 | 
			
		||||
            iconCoords = CLASS_ICON_TCOORDS["DEATHKNIGHT"],
 | 
			
		||||
            args = {},
 | 
			
		||||
        }
 | 
			
		||||
        spells.deathknight.args = assignForClass("DEATHKNIGHT")
 | 
			
		||||
    end
 | 
			
		||||
    spells.druid.args = assignForClass("DRUID")
 | 
			
		||||
    spells.hunter.args = assignForClass("HUNTER")
 | 
			
		||||
    spells.mage.args = assignForClass("MAGE")
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										33
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										33
									
								
								README.md
									
									
									
									
									
								
							@@ -1,10 +1,10 @@
 | 
			
		||||
# Gladdy - TBC
 | 
			
		||||
# Gladdy - Classic
 | 
			
		||||
 | 
			
		||||
### The most powerful arena addon for WoW TBC 2.5.4
 | 
			
		||||
### The most powerful arena addon for WoW TBC 2.5.4 & WotLK 3.4.0
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
## [v2.11-Release Download Here](https://github.com/XiconQoo/Gladdy-TBC/releases/download/v2.11-Release/Gladdy_TBC-Classic_v2.11-Release.zip)
 | 
			
		||||
## [v2.20-Beta Download Here](https://github.com/XiconQoo/Gladdy-TBC/releases/download/v2.20-Release/Gladdy_Classic_v2.20-Beta.zip)
 | 
			
		||||
 | 
			
		||||
###### <a target="_blank" rel="noopener noreferrer" href="https://www.paypal.me/xiconqoo/10"><img src="https://raw.githubusercontent.com/XiconQoo/Gladdy/readme-media/Paypal-Donate.png" height="30" style="margin-top:-30px;position:relative;top:20px;"></a> Please consider donating if you like my work
 | 
			
		||||
 | 
			
		||||
@@ -73,12 +73,37 @@ Thank you!
 | 
			
		||||
- **Klimp** (thanks for all the suggestions and active feedback)
 | 
			
		||||
- **the whole TBC addons 2.4.3 discord** (thanks for the support and great community, especially the MVPs)
 | 
			
		||||
- **Hydra** (thanks for constructive feedback and suggestions)
 | 
			
		||||
- **Xyz** (thanks for suggestions)
 | 
			
		||||
- **Xyz** (thanks for suggestions and extensive testing <3)
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
### Changes
 | 
			
		||||
 | 
			
		||||
### v2.20-Beta
 | 
			
		||||
- **Wrath** & **BCC** support
 | 
			
		||||
  - different auras/DRs/Cooldowns/Buffs per expansion
 | 
			
		||||
- **Zoomed Icon** options added for all modules
 | 
			
		||||
- **Cooldowns**
 | 
			
		||||
  - desaturate icon on cd added
 | 
			
		||||
  - alpha on cd added
 | 
			
		||||
  - glow on CD active added
 | 
			
		||||
- **Diminishing**
 | 
			
		||||
  - replaced DRData with DRList (your dr-categories options will be reset like "force icon" and what is enabled)
 | 
			
		||||
  - zoomed icons
 | 
			
		||||
  - changed DR-tracking behaviour (DR will show once aura is applied and start CD once aura fades)
 | 
			
		||||
- **Trinket & Racial**
 | 
			
		||||
  - in Wrath racials like wotf share CD with Trinket and vice versa
 | 
			
		||||
  - fixed some potential API bug in Trinket use detection
 | 
			
		||||
- **ArenaCountdown**
 | 
			
		||||
  - uses C_Timer now
 | 
			
		||||
- **Import/Export of Profiles**
 | 
			
		||||
  - profiles should now be able to import/export between BCC and Wrath
 | 
			
		||||
  - auras, cooldowns, DRs and buffs/debuffs are ignored
 | 
			
		||||
  - positioning, style etc will be transferred between expansions
 | 
			
		||||
- proper Feign Death detection
 | 
			
		||||
- fix detect pet abilities CD like Spell Lock
 | 
			
		||||
- minor bugfixes
 | 
			
		||||
 | 
			
		||||
### v2.11-Release
 | 
			
		||||
- **Cooldowns**
 | 
			
		||||
  - fixed cooldowns not showing properly for detected spec
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										38
									
								
								Util.lua
									
									
									
									
									
								
							
							
						
						
									
										38
									
								
								Util.lua
									
									
									
									
									
								
							@@ -3,6 +3,9 @@ local floor = math.floor
 | 
			
		||||
local str_find, str_gsub, str_sub, tinsert = string.find, string.gsub, string.sub, table.insert
 | 
			
		||||
local Gladdy = LibStub("Gladdy")
 | 
			
		||||
local L = Gladdy.L
 | 
			
		||||
local AuraUtil = AuraUtil
 | 
			
		||||
local GetSpellInfo = GetSpellInfo
 | 
			
		||||
local UnitIsUnit = UnitIsUnit
 | 
			
		||||
 | 
			
		||||
---------------------------
 | 
			
		||||
 | 
			
		||||
@@ -141,4 +144,39 @@ function Gladdy:GetTagOption(name, order, enabledOption, func, toggle)
 | 
			
		||||
                    "Can be combined with OR operator like |cff1ac742[percent|status]|r. The last valid option will be used.\n"],
 | 
			
		||||
        })
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function Gladdy:contains(entry, list)
 | 
			
		||||
    for _,v in pairs(list) do
 | 
			
		||||
        if entry == v then
 | 
			
		||||
            return true
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
    return false
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local feignDeath = GetSpellInfo(5384)
 | 
			
		||||
function Gladdy:isFeignDeath(unit)
 | 
			
		||||
    return AuraUtil.FindAuraByName(feignDeath, unit)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
function Gladdy:GetArenaUnit(unitCaster, unify)
 | 
			
		||||
    if unitCaster then
 | 
			
		||||
        for i=1,5 do
 | 
			
		||||
            local arenaUnit = "arena" .. i
 | 
			
		||||
            local arenaUnitPet = "arenapet" .. i
 | 
			
		||||
            if unify then
 | 
			
		||||
                if unitCaster and (UnitIsUnit(arenaUnit, unitCaster) or UnitIsUnit(arenaUnitPet, unitCaster)) then
 | 
			
		||||
                    return arenaUnit
 | 
			
		||||
                end
 | 
			
		||||
            else
 | 
			
		||||
                if unitCaster and UnitIsUnit(arenaUnit, unitCaster) then
 | 
			
		||||
                    return arenaUnit
 | 
			
		||||
                end
 | 
			
		||||
                if unitCaster and UnitIsUnit(arenaUnitPet, unitCaster) then
 | 
			
		||||
                    return arenaUnitPet
 | 
			
		||||
                end
 | 
			
		||||
            end
 | 
			
		||||
        end
 | 
			
		||||
    end
 | 
			
		||||
end
 | 
			
		||||
@@ -12,7 +12,8 @@
 | 
			
		||||
    <Include file="libs\LibDeflate\lib.xml"/>
 | 
			
		||||
    <Include file="libs\LibSharedMedia-3.0\lib.xml"/>
 | 
			
		||||
    <Include file="libs\AceGUI-3.0-SharedMediaWidgets\widget.xml"/>
 | 
			
		||||
    <Include file="libs\DRData-1.0\DRData-1.0.xml"/>
 | 
			
		||||
    <Include file="libs\DRList-1.0\DRList-1.0.xml"/>
 | 
			
		||||
    <Include file="libs\LibClassAuras-1.0\lib.xml"/>
 | 
			
		||||
    <Include file="libs\LibSpellRange-1.0\lib.xml"/>
 | 
			
		||||
    <Include file="libs\LibCustomGlow-1.0\LibCustomGlow-1.0.lua"/>
 | 
			
		||||
</Ui>
 | 
			
		||||
		Reference in New Issue
	
	Block a user