-- The majority of these aura lists are based on lists found in oUF_Phanx: 
-- https://www.curseforge.com/wow/addons/ouf-phanx

local ADDON = ...
local Auras = CogWheel("LibDB"):NewDatabase(ADDON..": Auras")
local Functions = CogWheel("LibDB"):GetDatabase(ADDON..": Functions")

-- Lua API
local _G = _G
local string_len = string.len
local string_sub = string.sub

-- WoW API
local UnitClass = _G.UnitClass
local UnitRace = _G.UnitRace

-- Specific per class buffs we wish to see
local _, playerClass = UnitClass("player")
local _, playerRace = UnitRace("player")

-- Bitfield filter toggles
local ByPlayer 			= tonumber("000000000000000000000001", 2) -- Show when cast by player
local OnPlayer 			= tonumber("000000000000000000000010", 2) -- Show on player frame
local OnTarget 			= tonumber("000000000000000000000100", 2) -- Show on target frame 
local OnPet 			= tonumber("000000000000000000001000", 2) -- Show on pet frame
local OnToT 			= tonumber("000000000000000000010000", 2) -- Shown on tot frame
local OnFocus 			= tonumber("000000000000000000100000", 2) -- Show on focus frame 
local OnParty 			= tonumber("000000000000000001000000", 2) -- Show on party members
local OnBoss 			= tonumber("000000000000000010000000", 2) -- Show on boss frames
local OnArena			= tonumber("000000000000000100000000", 2) -- Show on arena enemy frames
local OnFriend 			= tonumber("000000000000001000000000", 2) -- Show on friendly units, regardless of frame
local OnEnemy 			= tonumber("000000000000010000000000", 2) -- Show on enemy units, regardless of frame
local FromPlayer 		= tonumber("000000000000100000000000", 2) -- Show when player is the caster
local PlayerIsDPS 		= tonumber("000000000001000000000000", 2) -- Show when player is a damager
local PlayerIsHealer 	= tonumber("000000000010000000000000", 2) -- Show when player is a healer
local PlayerIsTank 		= tonumber("000000000100000000000000", 2) -- Show when player is a tank 
local IsCrowdControl 	= tonumber("000000001000000000000000", 2) -- Aura is crowd control 
local PrioBoss 			= tonumber("000001000000000000000000", 2) -- Same priority as boss debuffs
local PrioHigh 			= tonumber("000010000000000000000000", 2) -- High priority, shown first after boss
local PrioMedium 		= tonumber("000100000000000000000000", 2) -- Normal priority, same as not setting any
local PrioLow 			= tonumber("001000000000000000000000", 2) -- Low priority, will only be displayed if room
local Never 			= tonumber("010000000000000000000000", 2) -- Never show
local Always 			= tonumber("100000000000000000000000", 2) -- Always show

-- Store the flags for the aura filtering functions
local filterFlags = {
	ByPlayer = ByPlayer, 
	OnPlayer = OnPlayer,
	OnTarget = OnTarget,
	OnPet = OnPet,
	OnToT = OnToT,
	OnFocus = OnFocus,
	OnParty = OnParty,
	OnBoss = OnBoss,
	OnArena = OnArena,
	OnFriend = OnFriend,
	OnEnemy = OnEnemy,
	FromPlayer = FromPlayer,
	PlayerIsDPS = PlayerIsDPS,
	PlayerIsHealer = PlayerIsHealer,
	PlayerIsTank = PlayerIsTank,
	IsCrowdControl = IsCrowdControl,
	PrioBoss = PrioBoss,
	PrioHigh = PrioHigh,
	PrioMedium = PrioMedium,
	PrioLow = PrioLow,
	Never = Never,
	Always = Always,
}

-- The full auralists, based on player class.
local auraList = {}

-- Heroism
auraList[ 90355] = OnPlayer + PrioHigh -- Ancient Hysteria
auraList[  2825] = OnPlayer + PrioHigh -- Bloodlust
auraList[ 32182] = OnPlayer + PrioHigh -- Heroism
auraList[160452] = OnPlayer + PrioHigh -- Netherwinds
auraList[ 80353] = OnPlayer + PrioHigh -- Time Warp

-- Other big ones
auraList[ 67556] = OnPlayer -- Cooking Speed
auraList[ 29166] = OnPlayer -- Innervate
auraList[102342] = OnPlayer -- Ironbark
auraList[ 33206] = OnPlayer -- Pain Suppression
auraList[ 10060] = OnPlayer -- Power Infusion
auraList[ 64901] = OnPlayer -- Symbol of Hope

auraList[ 57723] = OnPlayer -- Exhaustion "Cannot benefit from Heroism or other similar effects." (Alliance version)
auraList[160455] = OnPlayer -- Fatigued "Cannot benefit from Netherwinds or other similar effects." (Pet version)
auraList[243138] = OnPlayer -- Happy Feet event 
auraList[246050] = OnPlayer -- Happy Feet buff gained restoring health
auraList[ 95809] = OnPlayer -- Insanity "Cannot benefit from Ancient Hysteria or other similar effects." (Pet version)
auraList[ 15007] = OnPlayer -- Resurrection Sickness
auraList[ 57724] = OnPlayer -- Sated "Cannot benefit from Bloodlust or other similar effects." (Horde version)
auraList[ 80354] = OnPlayer -- Temporal Displacement

-- Crowd Control
auraList[   710] = OnEnemy + IsCrowdControl -- Banish
auraList[  2094] = OnEnemy + IsCrowdControl -- Blind
auraList[   339] = OnEnemy + IsCrowdControl -- Entangling Roots
auraList[  5782] = OnEnemy + IsCrowdControl -- Fear
auraList[  3355] = OnEnemy + IsCrowdControl -- Freezing Trap -- NEEDS CHECK, 212365
auraList[ 51514] = OnEnemy + IsCrowdControl -- Hex
auraList[210873] = OnEnemy + IsCrowdControl -- Hex (Compy)
auraList[211015] = OnEnemy + IsCrowdControl -- Hex (Cockroach)
auraList[211010] = OnEnemy + IsCrowdControl -- Hex (Snake)
auraList[211004] = OnEnemy + IsCrowdControl -- Hex (Spider)
auraList[196942] = OnEnemy + IsCrowdControl -- Hex (Voodoo Totem)
auraList[  5484] = OnEnemy + IsCrowdControl -- Howl of Terror
auraList[217832] = OnEnemy + IsCrowdControl -- Imprison
auraList[199743] = OnEnemy + IsCrowdControl -- Parley
auraList[   118] = OnEnemy + IsCrowdControl -- Polymorph
auraList[ 61308] = OnEnemy + IsCrowdControl -- Polymorph (Black Cat)
auraList[161354] = OnEnemy + IsCrowdControl -- Polymorph (Monkey)
auraList[161372] = OnEnemy + IsCrowdControl -- Polymorph (Peacock)
auraList[161355] = OnEnemy + IsCrowdControl -- Polymorph (Penguin)
auraList[ 28272] = OnEnemy + IsCrowdControl -- Polymorph (Pig)
auraList[161353] = OnEnemy + IsCrowdControl -- Polymorph (Polar Bear Cub)
auraList[126819] = OnEnemy + IsCrowdControl -- Polymorph (Porcupine)
auraList[ 61721] = OnEnemy + IsCrowdControl -- Polymorph (Rabbit)
auraList[ 61780] = OnEnemy + IsCrowdControl -- Polymorph (Turkey)
auraList[ 28271] = OnEnemy + IsCrowdControl -- Polymorph (Turtle)
auraList[ 20066] = OnEnemy + IsCrowdControl -- Repentance
auraList[  6770] = OnEnemy + IsCrowdControl -- Sap
auraList[  6358] = OnEnemy + IsCrowdControl -- Seduction
auraList[  9484] = OnEnemy + IsCrowdControl -- Shackle Undead
auraList[162480] = OnEnemy + IsCrowdControl -- Steel Trap
auraList[ 19386] = OnEnemy + IsCrowdControl -- Wyvern Sting
	
-- Legion Artifact Proc
auraList[242584] = OnPlayer -- Concordance of the Legionfall (agility)
auraList[242586] = OnPlayer -- Concordance of the Legionfall (intellect)
auraList[242583] = OnPlayer -- Concordance of the Legionfall (strength)
auraList[243096] = OnPlayer -- Concordance of the Legionfall (versatility)
	
-- Legion Consumables
auraList[188030] = ByPlayer -- Leytorrent Potion (channeled)
auraList[188027] = ByPlayer -- Potion of Deadly Grace
auraList[188028] = ByPlayer -- Potion of the Old War
auraList[188029] = ByPlayer -- Unbending Potion
	
-- Quest related auras
auraList[127372] = OnPlayer -- Unstable Serum (Klaxxi Enhancement: Raining Blood)
	
-- Boss debuffs that Blizzard failed to flag
auraList[106648] = Always -- Brew Explosion (Ook Ook in Stormsnout Brewery)
auraList[106784] = Always -- Brew Explosion (Ook Ook in Stormsnout Brewery)
auraList[123059] = Always -- Destabilize (Amber-Shaper Un'sok)

-- NPC buffs that are completely useless
auraList[ 63501] = Never -- Argent Crusade Champion's Pennant
auraList[ 60023] = Never -- Scourge Banner Aura (Boneguard Commander in Icecrown)
auraList[ 63406] = Never -- Darnassus Champion's Pennant
auraList[ 63405] = Never -- Darnassus Valiant's Pennant
auraList[ 63423] = Never -- Exodar Champion's Pennant
auraList[ 63422] = Never -- Exodar Valiant's Pennant
auraList[ 63396] = Never -- Gnomeregan Champion's Pennant
auraList[ 63395] = Never -- Gnomeregan Valiant's Pennant
auraList[ 63427] = Never -- Ironforge Champion's Pennant
auraList[ 63426] = Never -- Ironforge Valiant's Pennant
auraList[ 63433] = Never -- Orgrimmar Champion's Pennant
auraList[ 63432] = Never -- Orgrimmar Valiant's Pennant
auraList[ 63399] = Never -- Sen'jin Champion's Pennant
auraList[ 63398] = Never -- Sen'jin Valiant's Pennant
auraList[ 63403] = Never -- Silvermoon Champion's Pennant
auraList[ 63402] = Never -- Silvermoon Valiant's Pennant
auraList[ 62594] = Never -- Stormwind Champion's Pennant
auraList[ 62596] = Never -- Stormwind Valiant's Pennant
auraList[ 63436] = Never -- Thunder Bluff Champion's Pennant
auraList[ 63435] = Never -- Thunder Bluff Valiant's Pennant
auraList[ 63430] = Never -- Undercity Champion's Pennant
auraList[ 63429] = Never -- Undercity Valiant's Pennant

------------------------------------------------------------------------
-- Death Knight
------------------------------------------------------------------------
if (playerClass == "DEATHKNIGHT") then
	-- Abilities
	auraList[ 48707] = ByPlayer -- Anti-Magic Shell
	auraList[221562] = ByPlayer -- Asphyxiate -- NEEDS CHECK, 108194
	auraList[206977] = ByPlayer -- Blood Mirror
	auraList[ 55078] = ByPlayer -- Blood Plague
	auraList[195181] = ByPlayer -- Bone Shield
	auraList[ 45524] = ByPlayer -- Chains of Ice
	auraList[111673] = ByPlayer -- Control Undead
	auraList[207319] = ByPlayer -- Corpse Shield
	auraList[101568] = ByPlayer -- Dark Succor
	auraList[194310] = ByPlayer -- Festering Wound
	auraList[190780] = ByPlayer -- Frost Breath
	auraList[ 55095] = ByPlayer -- Frost Fever
	auraList[206930] = ByPlayer -- Heart Strike
	auraList[ 48792] = ByPlayer -- Icebound Fortitude
	auraList[194879] = ByPlayer -- Icy Talons
	auraList[ 51124] = ByPlayer -- Killing Machine
	auraList[206940] = ByPlayer -- Mark of Blood
	auraList[216974] = ByPlayer -- Necrosis
	auraList[207256] = ByPlayer -- Obliteration
	auraList[219788] = ByPlayer -- Ossuary
	auraList[  3714] = ByPlayer -- Path of Frost -- TODO: show only OOC
	auraList[ 51271] = ByPlayer -- Pillar of Frost
	auraList[196770] = ByPlayer -- Remorseless Winter (self)
	auraList[211793] = ByPlayer -- Remorseless Winter (slow)
	auraList[ 59052] = ByPlayer -- Rime
	auraList[130736] = ByPlayer -- Soul Reaper
	auraList[ 55233] = ByPlayer -- Vampiric Blood
	auraList[191587] = ByPlayer -- Virulent Plague
	auraList[211794] = ByPlayer -- Winter is Coming
	auraList[212552] = ByPlayer -- Wraith Walk

	-- Talents
	auraList[116888] = ByPlayer -- Shroud of Purgatory (from Purgatory)

	-- Artifact Traits
	auraList[191748] = ByPlayer -- Scouge of Worlds
end

------------------------------------------------------------------------
-- Demon Hunter
------------------------------------------------------------------------
if (playerClass == "DEMONHUNTER") then
	-- Abilities
	auraList[207709] = ByPlayer -- Blade Turning
	auraList[207690] = ByPlayer -- Bloodlet
	auraList[212800] = ByPlayer -- Blur
	auraList[203819] = ByPlayer -- Demon Spikes
	auraList[227330] = ByPlayer -- Gluttony
	auraList[218256] = ByPlayer -- Empower Wards
	auraList[162264] = ByPlayer -- Metamorphosis
	auraList[207810] = ByPlayer -- Nether Bond
	auraList[196555] = ByPlayer -- Netherwalk

	-- Talents
	auraList[206491] = OnEnemy -- Nemesis (missing caster)

	-- Artifact Traits
end

------------------------------------------------------------------------
-- Druid
------------------------------------------------------------------------
if (playerClass == "DRUID") then
	-- Buffs
	auraList[ 29166] = OnFriend -- Innervate
	auraList[102342] = OnFriend -- Ironbark
	auraList[106898] = OnFriend -- Stampeding Roar

	-- Abilities
	auraList[  1850] = ByPlayer -- Dash
	auraList[ 22812] = ByPlayer -- Barkskin
	auraList[106951] = ByPlayer -- Berserk
	auraList[202739] = ByPlayer -- Blessing of An'she (Blessing of the Ancients)
	auraList[202737] = ByPlayer -- Blessing of Elune (Blessing of the Ancients)
	auraList[145152] = ByPlayer -- Bloodtalons
	auraList[155835] = ByPlayer -- Bristling Fur
	auraList[135700] = ByPlayer -- Clearcasting (Omen of Clarity) (Feral)
	auraList[ 16870] = ByPlayer -- Clearcasting (Omen of Clarity) (Restoration)
	auraList[202060] = ByPlayer -- Elune's Guidance
	auraList[ 22842] = ByPlayer -- Frenzied Regeneration
	auraList[202770] = ByPlayer -- Fury of Elune
	auraList[213709] = ByPlayer -- Galactic Guardian
	auraList[213680] = ByPlayer -- Guardian of Elune
	auraList[    99] = ByPlayer -- Incapacitating Roar
	auraList[102560] = ByPlayer -- Incarnation: Chosen of Elune
	auraList[102558] = ByPlayer -- Incarnation: Guardian of Ursoc
	auraList[102543] = ByPlayer -- Incarnation: King of the Jungle
	auraList[192081] = ByPlayer -- Ironfur
	auraList[164547] = ByPlayer -- Lunar Empowerment
	auraList[203123] = ByPlayer -- Maim
	auraList[192083] = ByPlayer -- Mark of Ursol
	auraList[ 33763] = ByPlayer -- Lifebloom
	auraList[164812] = ByPlayer -- Moonfire -- NEEDS CHECK, 8921
	auraList[155625] = ByPlayer -- Moonfire (Cat Form)
	auraList[ 69369] = ByPlayer -- Predatory Swiftness
	auraList[158792] = ByPlayer -- Pulverize
	auraList[155722] = ByPlayer -- Rake
	auraList[  8936] = ByPlayer -- Regrowth
	auraList[   774] = ByPlayer -- Rejuvenation
	auraList[  1079] = ByPlayer -- Rip
	auraList[ 52610] = ByPlayer -- Savage Roar
	auraList[ 78675] = ByPlayer -- Solar Beam
	auraList[164545] = ByPlayer -- Solar Empowerment
	auraList[191034] = ByPlayer -- Starfire
	auraList[202347] = ByPlayer -- Stellar Flare
	auraList[164815] = ByPlayer -- Sunfire -- NEEDS CHECK, 93402
	auraList[ 61336] = ByPlayer -- Survival Instincts
	auraList[192090] = ByPlayer -- Thrash (Bear) -- NEEDS CHECK
	auraList[106830] = ByPlayer -- Thrash (Cat)
	auraList[  5217] = ByPlayer -- Tiger's Fury
	auraList[102793] = ByPlayer -- Ursol's Vortex
	auraList[202425] = ByPlayer -- Warrior of Elune
	auraList[ 48438] = ByPlayer -- Wild Growth

	-- Talents

	-- Artifact Traits
	auraList[210723] = ByPlayer -- Ashmane's Frenzy
	auraList[200851] = ByPlayer -- Rage of the Sleeper
	auraList[210664] = ByPlayer -- Scent of Blood
end

------------------------------------------------------------------------
-- Hunter
------------------------------------------------------------------------
if (playerClass == "HUNTER") then
	-- Abilities
	auraList[131894] = ByPlayer -- A Murder of Crows (Beast Mastery, Marksmanship)
	auraList[206505] = ByPlayer -- A Murder of Crows (Survival)
	auraList[186257] = ByPlayer -- Aspect of the Cheetah
	auraList[186289] = ByPlayer -- Aspect of the Eagle
	auraList[186265] = ByPlayer -- Aspect of the Turtle
	auraList[193530] = ByPlayer -- Aspect of the Wild
	auraList[ 19574] = ByPlayer -- Bestial Wrath
	auraList[117526] = ByPlayer -- Binding Shot (stun)
	auraList[117405] = ByPlayer -- Binding Shot (tether)
	auraList[194279] = ByPlayer -- Caltrops
	auraList[199483] = ByPlayer -- Camouflage
	auraList[  5116] = ByPlayer -- Concussive Shot
	auraList[ 13812] = ByPlayer -- Explosive Trap -- NEEDS CHECK
	auraList[  5384] = ByPlayer -- Feign Death
	auraList[  3355] = ByPlayer -- Freezing Trap -- NEEDS CHECK
	auraList[194594] = ByPlayer -- Lock and Load
	auraList[ 34477] = ByPlayer -- Misdirection
	auraList[201081] = ByPlayer -- Mok'Nathal Tactics
	auraList[190931] = ByPlayer -- Mongoose Fury
	auraList[118922] = ByPlayer -- Posthaste
	auraList[200108] = ByPlayer -- Ranger's Net
	auraList[118253] = ByPlayer -- Serpent Sting
	auraList[135299] = ByPlayer -- Tar Trap
	auraList[193526] = ByPlayer -- Trueshot
	auraList[187131] = ByPlayer -- Vulnerable
	auraList[195645] = ByPlayer -- Wing Clip

	-- Talents

	-- Artifact Traits
end

------------------------------------------------------------------------
-- Mage
------------------------------------------------------------------------
if (playerClass == "MAGE") then
	-- Abilities
	auraList[ 12042] = ByPlayer -- Arcane Power
	auraList[157981] = ByPlayer -- Blast Wave
	auraList[108843] = ByPlayer -- Blazing Speed
	auraList[205766] = ByPlayer -- Bone Chilling
	auraList[263725] = ByPlayer -- Clearcasting
	auraList[190319] = ByPlayer -- Combustion
	auraList[   120] = ByPlayer -- Cone of Cold
	auraList[ 31661] = ByPlayer -- Dragon's Breath
	auraList[210134] = ByPlayer -- Erosion
	auraList[126084] = ByPlayer -- Fingers of Frost -- NEEDS CHECK 44544
	auraList[  2120] = ByPlayer -- Flamestrike
	auraList[112948] = ByPlayer -- Frost Bomb
	auraList[   122] = ByPlayer -- Frost Nova
	auraList[228600] = ByPlayer -- Glacial Spike
	auraList[110960] = ByPlayer -- Greater Invisibility
	auraList[195283] = ByPlayer -- Hot Streak
	auraList[ 11426] = ByPlayer -- Ice Barrier
	auraList[ 45438] = ByPlayer -- Ice Block
	auraList[108839] = ByPlayer -- Ice Floes
	auraList[ 12472] = ByPlayer -- Icy Veins
	auraList[ 12654] = ByPlayer -- Ignite
	auraList[    66] = ByPlayer -- Invisibility
	auraList[ 44457] = ByPlayer -- Living Bomb
	auraList[114923] = ByPlayer -- Nether Tempest
	auraList[205025] = ByPlayer -- Presence of Mind
	auraList[198924] = ByPlayer -- Quickening
	auraList[ 82691] = ByPlayer -- Ring of Frost
	auraList[ 31589] = ByPlayer -- Slow
	auraList[   130] = ByPlayer -- Slow Fall

	-- Talents

	-- Artifact Traits
end

------------------------------------------------------------------------
-- Monk
------------------------------------------------------------------------
if (playerClass == "MONK") then
	-- Abilities
	auraList[228563] = ByPlayer -- Blackout Combo
	auraList[115181] = ByPlayer -- Breath of Fire
	auraList[119085] = ByPlayer -- Chi Torpedo
	auraList[122278] = ByPlayer -- Dampen Harm
	auraList[122783] = ByPlayer -- Diffuse Magic
	auraList[116095] = ByPlayer -- Disable
	auraList[196723] = ByPlayer -- Dizzying Kicks
	auraList[124682] = ByPlayer -- Enveloping Mist
	auraList[191840] = ByPlayer -- Essence Font
	auraList[196739] = ByPlayer -- Elusive Dance
	auraList[196608] = ByPlayer -- Eye of the Tiger
	auraList[120954] = ByPlayer -- Fortifying Brew
	auraList[124273] = ByPlayer -- Heavy Stagger
	auraList[196741] = ByPlayer -- Hit Combo
	auraList[215479] = ByPlayer -- Ironskin Brew
	auraList[121253] = ByPlayer -- Keg Smash
	auraList[119381] = ByPlayer -- Leg Sweep
	auraList[116849] = ByPlayer -- Life Cocoon
	auraList[197919] = ByPlayer -- Lifecycles (Enveloping Mist)
	auraList[197916] = ByPlayer -- Lifecycles (Vivify)
	auraList[124275] = ByPlayer -- Light Stagger
	auraList[197908] = ByPlayer -- Mana Tea
	auraList[124274] = ByPlayer -- Moderate Stagger
	auraList[115078] = ByPlayer -- Paralysis
	auraList[129914] = ByPlayer -- Power Strikes
	auraList[196725] = ByPlayer -- Refreshing Jade Wind
	auraList[119611] = ByPlayer -- Renewing Mist -- NEEDS CHECK 144080
	auraList[116844] = ByPlayer -- Ring of Peace
	auraList[116847] = ByPlayer -- Rushing Jade Wind
	auraList[152173] = ByPlayer -- Serenity
	auraList[198909] = ByPlayer -- Song of Chi-Ji
	auraList[196733] = ByPlayer -- Special Delivery -- NEEDS CHECK
	auraList[202090] = ByPlayer -- Teachings of the Monastery
	auraList[116680] = ByPlayer -- Thunder Focus Tea
	auraList[116841] = ByPlayer -- Tiger's Lust
	auraList[115080] = ByPlayer -- Touch of Death
	auraList[122470] = ByPlayer -- Touch of Karma
	auraList[115176] = ByPlayer -- Zen Meditation

	-- Talents
	auraList[116768] = ByPlayer -- Blackout Kick! (from Combo Breaker)

	-- Artifact Traits
	auraList[205320] = ByPlayer -- Strike of the Windlord
end

------------------------------------------------------------------------
-- Paladin
------------------------------------------------------------------------
if (playerClass == "PALADIN") then
	-- Buffs
	auraList[257771] = OnFriend -- Forbearance
	auraList[ 53563] = OnFriend -- Beacon of Light
	auraList[  1044] = OnFriend -- Blessing of Freedom
	auraList[  1022] = OnFriend -- Blessing of Protection
	auraList[  6940] = OnFriend -- Blessing of Sacrifice
	auraList[204013] = OnFriend -- Blessing of Salvation
	auraList[204018] = OnFriend -- Blessing of Spellwarding

	-- Abilities
	auraList[204150] = ByPlayer -- Aegis of Light
	auraList[ 31850] = ByPlayer -- Ardent Defender
	auraList[ 31842] = ByPlayer -- Avenging Wrath (Holy)
	auraList[ 31884] = ByPlayer -- Avenging Wrath (Protection, Retribution)
	auraList[105421] = ByPlayer -- Blinding Light
	auraList[224668] = ByPlayer -- Crusade
	auraList[216411] = ByPlayer -- Divine Purpose (Holy - Holy Shock)
	auraList[216413] = ByPlayer -- Divine Purpose (Holy - Light of Dawn)
	auraList[223819] = ByPlayer -- Divine Purpose (Retribution)
	auraList[   642] = ByPlayer -- Divine Shield
	auraList[220509] = ByPlayer -- Divine Steed
	auraList[221883] = ByPlayer -- Divine Steed
	auraList[221886] = ByPlayer -- Divine Steed (Blood Elf)
	auraList[221887] = ByPlayer -- Divine Steed (Draenei)
	auraList[221885] = ByPlayer -- Divine Steed (Tauren)
	auraList[205191] = ByPlayer -- Eye for an Eye
	auraList[223316] = ByPlayer -- Fervent Light
	auraList[ 86659] = ByPlayer -- Guardian of Ancient Kings
	auraList[   853] = ByPlayer -- Hammer of Justice
	auraList[183218] = ByPlayer -- Hand of Hindrance
	auraList[105809] = ByPlayer -- Holy Avenger
	auraList[ 54149] = ByPlayer -- Infusion of Light
	auraList[183436] = ByPlayer -- Retribution
	auraList[214202] = ByPlayer -- Rule of Law
	auraList[202273] = ByPlayer -- Seal of Light
	auraList[152262] = ByPlayer -- Seraphim
	auraList[132403] = ByPlayer -- Shield of the Righteous
	auraList[184662] = ByPlayer -- Shield of Vengeance
	auraList[209785] = ByPlayer -- The Fires of Justice

	-- Talents

	-- Artifact Traits
end

------------------------------------------------------------------------
-- Priest
------------------------------------------------------------------------
if (playerClass == "PRIEST") then
	-- Abilities
	auraList[194384] = ByPlayer -- Atonement
	auraList[ 47585] = ByPlayer -- Disperson
	auraList[   586] = ByPlayer -- Fade
	auraList[ 47788] = ByPlayer -- Guardian Spirit
	auraList[ 14914] = ByPlayer -- Holy Fire
	auraList[200196] = ByPlayer -- Holy Word: Chastise
	auraList[  1706] = ByPlayer -- Levitate
	auraList[   605] = ByPlayer -- Mind Control
	auraList[ 33206] = ByPlayer -- Pain Suppression
	auraList[ 81782] = ByPlayer -- Power Word: Barrier
	auraList[    17] = ByPlayer -- Power Word: Shield
	auraList[ 41635] = ByPlayer -- Prayer of Mending
	auraList[  8122] = ByPlayer -- Psychic Scream
	auraList[ 47536] = ByPlayer -- Rapture
	auraList[   139] = ByPlayer -- Renew
	auraList[187464] = ByPlayer -- Shadow Mend
	auraList[   589] = ByPlayer -- Shadow Word: Pain
	auraList[ 15487] = ByPlayer -- Silence
	auraList[ 15286] = ByPlayer -- Vampiric Embrace
	auraList[ 34914] = ByPlayer -- Vampiric Touch
	auraList[227386] = ByPlayer -- Voidform -- NEEDS CHECK

	-- Talents
	auraList[200183] = ByPlayer -- Apotheosis
	auraList[214121] = ByPlayer -- Body and Mind
	auraList[152118] = ByPlayer -- Clarity of Will
	auraList[ 19236] = ByPlayer -- Desperate Prayer
	auraList[197030] = ByPlayer -- Divinity
	auraList[205369] = ByPlayer -- Mind Bomb
	auraList[226943] = ByPlayer -- Mind Bomb (stun)
	auraList[204213] = ByPlayer -- Purge the Wicked
	auraList[214621] = ByPlayer -- Schism
	auraList[219521] = ByPlayer -- Shadow Covenant
	auraList[124430] = ByPlayer -- Shadowy Insight
	auraList[204263] = ByPlayer -- Shining Force
	auraList[114255] = ByPlayer -- Surge of Light -- NEEDS CHECK, 128654
	auraList[123254] = ByPlayer -- Twist of Fate

	-- Artifact Traits
	auraList[196644] = ByPlayer -- Blessing of T'uure
	auraList[197763] = ByPlayer -- Borrowed Time
	auraList[208065] = ByPlayer -- Light of T'uure
end

------------------------------------------------------------------------
-- Rogue
------------------------------------------------------------------------
if (playerClass == "ROGUE") then
	-- Abilities
	auraList[ 13750] = ByPlayer -- Adrenaline Rush
	auraList[ 13877] = ByPlayer -- Blade Flurry
	auraList[199740] = ByPlayer -- Bribe
	auraList[  1833] = ByPlayer -- Cheap Shot
	auraList[ 31224] = ByPlayer -- Cloak of Shadows
	auraList[  3409] = ByPlayer -- Crippling Poison (debuff)
	auraList[  2818] = ByPlayer -- Deadly Poison (debuff)
	auraList[  5277] = ByPlayer -- Evasion
	auraList[  1966] = ByPlayer -- Feint
	auraList[   703] = ByPlayer -- Garrote
	auraList[  1776] = ByPlayer -- Gouge
	auraList[   408] = ByPlayer -- Kidney Shot
	auraList[195452] = ByPlayer -- Nightblade
	auraList[185763] = ByPlayer -- Pistol Shot
	auraList[199754] = ByPlayer -- Riposte
	auraList[193356] = ByPlayer -- Roll the Bones - Broadsides
	auraList[199600] = ByPlayer -- Roll the Bones - Buried Treasure
	auraList[193358] = ByPlayer -- Roll the Bones - Grand Melee
	auraList[199603] = ByPlayer -- Roll the Bones - Jolly Roger
	auraList[193357] = ByPlayer -- Roll the Bones - Shark Infested Waters
	auraList[193359] = ByPlayer -- Roll the Bones - True Bearing
	auraList[  1943] = ByPlayer -- Rupture
	auraList[121471] = ByPlayer -- Shadow Blades
	auraList[185422] = ByPlayer -- Shadow Dance
	auraList[ 36554] = ByPlayer -- Shadowstep
	auraList[  2983] = ByPlayer -- Sprint
	auraList[  1784] = ByPlayer -- Stealth
	auraList[212283] = ByPlayer -- Symbols of Death
	auraList[ 57934] = ByPlayer -- Tricks of the Trade
	auraList[  1856] = ByPlayer -- Vanish
	auraList[ 79140] = ByPlayer -- Vendetta
	--auraList[  8680] = ByPlayer -- Wound Poison -- who cares?

	-- Talents
	auraList[200803] = ByPlayer -- Agonizing Poison
	auraList[196937] = ByPlayer -- Ghostly Strike
	auraList[ 16511] = ByPlayer -- Hemorrhage
	auraList[135345] = ByPlayer -- Internal Bleeding
	auraList[ 51690] = ByPlayer -- Killing Spree
	auraList[137619] = ByPlayer -- Marked for Death
	auraList[  5171] = ByPlayer -- Slice and Dice

	-- Artifact Traits
	auraList[220901] = ByPlayer -- Goremaw's Bite (regen)
	auraList[209786] = ByPlayer -- Goremaw's Bite (slow)
	auraList[192759] = ByPlayer -- Kingsbane (dot)
	auraList[192853] = ByPlayer -- Kingsbane (+damage)
end

------------------------------------------------------------------------
-- Shaman
------------------------------------------------------------------------
if (playerClass == "SHAMAN") then
	-- Abilities
	auraList[108281] = ByPlayer -- Ancestral Guidance
	auraList[108271] = ByPlayer -- Astral Shift
	auraList[187878] = ByPlayer -- Crash Lightning
	auraList[188089] = ByPlayer -- Earthen Spike -- 10s duration on a 20s cooldown
	--auraList[118522] = ByPlayer -- Elemental Blast: Critical Strike -- 10s duration on a 12s cooldown
	--auraList[173183] = ByPlayer -- Elemental Blast: Haste -- 10s duration on a 12s cooldown
	--auraList[173184] = ByPlayer -- Elemental Blast: Mastery -- 10s duration on a 12s cooldown
	auraList[ 16246] = ByPlayer -- Elemental Focus
	auraList[188838] = ByPlayer -- Flame Shock (restoration)
	auraList[188389] = ByPlayer -- Flame Shock
	auraList[194084] = ByPlayer -- Flametongue
	auraList[196840] = ByPlayer -- Frost Shock
	auraList[196834] = ByPlayer -- Frostbrand
	auraList[ 73920] = ByPlayer -- Healing Rain
	auraList[215785] = ByPlayer -- Hot Hand
	auraList[210714] = ByPlayer -- Icefury
	auraList[202004] = ByPlayer -- Landslide
	auraList[ 77756] = ByPlayer -- Lava Surge
	auraList[197209] = ByPlayer -- Lightning Rod -- NEEDS CHECK
	auraList[ 61295] = ByPlayer -- Riptide
	auraList[ 98007] = OnFriend -- Spirit Link Totem
	auraList[ 58875] = ByPlayer -- Spirit Walk
	auraList[ 79206] = ByPlayer -- Spiritwalker's Grace
	--auraList[201846] = ByPlayer -- Stormbringer -- see spell alert overlay, action button proc glow
	auraList[ 51490] = ByPlayer -- Thunderstorm
	auraList[ 53390] = ByPlayer -- Tidal Waves
	--auraList[   546] = OnFriend -- Water Walking -- TODO: show only OOC
	--auraList[201898] = ByPlayer -- Windsong -- 20s duration on a 45s cooldown

	-- Talents
	auraList[114050] = ByPlayer -- Ascendance (Elemental)
	auraList[114051] = ByPlayer -- Ascendance (Enhancement)
	auraList[114052] = ByPlayer -- Ascendance (Restoration)
	auraList[218825] = ByPlayer -- Boulderfist
	auraList[ 64695] = OnEnemy  -- Earthgrab (Totem) -- NEEDS CHECK
	auraList[135621] = OnEnemy  -- Static Charge (Lightning Surge Totem) -- NEEDS CHECK
	auraList[192082] = OnFriend -- Wind Rush (Totem)

	-- Artifact Traits
	auraList[198300] = ByPlayer -- Gathering Storms -- +2% damage to next Stormstrike per Crash Lightning target
	auraList[191877] = ByPlayer -- Power of the Maelstrom -- buffs next 3 LBs, 20s duration
	auraList[205495] = ByPlayer -- Stormkeeper -- buffs next 3 LB/CBs, 15s duration
end

------------------------------------------------------------------------
-- Warlock
------------------------------------------------------------------------
if (playerClass == "WARLOCK") then
	-- Abilities
	auraList[   980] = ByPlayer -- Agony
	auraList[117828] = ByPlayer -- Backdraft
	auraList[111400] = ByPlayer -- Burning Rush
	auraList[146739] = ByPlayer -- Corruption
	auraList[108416] = ByPlayer -- Dark Pact
	auraList[205146] = ByPlayer -- Demonic Calling
	auraList[ 48018] = ByPlayer -- Demonic Circle -- TODO show on the side as a separate thingy
	auraList[193396] = ByPlayer -- Demonic Empowerment
	auraList[171982] = ByPlayer -- Demonic Synergy -- too passive?
	auraList[   603] = ByPlayer -- Doom
	auraList[  1098] = ByPlayer -- Enslave Demon
	auraList[196414] = ByPlayer -- Eradication
	auraList[ 48181] = ByPlayer -- Haunt -- NEEDS CHECK, 171788, 183357
	auraList[ 80240] = ByPlayer -- Havoc
	auraList[228312] = ByPlayer -- Immolate -- NEEDS CHECK
	auraList[  6789] = ByPlayer -- Mortal Coil
	auraList[205179] = ByPlayer -- Phantom Singularity
	auraList[196674] = ByPlayer -- Planeswalker
	auraList[  5740] = ByPlayer -- Rain of Fire
	auraList[ 27243] = ByPlayer -- Seed of Corruption
	auraList[205181] = ByPlayer -- Shadowflame
	auraList[ 30283] = ByPlayer -- Shadowfury
	auraList[205178] = ByPlayer -- Soul Effigy
	auraList[196098] = ByPlayer -- Soul Harvest
	--auraList[ 20707] = ByPlayer -- Soulstone -- OOC
	--auraList[  5697] = ByPlayer -- Unending Breath -- OOC
	auraList[104773] = ByPlayer -- Unending Resolve
	auraList[ 30108] = ByPlayer -- Unstable Affliction

	-- Talents

	-- Artifact Traits
	auraList[199281] = ByPlayer -- Compounding Horror
	auraList[196546] = ByPlayer -- Conflagration of Chaos
	auraList[211583] = ByPlayer -- Stolen Power
	auraList[216695] = ByPlayer -- Tormented Souls
end

------------------------------------------------------------------------
-- Warrior
------------------------------------------------------------------------
if (playerClass == "WARRIOR") then
	-- Abilities
	auraList[  1719] = ByPlayer -- Battle Cry
	auraList[ 18499] = ByPlayer -- Berserker Rage
	auraList[227847] = ByPlayer -- Bladestorm
	auraList[105771] = ByPlayer -- Charge
	auraList[ 97463] = OnFriend -- Commanding Shout
	auraList[115767] = ByPlayer -- Deep Wounds
	auraList[  1160] = ByPlayer -- Demoralizing Shout
	auraList[118038] = ByPlayer -- Die by the Sword
	auraList[184362] = ByPlayer -- Enrage
	auraList[184364] = ByPlayer -- Enraged Regeneration
	auraList[204488] = ByPlayer -- Focused Rage
	auraList[  1715] = ByPlayer -- Hamstring
	auraList[190456] = ByPlayer -- Ignore Pain
	auraList[  5246] = ByPlayer -- Intimidating Shout
	auraList[ 12975] = ByPlayer -- Last Stand
	auraList[ 85739] = ByPlayer -- Meat Cleaver
	auraList[ 12323] = ByPlayer -- Piercing Howl
	auraList[132404] = ByPlayer -- Shield Block
	auraList[   871] = ByPlayer -- Shield Wall
	auraList[ 23920] = ByPlayer -- Spell Reflection
	auraList[206333] = ByPlayer -- Taste for Blood
	auraList[  6343] = ByPlayer -- Thunder Clap

	-- Talents
	auraList[107574] = ByPlayer -- Avatar
	auraList[ 46924] = ByPlayer -- Bladestorm
	auraList[ 12292] = ByPlayer -- Bloodbath
	auraList[197690] = ByPlayer -- Defensive Stance
	auraList[118000] = ByPlayer -- Dragon Roar
	auraList[207982] = ByPlayer -- Focused Rage
	auraList[215572] = ByPlayer -- Frothing Berserker
	auraList[   772] = ByPlayer -- Rend
	auraList[ 46968] = ByPlayer -- Shockwave
	auraList[107570] = ByPlayer -- Storm Bolt
	auraList[215537] = ByPlayer -- Trauma
	--auraList[122510] = ByPlayer -- Ultimatum -- action button glow + spell alert overlay
	auraList[202573] = ByPlayer -- Vengeance: Focused Rage
	auraList[202547] = ByPlayer -- Vengeance: Ignore Pain
	auraList[215562] = ByPlayer -- War Machine
	auraList[215570] = ByPlayer -- Wrecking Ball

	-- Artifact Traits
	auraList[203524] = ByPlayer -- Neltharion's Fury
	auraList[205546] = ByPlayer -- Odyn's Fury (dot) -- NEEDS CHECK, 205546
end

------------------------------------------------------------------------
-- Racials
------------------------------------------------------------------------
if (playerRace == "BloodElf") then
	auraList[ 50613] = ByPlayer -- Arcane Torrent (DK)
	auraList[ 80483] = ByPlayer -- Arcane Torrent (HU)
	auraList[ 28730] = ByPlayer -- Arcane Torrent (MA, PA, PR, WL)
	auraList[129597] = ByPlayer -- Arcane Torrent (MO)
	auraList[ 25046] = ByPlayer -- Arcane Torrent (RO)
	auraList[ 69179] = ByPlayer -- Arcane Torrent (WR)

elseif (playerRace == "Draenei") then
	auraList[ 59545] = ByPlayer -- Gift of the Naaru (DK)
	auraList[ 59543] = ByPlayer -- Gift of the Naaru (HU)
	auraList[ 59548] = ByPlayer -- Gift of the Naaru (MA)
	auraList[121093] = ByPlayer -- Gift of the Naaru (MO)
	auraList[ 59542] = ByPlayer -- Gift of the Naaru (PA)
	auraList[ 59544] = ByPlayer -- Gift of the Naaru (PR)
	auraList[ 59547] = ByPlayer -- Gift of the Naaru (SH)
	auraList[ 28880] = ByPlayer -- Gift of the Naaru (WR)

elseif (playerRace == "Dwarf") then
	auraList[ 20594] = ByPlayer -- Stoneform

elseif (playerRace == "NightElf") then
	auraList[ 58984] = ByPlayer -- Shadowmeld

elseif (playerRace == "Orc") then
	auraList[ 20572] = ByPlayer -- Blood Fury (attack power)
	auraList[ 33702] = ByPlayer -- Blood Fury (spell power)
	auraList[ 33697] = ByPlayer -- Blood Fury (attack power and spell damage)

elseif (playerRace == "Pandaren") then
	auraList[107079] = ByPlayer -- Quaking Palm

elseif (playerRace == "Scourge") then
	auraList[  7744] = ByPlayer -- Will of the Forsaken

elseif (playerRace == "Tauren") then
	auraList[ 20549] = Always -- War Stomp

elseif (playerRace == "Troll") then
	auraList[ 26297] = ByPlayer -- Berserking

elseif (playerRace == "Worgen") then
	auraList[ 68992] = ByPlayer -- Darkflight
end

------------------------------------------------------------------------
-- Taunts (tanks only)
------------------------------------------------------------------------
if Functions.PlayerCanTank(playerClass) then
	auraList[36213]  = PlayerIsTank -- Angered Earth (SH Earth Elemental)
	auraList[56222]  = PlayerIsTank -- Dark Command (DK)
	auraList[57604]  = PlayerIsTank -- Death Grip (DK) -- NEEDS CHECK 49560 51399 57603
	auraList[20736]  = PlayerIsTank -- Distracting Shot (HU)
	auraList[6795]   = PlayerIsTank -- Growl (DR)
	auraList[ 62124] = PlayerIsTank -- Hand of Reckoning (Paladin)
	auraList[118585] = PlayerIsTank -- Leer of the Ox (MO)
	auraList[114198] = PlayerIsTank -- Mocking Banner (WR)
	auraList[116189] = PlayerIsTank -- Provoke (MO)
	auraList[118635] = PlayerIsTank -- Provoke (MO Black Ox Statue) -- NEEDS CHECK
	auraList[62124]  = PlayerIsTank -- Reckoning (PA)
	auraList[17735]  = PlayerIsTank -- Suffering (WL Voidwalker)
	auraList[355]    = PlayerIsTank -- Taunt (WR)
	auraList[185245] = PlayerIsTank -- Torment (Demon Hunter)
end

------------------------------------------------------------------------
-- Group Buffs
------------------------------------------------------------------------
auraList[  1459] = OnParty -- Arcane Intellect (Mage)
auraList[ 21562] = OnParty -- Fortitude (Priest)
auraList[203538] = OnParty -- Greater Blessing of Kings (Paladin)
auraList[203528] = OnParty -- Greater Blessing of Might (Paladin)
auraList[203539] = OnParty -- Greater Blessing of Wisdom (Paladin)

Auras.filterFlags = filterFlags
Auras.auraList = auraList
