diff --git a/.gitignore b/.gitignore index 23b1f2d..deb3cb1 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ BuffLib Ace-Libs Images_Raw Gladdy_old +untracked Gladdy_TW \ No newline at end of file diff --git a/Constants.lua b/Constants_BCC.lua similarity index 87% rename from Constants.lua rename to Constants_BCC.lua index 31589a3..bdfa87e 100644 --- a/Constants.lua +++ b/Constants_BCC.lua @@ -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 - diff --git a/Constants_Wrath.lua b/Constants_Wrath.lua new file mode 100644 index 0000000..0b948d3 --- /dev/null +++ b/Constants_Wrath.lua @@ -0,0 +1,1383 @@ +local tbl_sort, select, string_lower = table.sort, select, string.lower + +local GetSpellInfo = GetSpellInfo +local GetItemInfo = GetItemInfo + +local Gladdy = LibStub("Gladdy") +local L = Gladdy.L +local AURA_TYPE_DEBUFF, AURA_TYPE_BUFF = AURA_TYPE_DEBUFF, AURA_TYPE_BUFF + +Gladdy.expansion = "Wrath" +Gladdy.CLASSES = { "MAGE", "PRIEST", "DRUID", "SHAMAN", "PALADIN", "WARLOCK", "WARRIOR", "HUNTER", "ROGUE", "DEATHKNIGHT" } +tbl_sort(Gladdy.CLASSES) + +local specBuffs = { + -- WARRIOR + [GetSpellInfo(56638)] = L["Arms"], -- Taste for Blood + [GetSpellInfo(64976)] = L["Arms"], -- Juggernaut + [GetSpellInfo(57522)] = L["Arms"], -- Enrage + [GetSpellInfo(52437)] = L["Arms"], -- Sudden Death + [GetSpellInfo(46857)] = L["Arms"], -- Trauma + [GetSpellInfo(56112)] = L["Fury"], -- Furious Attacks + [GetSpellInfo(29801)] = L["Fury"], -- Rampage + [GetSpellInfo(46916)] = L["Fury"], -- Slam! + [GetSpellInfo(50227)] = L["Protection"], -- Sword and Board + [GetSpellInfo(50720)] = L["Protection"], -- Vigilance + [GetSpellInfo(74347)] = L["Protection"], -- Silenced - Gag Order + -- PALADIN + [GetSpellInfo(20375)] = L["Retribution"], -- Seal of Command + [GetSpellInfo(59578)] = L["Retribution"], -- The Art of War + [GetSpellInfo(31836)] = L["Holy"], -- Light's Grace + [GetSpellInfo(53563)] = L["Holy"], -- Beacon of Light + [GetSpellInfo(54149)] = L["Holy"], -- Infusion of Light + [GetSpellInfo(63529)] = L["Protection"], -- Silenced - Shield of the Templar + -- ROGUE + [GetSpellInfo(36554)] = L["Subtlety"], -- Shadowstep + [GetSpellInfo(44373)] = L["Subtlety"], -- Shadowstep Speed + [GetSpellInfo(36563)] = L["Subtlety"], -- Shadowstep DMG + [GetSpellInfo(51713)] = L["Subtlety"], -- Shadow Dance + [GetSpellInfo(31665)] = L["Subtlety"], -- Master of Subtlety + [GetSpellInfo(14278)] = L["Subtlety"], -- Ghostly Strike + [GetSpellInfo(51690)] = L["Combat"], -- Killing Spree + [GetSpellInfo(13877)] = L["Combat"], -- Blade Flurry + [GetSpellInfo(13750)] = L["Combat"], -- Adrenaline Rush + [GetSpellInfo(14177)] = L["Assassination"], -- Cold Blood + -- PRIEST + [GetSpellInfo(47788)] = L["Holy"], -- Guardian Spirit + [GetSpellInfo(52800)] = L["Discipline"], -- Borrowed Time + [GetSpellInfo(63944)] = L["Discipline"], -- Renewed Hope + [GetSpellInfo(15473)] = L["Shadow"], -- Shadowform + [GetSpellInfo(15286)] = L["Shadow"], -- Vampiric Embrace + -- DEATHKNIGHT + [GetSpellInfo(49222)] = L["Unholy"], -- Bone Shield + [GetSpellInfo(49016)] = L["Blood"], -- Hysteria + [GetSpellInfo(53138)] = L["Blood"], -- Abomination's Might + [GetSpellInfo(55610)] = L["Frost"], -- Imp. Icy Talons + -- MAGE + [GetSpellInfo(43039)] = L["Frost"], -- Ice Barrier + [GetSpellInfo(74396)] = L["Frost"], -- Fingers of Frost + [GetSpellInfo(57761)] = L["Frost"], -- Fireball! + [GetSpellInfo(11129)] = L["Fire"], -- Combustion + [GetSpellInfo(64346)] = L["Fire"], -- Fiery Payback + [GetSpellInfo(48108)] = L["Fire"], -- Hot Streak + [GetSpellInfo(54741)] = L["Fire"], -- Firestarter + [GetSpellInfo(55360)] = L["Fire"], -- Living Bomb + [GetSpellInfo(31583)] = L["Arcane"], -- Arcane Empowerment + [GetSpellInfo(44413)] = L["Arcane"], -- Incanter's Absorption + -- WARLOCK + [GetSpellInfo(30302)] = L["Destruction"], -- Nether Protection + [GetSpellInfo(63244)] = L["Destruction"], -- Pyroclasm + [GetSpellInfo(54277)] = L["Destruction"], -- Backdraft + [GetSpellInfo(47283)] = L["Destruction"], -- Empowered Imp + [GetSpellInfo(34936)] = L["Destruction"], -- Backlash + [GetSpellInfo(47193)] = L["Demonology"], -- Demonic Empowerment + [GetSpellInfo(64371)] = L["Affliction"], -- Eradication + -- SHAMAN + [GetSpellInfo(57663)] = L["Elemental"], -- Totem of Wrath + [GetSpellInfo(65264)] = L["Elemental"], -- Lava Flows + [GetSpellInfo(51470)] = L["Elemental"], -- Elemental Oath + [GetSpellInfo(52179)] = L["Elemental"], -- Astral Shift + [GetSpellInfo(49284)] = L["Restoration"], -- Earth Shield + [GetSpellInfo(53390)] = L["Restoration"], -- Tidal Waves + [GetSpellInfo(30809)] = L["Enhancement"], -- Unleashed Rage + [GetSpellInfo(53817)] = L["Enhancement"], -- Maelstrom Weapon + [GetSpellInfo(63685)] = L["Enhancement"], -- Freeze (Frozen Power) + -- HUNTER + [GetSpellInfo(20895)] = L["Beast Mastery"], -- Spirit Bond + [GetSpellInfo(34471)] = L["Beast Mastery"], -- The Beast Within + [GetSpellInfo(19506)] = L["Marksmanship"], -- Trueshot Aura + [GetSpellInfo(64420)] = L["Survival"], -- Sniper Training + -- DRUID + [GetSpellInfo(24932)] = L["Feral"], -- Leader of the Pack + [GetSpellInfo(16975)] = L["Feral"], -- Predatory Strikes + [GetSpellInfo(50334)] = L["Feral"], -- Berserk + [GetSpellInfo(24907)] = L["Balance"], -- Moonkin Aura + [GetSpellInfo(24858)] = L["Balance"], -- Moonkin Form + [GetSpellInfo(53251)] = L["Restoration"], -- Wild Growth + [GetSpellInfo(16188)] = L["Restoration"], -- Nature's Swiftness + [GetSpellInfo(33891)] = L["Restoration"], -- Tree of Life +} +function Gladdy:GetSpecBuffs() + return specBuffs +end + +local specSpells = { + -- WARRIOR + [GetSpellInfo(47486)] = L["Arms"], -- Mortal Strike + [GetSpellInfo(46924)] = L["Arms"], -- Bladestorm + [GetSpellInfo(23881)] = L["Fury"], -- Bloodthirst + [GetSpellInfo(12809)] = L["Protection"], -- Concussion Blow + [GetSpellInfo(47498)] = L["Protection"], -- Devastate + [GetSpellInfo(46968)] = L["Protection"], -- Shockwave + [GetSpellInfo(50720)] = L["Protection"], -- Vigilance + -- PALADIN + [GetSpellInfo(48827)] = L["Protection"], -- Avenger's Shield + [GetSpellInfo(48825)] = L["Holy"], -- Holy Shock + [GetSpellInfo(53563)] = L["Holy"], -- Beacon of Light + [GetSpellInfo(35395)] = L["Retribution"], -- Crusader Strike + [GetSpellInfo(66006)] = L["Retribution"], -- Divine Storm + [GetSpellInfo(20066)] = L["Retribution"], -- Repentance + -- ROGUE + [GetSpellInfo(48666)] = L["Assassination"], -- Mutilate + [GetSpellInfo(14177)] = L["Assassination"], -- Cold Blood + [GetSpellInfo(51690)] = L["Combat"], -- Killing Spree + [GetSpellInfo(13877)] = L["Combat"], -- Blade Flurry + [GetSpellInfo(13750)] = L["Combat"], -- Adrenaline Rush + [GetSpellInfo(36554)] = L["Subtlety"], -- Shadowstep + [GetSpellInfo(48660)] = L["Subtlety"], -- Hemorrhage + [GetSpellInfo(51713)] = L["Subtlety"], -- Shadow Dance + -- PRIEST + [GetSpellInfo(53007)] = L["Discipline"], -- Penance + [GetSpellInfo(10060)] = L["Discipline"], -- Power Infusion + [GetSpellInfo(33206)] = L["Discipline"], -- Pain Suppression + [GetSpellInfo(34861)] = L["Holy"], -- Circle of Healing + [GetSpellInfo(15487)] = L["Shadow"], -- Silence + [GetSpellInfo(48160)] = L["Shadow"], -- Vampiric Touch + -- DEATHKNIGHT + [GetSpellInfo(55262)] = L["Blood"], -- Heart Strike + [GetSpellInfo(49203)] = L["Frost"], -- Hungering Cold + [GetSpellInfo(55268)] = L["Frost"], -- Frost Strike + [GetSpellInfo(51411)] = L["Frost"], -- Howling Blast + [GetSpellInfo(55271)] = L["Unholy"], -- Scourge Strike + -- MAGE + [GetSpellInfo(44781)] = L["Arcane"], -- Arcane Barrage + [GetSpellInfo(55360)] = L["Fire"], -- Living Bomb + [GetSpellInfo(42950)] = L["Fire"], -- Dragon's Breath + [GetSpellInfo(42945)] = L["Fire"], -- Blast Wave + [GetSpellInfo(44572)] = L["Frost"], -- Deep Freeze + -- WARLOCK + [GetSpellInfo(59164)] = L["Affliction"], -- Haunt + [GetSpellInfo(47843)] = L["Affliction"], -- Unstable Affliction + [GetSpellInfo(59672)] = L["Demonology"], -- Metamorphosis + [GetSpellInfo(47193)] = L["Demonology"], -- Demonic Empowerment + [GetSpellInfo(59172)] = L["Destruction"], -- Chaos Bolt + [GetSpellInfo(47847)] = L["Destruction"], -- Shadowfury + -- SHAMAN + [GetSpellInfo(59159)] = L["Elemental"], -- Thunderstorm + [GetSpellInfo(16166)] = L["Elemental"], -- Elemental Mastery + [GetSpellInfo(51533)] = L["Enhancement"], -- Feral Spirit + [GetSpellInfo(30823)] = L["Enhancement"], -- Shamanistic Rage + [GetSpellInfo(17364)] = L["Enhancement"], -- Stormstrike + [GetSpellInfo(61301)] = L["Restoration"], -- Riptide + [GetSpellInfo(51886)] = L["Restoration"], -- Cleanse Spirit + -- HUNTER + [GetSpellInfo(19577)] = L["Beast Mastery"], -- Intimidation + [GetSpellInfo(34490)] = L["Marksmanship"], -- Silencing Shot + [GetSpellInfo(53209)] = L["Marksmanship"], -- Chimera Shot + [GetSpellInfo(60053)] = L["Survival"], -- Explosive Shot + [GetSpellInfo(49012)] = L["Survival"], -- Wyvern Sting + -- DRUID + [GetSpellInfo(53201)] = L["Balance"], -- Starfall + [GetSpellInfo(61384)] = L["Balance"], -- Typhoon + [GetSpellInfo(24858)] = L["Balance"], -- Moonkin Form + [GetSpellInfo(48566)] = L["Feral"], -- Mangle (Cat) + [GetSpellInfo(48564)] = L["Feral"], -- Mangle (Bear) + [GetSpellInfo(50334)] = L["Feral"], -- Berserk + [GetSpellInfo(18562)] = L["Restoration"], -- Swiftmend + [GetSpellInfo(17116)] = L["Restoration"], -- Nature's Swiftness + [GetSpellInfo(33891)] = L["Restoration"], -- Tree of Life + [GetSpellInfo(53251)] = L["Restoration"], -- Wild Growth +} +function Gladdy:GetSpecSpells() + return specSpells +end + +local importantAuras = { + --- Crowd control + [GetSpellInfo(33786)] = { -- Cyclone + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 33786, + }, + [GetSpellInfo(18658)] = { -- Hibernate + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 18658, + }, + [GetSpellInfo(14309)] = { -- Freezing Trap Effect + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 14309, + }, + [GetSpellInfo(60210)] = { -- Freezing arrow effect + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 60210, + }, + [GetSpellInfo(6770)] = { -- Sap + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 6770, + }, + [GetSpellInfo(2094)] = { -- Blind + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 2094, + }, + [GetSpellInfo(5782)] = { -- Fear + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 5782, + }, + [GetSpellInfo(47860)] = { -- Death Coil Warlock + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 47860, + }, + [GetSpellInfo(6358)] = { -- Seduction + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 6358, + }, + [GetSpellInfo(5484)] = { -- Howl of Terror + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 5484, + }, + [GetSpellInfo(5246)] = { -- Intimidating Shout + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 5246, + }, + [GetSpellInfo(8122)] = { -- Psychic Scream + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 8122, + }, + [GetSpellInfo(64044)] = { -- Psychic Horror + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 64044, + }, + [GetSpellInfo(12826)] = { -- Polymorph + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 12826, + texture = select(3, GetSpellInfo(12826)), + }, + [GetSpellInfo(51514)] = { -- Hex + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 51514, + }, + [GetSpellInfo(18647)] = { -- Banish + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 18647, + }, + [GetSpellInfo(605)] = { -- Mind Control + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 605, + }, + [GetSpellInfo(14327)] = { -- Scare Beast + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 14327, + }, + + --- Roots + -- Entangling Roots + [GetSpellInfo(26989)] = { + track = AURA_TYPE_DEBUFF, + priority = 30, + spellID = 26989, + }, + [select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689))] = { + track = AURA_TYPE_DEBUFF, + priority = 30, + spellID = 27010, + altName = select(1, GetSpellInfo(27010)) .. " " .. select(1, GetSpellInfo(16689)), + }, + [GetSpellInfo(42917)] = { -- Frost Nova + track = AURA_TYPE_DEBUFF, + priority = 30, + spellID = 42917, + }, + [GetSpellInfo(33395)] = { -- Freeze (Water Elemental) + track = AURA_TYPE_DEBUFF, + priority = 30, + spellID = 33395, + }, + [GetSpellInfo(55080)] = { -- Shattered Barrier + track = AURA_TYPE_DEBUFF, + priority = 30, + spellID = 55080, + }, + [GetSpellInfo(16979)] = { -- Feral Charge + track = AURA_TYPE_DEBUFF, + priority = 30, + spellID = 16979, + }, + [GetSpellInfo(23694)] = { -- Improved Hamstring + track = AURA_TYPE_DEBUFF, + priority = 30, + spellID = 23694, + }, + [GetSpellInfo(4167)] = { -- Web (Hunter Pet) + track = AURA_TYPE_DEBUFF, + priority = 30, + spellID = 4167, + }, + [GetSpellInfo(47168)] = { -- Improved Wingclip + track = AURA_TYPE_DEBUFF, + priority = 30, + spellID = 47168, + }, + + --- Stuns and incapacitates + [GetSpellInfo(8983)] = { -- Bash + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 8983, + }, + [GetSpellInfo(1833)] = { -- Cheap Shot + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 1833, + }, + [GetSpellInfo(8643)] = { -- Kidney Shot + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 8643, + }, + [GetSpellInfo(1776)] = { -- Gouge + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 1776, + }, + [GetSpellInfo(44572)] = { -- Deep Freeze + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 44572, + }, + [GetSpellInfo(49012)] = { -- Wyvern Sting + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 49012, + }, + [GetSpellInfo(19503)] = { -- Scatter Shot + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 19503, + }, + [GetSpellInfo(49803)] = { -- Pounce + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 49803, + }, + [GetSpellInfo(49802)] = { -- Maim + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 49802, + }, + [GetSpellInfo(10308)] = { -- Hammer of Justice + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 10308, + }, + [GetSpellInfo(20066)] = { -- Repentance + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 20066, + }, + [GetSpellInfo(46968)] = { -- Shockwave + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 46968, + }, + [GetSpellInfo(49203)] = { -- Hungering Cold + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 49203, + }, + [GetSpellInfo(47481)] = { -- Gnaw (dk pet stun) + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 47481, + }, + [GetSpellInfo(47847)] = { -- Shadowfury Stun + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 47847, + }, + [GetSpellInfo(16922)] = { -- Imp Starfire Stun + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 16922, + }, + [GetSpellInfo(5530)] = { -- Mace Stun Effect + track = AURA_TYPE_DEBUFF, + priority = 40, + texture = select(3, GetSpellInfo(12284)), + spellID = 5530, + }, + [GetSpellInfo(20549)] = { -- War Stomp + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 20549, + }, + [GetSpellInfo(7922)] = { -- Charge Stun + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 7922, + texture = select(3, GetSpellInfo(100)) + }, + [GetSpellInfo(25274)] = { -- Intercept Stun + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 25274, + texture = select(3, GetSpellInfo(25272)) + }, + [GetSpellInfo(12809)] = { -- Concussion Blow + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 12809, + }, + [GetSpellInfo(12355)] = { -- Impact + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 12355, + }, + [GetSpellInfo(19577)] = {-- Intimidation + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 19577, + }, + [GetSpellInfo(31661)] = { -- Dragon's Breath + track = AURA_TYPE_DEBUFF, + priority = 40, + spellID = 31661, + }, + + --- Silences + [GetSpellInfo(18469)] = { -- Improved Counterspell + track = AURA_TYPE_DEBUFF, + priority = 20, + spellID = 18469, + }, + [GetSpellInfo(15487)] = { -- Silence + track = AURA_TYPE_DEBUFF, + priority = 20, + spellID = 15487, + }, + [GetSpellInfo(34490)] = { -- Silencing Shot + track = AURA_TYPE_DEBUFF, + priority = 20, + spellID = 34490, + }, + [GetSpellInfo(18425)] = { -- Improved Kick + track = AURA_TYPE_DEBUFF, + priority = 20, + spellID = 18425, + }, + [GetSpellInfo(49916)] = { -- Strangulate + track = AURA_TYPE_DEBUFF, + priority = 20, + spellID = 49916, + }, + [GetSpellInfo(74347)] = { -- Silenced - Gag Order + track = AURA_TYPE_DEBUFF, + priority = 20, + spellID = 74347, + }, + [GetSpellInfo(63529)] = { -- Silenced - Shield of the Templar + track = AURA_TYPE_DEBUFF, + priority = 20, + spellID = 63529, + }, + ["Unstable Affliction Silence"] = { -- Unstable Affliction Silence (GetSpellInfo returns "Unstable Affliction") + track = AURA_TYPE_DEBUFF, + altName = select(1, GetSpellInfo(31117)) .. " Silence", + priority = 20, + spellID = 31117, + }, + [GetSpellInfo(24259)] = { -- Spell Lock (Felhunter) + track = AURA_TYPE_DEBUFF, + priority = 20, + spellID = 24259, + }, + [GetSpellInfo(28730)] = { -- Arcane Torrent + track = AURA_TYPE_DEBUFF, + priority = 20, + spellID = 28730, + }, + [GetSpellInfo(1330)] = { -- Garrote - Silence + track = AURA_TYPE_DEBUFF, + priority = 20, + spellID = 1330, + }, + + --- Disarms + [GetSpellInfo(676)] = { -- Disarm + track = AURA_TYPE_DEBUFF, + priority = 20, + spellID = 676, + }, + [GetSpellInfo(51722)] = { -- Dismantle + track = AURA_TYPE_DEBUFF, + priority = 20, + spellID = 51722, + }, + [GetSpellInfo(53359)] = { -- Chimera Shot - Scorpid + track = AURA_TYPE_DEBUFF, + priority = 20, + spellID = 53359, + }, + [GetSpellInfo(64058)] = { -- Psychic Horror Disarm + track = AURA_TYPE_DEBUFF, + priority = 20, + spellID = 64058, + }, + + --- Buffs + [GetSpellInfo(1022)] = { -- Hand of Protection + track = AURA_TYPE_BUFF, + priority = 20, + spellID = 1022, + }, + [GetSpellInfo(1044)] = { -- Hand of Freedom + track = AURA_TYPE_BUFF, + priority = 20, + spellID = 1044, + }, + [GetSpellInfo(6940)] = { -- Hand of Sacrifice + track = AURA_TYPE_BUFF, + priority = 20, + spellID = 6940, + }, + [GetSpellInfo(64205)] = { -- Divine Sacrifice + track = AURA_TYPE_BUFF, + priority = 20, + spellID = 64205, + }, + [GetSpellInfo(53271)] = { -- Master's Call (Hunter Pet Hand of Freedom) + track = AURA_TYPE_BUFF, + priority = 20, + spellID = 53271, + }, + [GetSpellInfo(2825)] = { -- Bloodlust + track = AURA_TYPE_BUFF, + priority = 9, + spellID = 2825, + }, + [GetSpellInfo(32182)] = { -- Heroism + track = AURA_TYPE_BUFF, + priority = 20, + spellID = 32182, + }, + [GetSpellInfo(33206)] = { -- Pain Suppression + track = AURA_TYPE_BUFF, + priority = 20, + spellID = 33206, + }, + [GetSpellInfo(29166)] = { -- Innervate + track = AURA_TYPE_BUFF, + priority = 20, + spellID = 29166, + }, + [GetSpellInfo(18708)] = { -- Fel Domination + track = AURA_TYPE_BUFF, + priority = 20, + spellID = 18708, + }, + [GetSpellInfo(54428)] = { -- Divine Plea + track = AURA_TYPE_BUFF, + priority = 20, + spellID = 54428, + }, + [GetSpellInfo(31821)] = { -- Aura mastery + track = AURA_TYPE_BUFF, + priority = 21, + spellID = 31821, + }, + [GetSpellInfo(51713)] = { -- Shadow Dance + track = AURA_TYPE_BUFF, + priority = 20, + spellID = 51713, + }, + [GetSpellInfo(12292)] = { -- Death Wish + track = AURA_TYPE_BUFF, + priority = 15, + spellID = 12292, + }, + [GetSpellInfo(23920)] = { -- Spell Reflection + track = AURA_TYPE_BUFF, + priority = 40, + spellID = 23920, + }, + [GetSpellInfo(6346)] = {-- Fear Ward + track = AURA_TYPE_BUFF, + priority = 9, + spellID = 6346, + }, + [GetSpellInfo(50334)] = {-- Berserk + track = AURA_TYPE_BUFF, + priority = 20, + spellID = 50334, + }, + + --- Turtling abilities + [GetSpellInfo(871)] = { -- Shield Wall + track = AURA_TYPE_BUFF, + priority = 25, + spellID = 871, + }, + [GetSpellInfo(48707)] = { -- Anti-Magic Shell + track = AURA_TYPE_BUFF, + priority = 25, + spellID = 48707, + }, + [GetSpellInfo(31224)] = { -- Cloak of Shadows + track = AURA_TYPE_BUFF, + priority = 25, + spellID = 31224, + }, + [GetSpellInfo(19263)] = { -- Deterrence + track = AURA_TYPE_BUFF, + priority = 25, + spellID = 19263, + }, + [GetSpellInfo(26669)] = { -- Evasion + track = AURA_TYPE_BUFF, + priority = 10, + spellID = 26669, + }, + + --- Immunities + [GetSpellInfo(34471)] = { -- The Beast Within (CC Immune) + track = AURA_TYPE_BUFF, + priority = 20, + spellID = 34471, + }, + [GetSpellInfo(45438)] = { -- Ice Block + track = AURA_TYPE_BUFF, + priority = 30, + spellID = 45438, + }, + [GetSpellInfo(41425)] = { -- Hypothermia (Ice Block Immune + track = AURA_TYPE_DEBUFF, + priority = 8, + spellID = 41425, + }, + [GetSpellInfo(642)] = { -- Divine Shield + track = AURA_TYPE_BUFF, + priority = 30, + spellID = 642, + }, + [GetSpellInfo(18499)] = { -- Berserker Rage (Flee Immune) + track = AURA_TYPE_BUFF, + priority = 30, + spellID = 18499, + }, + [GetSpellInfo(1719)] = { -- Recklessness (Flee Immune) + track = AURA_TYPE_BUFF, + priority = 30, + spellID = 1719, + }, + + --- Alt Stuff + [GetSpellInfo(34709)] = { -- Shadowsight Buff + track = AURA_TYPE_BUFF, + duration = 15, + priority = 15, + magic = true, + spellID = 34709, + }, + [GetSpellInfo(8178)] = { -- Grounding Totem Effect + track = AURA_TYPE_BUFF, + duration = 0, + priority = 15, + spellID = 8178 + }, + [GetSpellInfo(5024)] = { -- Flee (Skull of impending Doom) -- 5024 + track = AURA_TYPE_BUFF, + priority = 15, + spellID = 5024, + altName = select(1, GetSpellInfo(5024)) .. " - " .. (select(1, GetItemInfo(4984)) or "Skull of Impending Doom"), + }, +} + +function Gladdy:GetImportantAuras() + return importantAuras +end + +local interrupts = { + [GetSpellInfo(19675)] = { duration = 4, spellID = 19675, track = AURA_TYPE_DEBUFF, texture = select(3, GetSpellInfo(19675)), priority = 15 }, -- Feral Charge Effect (Druid) + [GetSpellInfo(2139)] = { duration = 8, spellID = 2139, track = AURA_TYPE_DEBUFF, texture = select(3, GetSpellInfo(2139)), priority = 15 }, -- Counterspell (Mage) + [GetSpellInfo(1766)] = { duration = 5, spellID = 1766, track = AURA_TYPE_DEBUFF, texture = select(3, GetSpellInfo(1766)), priority = 15 }, -- Kick (Rogue) + [GetSpellInfo(6552)] = { duration = 4, spellID = 6552, track = AURA_TYPE_DEBUFF, texture = select(3, GetSpellInfo(6552)), priority = 15 }, -- Pummel (Warrior) + [GetSpellInfo(72)] = { duration = 6, spellID = 72, track = AURA_TYPE_DEBUFF, texture = select(3, GetSpellInfo(72)), priority = 15 }, -- Shield Bash (Warrior) + [GetSpellInfo(57994)] = { duration = 2, spellID = 57994, track = AURA_TYPE_DEBUFF, texture = select(3, GetSpellInfo(57994)), priority = 15 }, -- Wind Shear (Shaman) + [GetSpellInfo(19244)] = { duration = 5, spellID = 19244, track = AURA_TYPE_DEBUFF, texture = select(3, GetSpellInfo(19244)), priority = 15 }, -- Spell Lock (Warlock + [GetSpellInfo(47528)] = { duration = 5, spellID = 47528, track = AURA_TYPE_DEBUFF, texture = select(3, GetSpellInfo(47528)), priority = 15 }, -- Mind Freeze (Deathknight) +} +function Gladdy:GetInterrupts() + return interrupts +end + +local cooldownList = { + -- Spell Name Cooldown[, Spec] + -- Mage + ["MAGE"] = { + [1953] = 15, -- Blink + [42917] = 25, -- Frost Nova + [2139] = 24, -- Counterspell + [55342] = 180, -- Mirror Image + [12051] = 480, --Evocation + [45438] = { cd = 300, [L["Frost"]] = 240, }, -- Ice Block + [44572] = { cd = 30, spec = L["Frost"], }, -- Deep Freeze + [12472] = { cd = 180, spec = L["Frost"], }, -- Icy Veins + [31687] = { cd = 180, spec = L["Frost"], }, -- Summon Water Elemental + [12043] = { cd = 120, spec = L["Arcane"], }, -- Presence of Mind + [12042] = { cd = 180, spec = L["Arcane"], }, -- Arcane Power + [42950] = { cd = 20, spec = L["Fire"] }, -- Dragon's Breath + [11129] = { cd = 120, spec = L["Fire"] }, -- Combustion + [11958] = { cd = 480, spec = L["Frost"], -- Coldsnap + resetCD = { + [12472] = true, + [45438] = true, + [42917] = true, + [31687] = true, + [44572] = true, + }, + }, + }, + + -- Priest + ["PRIEST"] = { + [10890] = { cd = 27, [L["Shadow"]] = 23, }, -- Psychic Scream + [34433] = { cd = 300, [L["Shadow"]] = 180, }, -- Shadowfiend + [15487] = { cd = 45, spec = L["Shadow"], }, -- Silence + [64044] = { cd = 120, spec = L["Shadow"], }, -- Psychic Horror + [64843] = 480, -- Divine Hymn + [64901] = 360, -- Hymn of Hope + [32379] = 12, -- Shadow Word: Death + [6346] = 180, -- Fear Ward + [47585] = { cd = 75, spec = L["Shadow"], }, -- Dispersion (+ Glyph) + [10060] = { cd = 120, spec = L["Discipline"], }, -- Power Infusion + [33206] = { cd = 180, spec = L["Discipline"], }, -- Pain Suppression + }, + + -- Death Knight + ["DEATHKNIGHT"] = { + [47476] = 120, -- Strangulate + [47528] = 10, -- Mind Freeze + [48707] = 45, -- Anti-Magic Shell + [48792] = 120, -- Icebound Fortitude + [49576] = 35, -- Death Grip + [47568] = 300, -- Empower Rune Weapon + [48743] = 120, -- Death Pact + [49039] = 120, -- Lichborne + [47481] = { cd = 60, spec = L["Unholy"], }, -- Pet Gnaw + [51052] = { cd = 120, spec = L["Unholy"], }, -- Anti-Magic Zone + [46584] = { cd = 180, notSpec = L["Unholy"], }, -- Raise Dead + [49206] = { cd = 180, spec = L["Unholy"], }, -- Summon Gargoyle + [49028] = { cd = 90, spec = L["Blood"], }, -- Dancing Rune Weapon + [49203] = { cd = 60, spec = L["Frost"], }, -- Hungering Cold + }, + + -- Druid + ["DRUID"] = { + [22812] = 60, -- Barkskin + [29166] = 180, -- Innervate + [8983] = 60, -- Bash + [53312] = 60, -- Natures Grasp + [48505] = { cd = 90, spec = L["Balance"], }, -- Starfall + [50334] = { cd = 180, spec = L["Feral"], }, -- Berserk + [17116] = { cd = 120, spec = L["Restoration"], }, -- Natures Swiftness + [18562] = { cd = 15, spec = L["Restoration"], }, -- Swiftmend + [33831] = { cd = 180, spec = L["Balance"], }, -- Force of Nature + }, + + -- Shaman + ["SHAMAN"] = { + [57994] = 6, -- Wind Shear + [51514] = 45, -- Hex + [8177] = 15, -- Grounding Totem + [30823] = { cd = 60, spec = L["Enhancement"], }, -- Shamanistic Rage + [16166] = { cd = 180, spec = L["Elemental"], }, -- Elemental Mastery + [59159] = { cd = 45, spec = L["Elemental"], }, -- Thunderstorm + [16188] = { cd = 120, spec = L["Restoration"], }, -- Natures Swiftness + [51533] = { cd = 180, spec = L["Enhancement"], }, -- Feral Spirit + [16190] = { cd = 300, spec = L["Restoration"], }, -- Mana Tide Totem + }, + + -- Paladin + ["PALADIN"] = { + [10278] = 300, -- Hand of Protection + [1044] = 25, -- Hand of Freedom + [54428] = 60, -- Divine Plea + [6940] = 120, -- Hand of Sacrifice + [64205] = 120, -- Divine Sacrifice + [10308] = { cd = 60, [L["Protection"]] = 40, }, -- Hammer of Justice + [642] = { cd = 300, -- Divine Shield + sharedCD = { + cd = 30, + [31884] = true, + }, + }, + [31884] = { cd = 180, -- Avenging Wrath + sharedCD = { + cd = 30, + [642] = true, + }, + }, + [31821] = { cd = 120, spec = L["Holy"], }, -- Aura Mastery + [20066] = { cd = 60, spec = L["Retribution"], }, -- Repentance + [20216] = { cd = 120, spec = L["Holy"], }, -- Divine Favor + [31842] = { cd = 180, spec = L["Holy"], }, -- Divine Illumination + [31935] = { cd = 30, spec = L["Protection"], }, -- Avengers Shield + + }, + + -- Warlock + ["WARLOCK"] = { + [17928] = 40, -- Howl of Terror + [47860] = 120, -- Death Coil + [18708] = 180, -- Feldom + [48020] = 30, -- Demonic Circle: Port + [19647] = { cd = 24, pet = true, }, -- Spell Lock + [27277] = { cd = 8, pet = true, }, -- Devour Magic + [61290] = 15, -- Shadowflame + [47847] = { cd = 20, spec = L["Destruction"], }, -- Shadowfury + [17877] = { cd = 15, spec = L["Destruction"], }, -- Shadowburn + [17962] = { cd = 10, spec = L["Destruction"], }, -- Conflagrate + [59172] = { cd = 12, spec = L["Destruction"], }, -- Chaos Bolt + [47241] = { cd = 180, spec = L["Demonology"], }, -- Metamorphosis + [47996] = { cd = 30, spec = L["Demonology"], pet = true, }, -- Intercept + [1122] = { cd = 600, spec = L["Demonology"], }, -- Inferno + }, + + -- Warrior + ["WARRIOR"] = { + [6552] = { cd = 10, -- Pummel + sharedCD = { + [72] = true, + }, + }, + [72] = { cd = 12, -- Shield Bash + sharedCD = { + [6552] = true, + }, + }, + [18499] = 30, -- Berserker Rage + [23920] = 10, -- Spell Reflection + [3411] = 30, -- Intervene + [20252] = { cd = 30, [L["Arms"]] = 20, }, -- Intercept + [676] = 60, -- Disarm + [5246] = 120, -- Intimidating Shout + [2565] = 60, -- Shield Block + [55694] = 180, -- Enraged Regeneration + [20230] = 300, -- Retaliation + [1719] = 300, -- Recklessness + [871] = 300, -- Shield Wall + [64382] = 300, -- Shattering Throw + [12292] = { cd = 180, spec = L["Fury"], }, -- Death Wish + [46924] = { cd = 90, spec = L["Arms"], }, -- Bladestorm + [46968] = { cd = 20, spec = L["Protection"], }, -- Shockwave + [12975] = { cd = 180, spec = L["Protection"], }, -- Last Stand + [12809] = { cd = 30, spec = L["Protection"], }, -- Concussion Blow + + }, + + -- Hunter + ["HUNTER"] = { + --[53548] = 28, -- Crab Prin + --[53562] = 40, -- Ravager Stun + + [19503] = 30, -- Scatter Shot + [19263] = 90, -- Deterrence + [781] = 15, -- Disengage + [5384] = 20, -- Feign Death + [3045] = 20, -- Rapid Fire + [60192] = { cd = 28, -- Freezing Arrow + sharedCD = { + [14311] = true, -- Freezing Trap + [13809] = true, -- Frost Trap + }, + }, + [14311] = { cd = 28, -- Freezing Trap + sharedCD = { + [60192] = true, -- Freezing Arrow + [13809] = true, -- Frost Trap + }, + }, + [13809] = { cd = 28, -- Frost Trap + sharedCD = { + [14311] = true, -- Freezing Trap + [60192] = true, -- Freezing Arrow + }, + }, + [34600] = { cd = 28, }, -- Snake Trap + [34490] = { cd = 20, spec = L["Marksmanship"], }, -- Silencing Shot + [19386] = { cd = 60, spec = L["Survival"], }, -- Wyvern Sting + [53271] = { cd = 60, pet = true, }, -- Masters Call + [19577] = { cd = 60, pet = true, }, -- Intimidation + [19574] = { cd = 120, pet = true, }, -- Bestial Wrath + [23989] = { cd = 180, -- Readiness + resetCD = { + [19503] = true, -- Scatter Shot + [19263] = true, -- Deterrence + [781] = true, -- Disengage + [60192] = true, -- Freezing Arrow + [14311] = true, -- Freezing Trap + [13809] = true, -- Frost Trap + [34600] = true, -- Snake Trap + [34490] = true, -- Silencing Shot + [19386] = true, -- Wyvern Sting + [53271] = true, -- Masters call + [19577] = true, -- Intimidation + }, + }, + }, + + -- Rogue + ["ROGUE"] = { + [1766] = 10, -- Kick + [8643] = 20, -- Kidney Shot + [26669] = 180, -- Evasion + [31224] = 60, -- Cloak of Shadow + [26889] = 180, -- Vanish + [2094] = 180, -- Blind + [51722] = 60, -- Dismantle + [11305] = 180, -- Sprint + [14177] = { cd = 180, spec = L["Assassination"], }, -- Cold Blood + [51713] = { cd = 60, spec = L["Subtlety"], }, -- Shadow Dance + [13750] = { cd = 180, spec = L["Combat"], }, -- Adrenaline Rush + [13877] = { cd = 120, spec = L["Combat"], }, -- Blade Flurry + [51690] = { cd = 120, spec = L["Combat"], }, -- Killing Spree + [36554] = { cd = 30, spec = L["Subtlety"], }, -- Shadowstep + [14185] = { cd = 480, spec = L["Subtlety"], -- Preparation + resetCD = { + [26669] = true, + [11305] = true, + [26889] = true, + [14177] = true, + [36554] = true, + }, + }, + }, + ["Scourge"] = { + + }, + ["BloodElf"] = { + + }, + ["Tauren"] = { + + }, + ["Orc"] = { + + }, + ["Troll"] = { + + }, + ["NightElf"] = { + + }, + ["Draenei"] = { + + }, + ["Human"] = { + + }, + ["Gnome"] = { + }, + ["Dwarf"] = { + + }, +} +function Gladdy:GetCooldownList() + return cooldownList +end + +local racials = { + ["Scourge"] = { + [7744] = true, -- Will of the Forsaken + duration = 120, + spellName = select(1, GetSpellInfo(7744)), + texture = select(3, GetSpellInfo(7744)) + }, + ["BloodElf"] = { + [28730] = true, -- Arcane Torrent + duration = 120, + spellName = select(1, GetSpellInfo(28730)), + texture = select(3, GetSpellInfo(28730)) + }, + ["Tauren"] = { + [20549] = true, -- War Stomp + duration = 120, + spellName = select(1, GetSpellInfo(20549)), + texture = select(3, GetSpellInfo(20549)) + }, + ["Orc"] = { + [20572] = true, + [33697] = true, + [33702] = true, + duration = 120, + spellName = select(1, GetSpellInfo(20572)), + texture = select(3, GetSpellInfo(20572)) + }, + ["Troll"] = { + [26297] = true, + duration = 180, + spellName = select(1, GetSpellInfo(26297)), + texture = select(3, GetSpellInfo(26297)) + }, + ["NightElf"] = { + [58984] = true, + duration = 120, + spellName = select(1, GetSpellInfo(58984)), + texture = select(3, GetSpellInfo(58984)) + }, + ["Draenei"] = { + [28880] = true, + duration = 180, + spellName = select(1, GetSpellInfo(28880)), + texture = select(3, GetSpellInfo(28880)) + }, + ["Human"] = { + [59752] = true, -- Perception + duration = 120, + spellName = select(1, GetSpellInfo(59752)), + texture = select(3, GetSpellInfo(59752)) + }, + ["Gnome"] = { + [20589] = true, -- Escape Artist + duration = 105, + spellName = select(1, GetSpellInfo(20589)), + texture = select(3, GetSpellInfo(20589)) + }, + ["Dwarf"] = { + [20594] = true, -- Stoneform + duration = 180, + spellName = select(1, GetSpellInfo(20594)), + texture = select(3, GetSpellInfo(20594)) + }, +} +function Gladdy:Racials() + return racials +end + + +--------------------- +-- TOTEM STUFF +--------------------- + +local totemData = { + -- Fire + [string_lower("Searing Totem")] = { id = 3599, texture = select(3, GetSpellInfo(3599)), color = { r = 0, g = 0, b = 0, a = 1 } }, + [string_lower("Flametongue Totem")] = { id = 8227, texture = select(3, GetSpellInfo(8227)), color = { r = 0, g = 0, b = 0, a = 1 } }, + [string_lower("Magma Totem")] = { id = 8190, texture = select(3, GetSpellInfo(8190)), color = { r = 0, g = 0, b = 0, a = 1 }, pulse = 2 }, + [string_lower("Fire Nova Totem")] = { id = 1535, texture = select(3, GetSpellInfo(1535)), color = { r = 0, g = 0, b = 0, a = 1 }, pulse = { cd = 4, once = true } }, + [string_lower("Totem of Wrath")] = { id = 30706, texture = select(3, GetSpellInfo(30706)), color = { r = 0, g = 0, b = 0, a = 1 } }, + [string_lower("Fire Elemental Totem")] = { id = 32982, texture = select(3, GetSpellInfo(32982)), color = { r = 0, g = 0, b = 0, a = 1 } }, + [string_lower("Frost Resistance Totem")] = { id = 8181, texture = select(3, GetSpellInfo(8181)), color = { r = 0, g = 0, b = 0, a = 1 } }, + [string_lower("Totem of Wrath")] = { id = 30706, texture = select(3, GetSpellInfo(30706)), color = { r = 0, g = 0, b = 0, a = 1 } }, + -- Water + [string_lower("Fire Resistance Totem")] = { id = 8184, texture = select(3, GetSpellInfo(8184)), color = { r = 0, g = 0, b = 0, a = 1 } }, + [string_lower("Disease Cleansing Totem")] = { id = 8170, texture = select(3, GetSpellInfo(8170)), color = { r = 0, g = 0, b = 0, a = 1 }, pulse = 5 }, + [string_lower("Healing Stream Totem")] = { id = 5394, texture = select(3, GetSpellInfo(5394)), color = { r = 0, g = 0, b = 0, a = 1 }, pulse = 2 }, + [string_lower("Mana Tide Totem")] = { id = 16190, texture = select(3, GetSpellInfo(16190)), color = { r = 0.078, g = 0.9, b = 0.16, a = 1 } }, + [string_lower("Mana Spring Totem")] = { id = 5675, texture = select(3, GetSpellInfo(5675)), color = { r = 0, g = 0, b = 0, a = 1 }, pulse = 2 }, + -- Earth + [string_lower("Earthbind Totem")] = { id = 2484, texture = select(3, GetSpellInfo(2484)), color = { r = 0.5, g = 0.5, b = 0.5, a = 1 }, pulse = 3 }, + [string_lower("Stoneclaw Totem")] = { id = 5730, texture = select(3, GetSpellInfo(5730)), color = { r = 0, g = 0, b = 0, a = 1 }, pulse = 2 }, + [string_lower("Stoneskin Totem")] = { id = 8071, texture = select(3, GetSpellInfo(8071)), color = { r = 0, g = 0, b = 0, a = 1 } }, + [string_lower("Strength of Earth Totem")] = { id = 8075, texture = select(3, GetSpellInfo(8075)), color = { r = 0, g = 0, b = 0, a = 1 } }, + [string_lower("Earth Elemental Totem")] = { id = 33663, texture = select(3, GetSpellInfo(33663)), color = { r = 0, g = 0, b = 0, a = 1 } }, + [string_lower("Tremor Totem")] = { id = 8143, texture = select(3, GetSpellInfo(8143)), color = { r = 1, g = 0.9, b = 0.1, a = 1 }, pulse = 3 }, + -- Air + [string_lower("Grounding Totem")] = { id = 8177, texture = select(3, GetSpellInfo(8177)), color = { r = 0, g = 0.53, b = 0.92, a = 1 } }, + [string_lower("Nature Resistance Totem")] = { id = 10595, texture = select(3, GetSpellInfo(10595)), color = { r = 0, g = 0, b = 0, a = 1 } }, + [string_lower("Windfury Totem")] = { id = 8512, texture = select(3, GetSpellInfo(8512)), color = { r = 0.96, g = 0, b = 0.07, a = 1 } }, + [string_lower("Sentry Totem")] = { id = 6495, texture = select(3, GetSpellInfo(6495)), color = { r = 0, g = 0, b = 0, a = 1 } }, + [string_lower("Wrath of Air Totem")] = { id = 3738, texture = select(3, GetSpellInfo(3738)), color = { r = 0, g = 0, b = 0, a = 1 } }, +} + +local totemSpellIdToPulse = { + [GetSpellInfo(totemData[string_lower("Earthbind Totem")].id)] = totemData[string_lower("Earthbind Totem")].pulse, + [2484] = totemData[string_lower("Earthbind Totem")].pulse, + [GetSpellInfo(totemData[string_lower("Tremor Totem")].id)] = totemData[string_lower("Tremor Totem")].pulse, + [8143] = totemData[string_lower("Tremor Totem")].pulse, + --[GetSpellInfo(totemData[string_lower("Poison Cleansing Totem")].id)] = totemData[string_lower("Poison Cleansing Totem")].pulse, + --[8166] = totemData[string_lower("Poison Cleansing Totem")].pulse, + [GetSpellInfo(totemData[string_lower("Disease Cleansing Totem")].id)] = totemData[string_lower("Disease Cleansing Totem")].pulse, + [8170] = totemData[string_lower("Disease Cleansing Totem")].pulse, + [GetSpellInfo(totemData[string_lower("Fire Nova Totem")].id)] = totemData[string_lower("Fire Nova Totem")].pulse, + [1535] = totemData[string_lower("Fire Nova Totem")].pulse, -- Rank 1 + [8498] = totemData[string_lower("Fire Nova Totem")].pulse, -- Rank 2 + [8499] = totemData[string_lower("Fire Nova Totem")].pulse, -- Rank 3 + [11314] = totemData[string_lower("Fire Nova Totem")].pulse, -- Rank 4 + [11315] = totemData[string_lower("Fire Nova Totem")].pulse, -- Rank 5 + [25546] = totemData[string_lower("Fire Nova Totem")].pulse, -- Rank 6 + [25547] = totemData[string_lower("Fire Nova Totem")].pulse, -- Rank 7 + [GetSpellInfo(totemData[string_lower("Magma Totem")].id)] = totemData[string_lower("Magma Totem")].pulse, + [8190] = totemData[string_lower("Magma Totem")].pulse, -- Rank 1 + [10585] = totemData[string_lower("Magma Totem")].pulse, -- Rank 2 + [10586] = totemData[string_lower("Magma Totem")].pulse, -- Rank 3 + [10587] = totemData[string_lower("Magma Totem")].pulse, -- Rank 4 + [25552] = totemData[string_lower("Magma Totem")].pulse, -- Rank 5 + [GetSpellInfo(totemData[string_lower("Healing Stream Totem")].id)] = totemData[string_lower("Healing Stream Totem")].pulse, + [5394] = totemData[string_lower("Healing Stream Totem")].pulse, -- Rank 1 + [6375] = totemData[string_lower("Healing Stream Totem")].pulse, -- Rank 2 + [6377] = totemData[string_lower("Healing Stream Totem")].pulse, -- Rank 3 + [10462] = totemData[string_lower("Healing Stream Totem")].pulse, -- Rank 4 + [10463] = totemData[string_lower("Healing Stream Totem")].pulse, -- Rank 5 + [25567] = totemData[string_lower("Healing Stream Totem")].pulse, -- Rank 6 + [GetSpellInfo(totemData[string_lower("Mana Spring Totem")].id)] = totemData[string_lower("Mana Spring Totem")].pulse, + [5675] = totemData[string_lower("Mana Spring Totem")].pulse, -- Rank 1 + [10495] = totemData[string_lower("Mana Spring Totem")].pulse, -- Rank 2 + [10496] = totemData[string_lower("Mana Spring Totem")].pulse, -- Rank 3 + [10497] = totemData[string_lower("Mana Spring Totem")].pulse, -- Rank 4 + [25570] = totemData[string_lower("Mana Spring Totem")].pulse, -- Rank 5 + [GetSpellInfo(totemData[string_lower("Stoneclaw Totem")].id)] = totemData[string_lower("Stoneclaw Totem")].pulse, + [5730] = totemData[string_lower("Stoneclaw Totem")].pulse, -- Rank 1 + [6390] = totemData[string_lower("Stoneclaw Totem")].pulse, -- Rank 2 + [6391] = totemData[string_lower("Stoneclaw Totem")].pulse, -- Rank 3 + [6392] = totemData[string_lower("Stoneclaw Totem")].pulse, -- Rank 4 + [10427] = totemData[string_lower("Stoneclaw Totem")].pulse, -- Rank 5 + [10428] = totemData[string_lower("Stoneclaw Totem")].pulse, -- Rank 6 + [25525] = totemData[string_lower("Stoneclaw Totem")].pulse, -- Rank 7 +} + +local totemNpcIdsToTotemData = { + --fire + [2523] = totemData[string_lower("Searing Totem")], + [3902] = totemData[string_lower("Searing Totem")], + [3903] = totemData[string_lower("Searing Totem")], + [3904] = totemData[string_lower("Searing Totem")], + [7400] = totemData[string_lower("Searing Totem")], + [7402] = totemData[string_lower("Searing Totem")], + [15480] = totemData[string_lower("Searing Totem")], + [31162] = totemData[string_lower("Searing Totem")], + [31164] = totemData[string_lower("Searing Totem")], + [31165] = totemData[string_lower("Searing Totem")], + [21995] = totemData[string_lower("Searing Totem")], + [22209] = totemData[string_lower("Searing Totem")], + [22895] = totemData[string_lower("Searing Totem")], + [22896] = totemData[string_lower("Searing Totem")], + [34687] = totemData[string_lower("Searing Totem")], + [36532] = totemData[string_lower("Searing Totem")], + [43423] = totemData[string_lower("Searing Totem")], + [67380] = totemData[string_lower("Searing Totem")], + [73477] = totemData[string_lower("Searing Totem")], + [79238] = totemData[string_lower("Searing Totem")], + [22896] = totemData[string_lower("Searing Totem")], + [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")], + [7423] = totemData[string_lower("Flametongue Totem")], + [10557] = totemData[string_lower("Flametongue Totem")], + [15485] = totemData[string_lower("Flametongue Totem")], + [31132] = totemData[string_lower("Flametongue Totem")], + [31133] = totemData[string_lower("Flametongue Totem")], + [31158] = totemData[string_lower("Flametongue Totem")], + [42605] = totemData[string_lower("Flametongue Totem")], + + [5929] = totemData[string_lower("Magma Totem")], + [7464] = totemData[string_lower("Magma Totem")], + [7465] = totemData[string_lower("Magma Totem")], + [7466] = totemData[string_lower("Magma Totem")], + [15484] = totemData[string_lower("Magma Totem")], + [31166] = totemData[string_lower("Magma Totem")], + [31167] = totemData[string_lower("Magma Totem")], + [32887] = totemData[string_lower("Magma Totem")], + [42211] = totemData[string_lower("Magma Totem")], + [71335] = totemData[string_lower("Magma Totem")], + [71925] = totemData[string_lower("Magma Totem")], + [73085] = totemData[string_lower("Magma Totem")], + [73093] = totemData[string_lower("Magma Totem")], + [73268] = totemData[string_lower("Magma Totem")], + [88971] = totemData[string_lower("Magma Totem")], + [97369] = totemData[string_lower("Magma Totem")], + [98676] = totemData[string_lower("Magma Totem")], + + [5879] = totemData[string_lower("Fire Nova Totem")], + [6110] = totemData[string_lower("Fire Nova Totem")], + [6111] = totemData[string_lower("Fire Nova Totem")], + [7844] = totemData[string_lower("Fire Nova Totem")], + [7845] = totemData[string_lower("Fire Nova Totem")], + [14662] = totemData[string_lower("Fire Nova Totem")], + [15482] = totemData[string_lower("Fire Nova Totem")], + [15483] = totemData[string_lower("Fire Nova Totem")], + [24320] = totemData[string_lower("Fire Nova Totem")], + [32775] = totemData[string_lower("Fire Nova Totem")], + [32776] = totemData[string_lower("Fire Nova Totem")], + + [17539] = totemData[string_lower("Totem of Wrath")], + [22970] = totemData[string_lower("Totem of Wrath")], + [22971] = totemData[string_lower("Totem of Wrath")], + [30652] = totemData[string_lower("Totem of Wrath")], + [30653] = totemData[string_lower("Totem of Wrath")], + [30654] = totemData[string_lower("Totem of Wrath")], + + [15439] = totemData[string_lower("Fire Elemental Totem")], + [40830] = totemData[string_lower("Fire Elemental Totem")], + [41337] = totemData[string_lower("Fire Elemental Totem")], + [41346] = totemData[string_lower("Fire Elemental Totem")], + [72301] = totemData[string_lower("Fire Elemental Totem")], + + [5926] = totemData[string_lower("Frost Resistance Totem")], + [7412] = totemData[string_lower("Frost Resistance Totem")], + [7413] = totemData[string_lower("Frost Resistance Totem")], + [15486] = totemData[string_lower("Frost Resistance Totem")], + [31171] = totemData[string_lower("Frost Resistance Totem")], + [31172] = totemData[string_lower("Frost Resistance Totem")], + + -- Water + [5927] = totemData[string_lower("Fire Resistance Totem")], + [7424] = totemData[string_lower("Fire Resistance Totem")], + [7425] = totemData[string_lower("Fire Resistance Totem")], + [15487] = totemData[string_lower("Fire Resistance Totem")], + [31169] = totemData[string_lower("Fire Resistance Totem")], + [31170] = totemData[string_lower("Fire Resistance Totem")], + + + [5924] = totemData[string_lower("Disease Cleansing Totem")], + + [3527] = totemData[string_lower("Healing Stream Totem")], + [3906] = totemData[string_lower("Healing Stream Totem")], + [3907] = totemData[string_lower("Healing Stream Totem")], + [3908] = totemData[string_lower("Healing Stream Totem")], + [3909] = totemData[string_lower("Healing Stream Totem")], + [14664] = totemData[string_lower("Healing Stream Totem")], + [15488] = totemData[string_lower("Healing Stream Totem")], + [18235] = totemData[string_lower("Healing Stream Totem")], + [31181] = totemData[string_lower("Healing Stream Totem")], + [31182] = totemData[string_lower("Healing Stream Totem")], + [31185] = totemData[string_lower("Healing Stream Totem")], + [34686] = totemData[string_lower("Healing Stream Totem")], + [36542] = totemData[string_lower("Healing Stream Totem")], + [37810] = totemData[string_lower("Healing Stream Totem")], + [38428] = totemData[string_lower("Healing Stream Totem")], + [47077] = totemData[string_lower("Healing Stream Totem")], + [72309] = totemData[string_lower("Healing Stream Totem")], + [72457] = totemData[string_lower("Healing Stream Totem")], + [73890] = totemData[string_lower("Healing Stream Totem")], + [74433] = totemData[string_lower("Healing Stream Totem")], + [97508] = totemData[string_lower("Healing Stream Totem")], + [112567] = totemData[string_lower("Healing Stream Totem")], + [120357] = totemData[string_lower("Healing Stream Totem")], + [128539] = totemData[string_lower("Healing Stream Totem")], + [132049] = totemData[string_lower("Healing Stream Totem")], + + [10467] = totemData[string_lower("Mana Tide Totem")], + [11100] = totemData[string_lower("Mana Tide Totem")], + [11101] = totemData[string_lower("Mana Tide Totem")], + [17061] = totemData[string_lower("Mana Tide Totem")], + + [3573] = totemData[string_lower("Mana Spring Totem")], + [7414] = totemData[string_lower("Mana Spring Totem")], + [7415] = totemData[string_lower("Mana Spring Totem")], + [7416] = totemData[string_lower("Mana Spring Totem")], + [15304] = totemData[string_lower("Mana Spring Totem")], + [15489] = totemData[string_lower("Mana Spring Totem")], + [31186] = totemData[string_lower("Mana Spring Totem")], + [31189] = totemData[string_lower("Mana Spring Totem")], + [31190] = totemData[string_lower("Mana Spring Totem")], + + -- Earth + [2630] = totemData[string_lower("Earthbind Totem")], + [22486] = totemData[string_lower("Earthbind Totem")], + [40233] = totemData[string_lower("Earthbind Totem")], + [74737] = totemData[string_lower("Earthbind Totem")], + [79155] = totemData[string_lower("Earthbind Totem")], + + [3579] = totemData[string_lower("Stoneclaw Totem")], + [3911] = totemData[string_lower("Stoneclaw Totem")], + [3912] = totemData[string_lower("Stoneclaw Totem")], + [3913] = totemData[string_lower("Stoneclaw Totem")], + [7398] = totemData[string_lower("Stoneclaw Totem")], + [7399] = totemData[string_lower("Stoneclaw Totem")], + [14870] = totemData[string_lower("Stoneclaw Totem")], + [15478] = totemData[string_lower("Stoneclaw Totem")], + [31120] = totemData[string_lower("Stoneclaw Totem")], + [31121] = totemData[string_lower("Stoneclaw Totem")], + [31122] = totemData[string_lower("Stoneclaw Totem")], + [40258] = totemData[string_lower("Stoneclaw Totem")], + [102402] = totemData[string_lower("Stoneclaw Totem")], + + [5873] = totemData[string_lower("Stoneskin Totem")], + [5919] = totemData[string_lower("Stoneskin Totem")], + [5920] = totemData[string_lower("Stoneskin Totem")], + [7366] = totemData[string_lower("Stoneskin Totem")], + [7367] = totemData[string_lower("Stoneskin Totem")], + [7368] = totemData[string_lower("Stoneskin Totem")], + [14663] = totemData[string_lower("Stoneskin Totem")], + [15470] = totemData[string_lower("Stoneskin Totem")], + [15474] = totemData[string_lower("Stoneskin Totem")], + [18177] = totemData[string_lower("Stoneskin Totem")], + [21994] = totemData[string_lower("Stoneskin Totem")], + [31175] = totemData[string_lower("Stoneskin Totem")], + [31176] = totemData[string_lower("Stoneskin Totem")], + [36550] = totemData[string_lower("Stoneskin Totem")], + [40267] = totemData[string_lower("Stoneskin Totem")], + [41967] = totemData[string_lower("Stoneskin Totem")], + + [5874] = totemData[string_lower("Strength of Earth Totem")], + [5921] = totemData[string_lower("Strength of Earth Totem")], + [5922] = totemData[string_lower("Strength of Earth Totem")], + [7403] = totemData[string_lower("Strength of Earth Totem")], + [15464] = totemData[string_lower("Strength of Earth Totem")], + [15479] = totemData[string_lower("Strength of Earth Totem")], + [21992] = totemData[string_lower("Strength of Earth Totem")], + [30647] = totemData[string_lower("Strength of Earth Totem")], + [31129] = totemData[string_lower("Strength of Earth Totem")], + [40266] = totemData[string_lower("Strength of Earth Totem")], + + [15430] = totemData[string_lower("Earth Elemental Totem")], + [24649] = totemData[string_lower("Earth Elemental Totem")], + [39387] = totemData[string_lower("Earth Elemental Totem")], + [40247] = totemData[string_lower("Earth Elemental Totem")], + [72307] = totemData[string_lower("Earth Elemental Totem")], + + [5913] = totemData[string_lower("Tremor Totem")], + [41938] = totemData[string_lower("Tremor Totem")], + [41939] = totemData[string_lower("Tremor Totem")], + + -- Air + [5925] = totemData[string_lower("Grounding Totem")], + [128537] = totemData[string_lower("Grounding Totem")], + [136251] = totemData[string_lower("Grounding Totem")], + + [7467] = totemData[string_lower("Nature Resistance Totem")], + [7468] = totemData[string_lower("Nature Resistance Totem")], + [7469] = totemData[string_lower("Nature Resistance Totem")], + [15490] = totemData[string_lower("Nature Resistance Totem")], + [31173] = totemData[string_lower("Nature Resistance Totem")], + [31174] = totemData[string_lower("Nature Resistance Totem")], + + [6112] = totemData[string_lower("Windfury Totem")], + [7483] = totemData[string_lower("Windfury Totem")], + [7484] = totemData[string_lower("Windfury Totem")], + [14666] = totemData[string_lower("Windfury Totem")], + [15496] = totemData[string_lower("Windfury Totem")], + [15497] = totemData[string_lower("Windfury Totem")], + [22897] = totemData[string_lower("Windfury Totem")], + [41940] = totemData[string_lower("Windfury Totem")], + [41941] = totemData[string_lower("Windfury Totem")], + [80703] = totemData[string_lower("Windfury Totem")], + [105690] = totemData[string_lower("Windfury Totem")], + [133684] = totemData[string_lower("Windfury Totem")], + + [3968] = totemData[string_lower("Sentry Totem")], + [28938] = totemData[string_lower("Sentry Totem")], + [40187] = totemData[string_lower("Sentry Totem")], + [69505] = totemData[string_lower("Sentry Totem")], + [70413] = totemData[string_lower("Sentry Totem")], + [71145] = totemData[string_lower("Sentry Totem")], + [147410] = totemData[string_lower("Sentry Totem")], + + [15447] = totemData[string_lower("Wrath of Air Totem")], + [36556] = totemData[string_lower("Wrath of Air Totem")], +} + +function Gladdy:GetTotemData() + return totemData, totemNpcIdsToTotemData, totemSpellIdToPulse +end diff --git a/Constants_shared.lua b/Constants_shared.lua new file mode 100644 index 0000000..c91bc19 --- /dev/null +++ b/Constants_shared.lua @@ -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 \ No newline at end of file diff --git a/EventListener.lua b/EventListener.lua index 820f181..3e4cace 100644 --- a/EventListener.lua +++ b/EventListener.lua @@ -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 diff --git a/Gladdy.lua b/Gladdy.lua index 4478e48..d996d35 100644 --- a/Gladdy.lua +++ b/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 diff --git a/Gladdy.toc b/Gladdy.toc index a9c4720..2d6724a 100644 --- a/Gladdy.toc +++ b/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. \ No newline at end of file diff --git a/Gladdy_BCC.toc b/Gladdy_BCC.toc new file mode 100644 index 0000000..aafb2b6 --- /dev/null +++ b/Gladdy_BCC.toc @@ -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 diff --git a/Gladdy_Wrath.toc b/Gladdy_Wrath.toc new file mode 100644 index 0000000..c9924b4 --- /dev/null +++ b/Gladdy_Wrath.toc @@ -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 diff --git a/Images/castbar-shield.blp b/Images/castbar-shield.blp new file mode 100644 index 0000000..c9b9d11 Binary files /dev/null and b/Images/castbar-shield.blp differ diff --git a/Lang.lua b/Lang.lua index caf2d58..34ac1b5 100644 --- a/Lang.lua +++ b/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 diff --git a/Libs/DRData-1.0/DRData-1.0.lua b/Libs/DRData-1.0/DRData-1.0.lua deleted file mode 100644 index 4bfc95c..0000000 --- a/Libs/DRData-1.0/DRData-1.0.lua +++ /dev/null @@ -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 -]] \ No newline at end of file diff --git a/Libs/DRData-1.0/DRData-1.0.toc b/Libs/DRData-1.0/DRData-1.0.toc deleted file mode 100644 index 9a79e76..0000000 --- a/Libs/DRData-1.0/DRData-1.0.toc +++ /dev/null @@ -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 diff --git a/Libs/DRList-1.0/DRList-1.0.lua b/Libs/DRList-1.0/DRList-1.0.lua new file mode 100644 index 0000000..505a3ac --- /dev/null +++ b/Libs/DRList-1.0/DRList-1.0.lua @@ -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 diff --git a/Libs/DRList-1.0/DRList-1.0.toc b/Libs/DRList-1.0/DRList-1.0.toc new file mode 100644 index 0000000..30cf4f5 --- /dev/null +++ b/Libs/DRList-1.0/DRList-1.0.toc @@ -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@ diff --git a/Libs/DRList-1.0/DRList-1.0.xml b/Libs/DRList-1.0/DRList-1.0.xml new file mode 100644 index 0000000..2ab1f09 --- /dev/null +++ b/Libs/DRList-1.0/DRList-1.0.xml @@ -0,0 +1,4 @@ + +