Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function(...)
- local GetAuraSourceName = function(aura)
- local ColorizeString = function(subject, r, g, b)
- r = r <= 255 and r >= 0 and r or 0
- g = g <= 255 and g >= 0 and g or 0
- b = b <= 255 and b >= 0 and b or 0
- local color = string.format('%02x%02x%02x', r, g, b)
- if not color or not subject then return end
- return ('|cFF%s%s|r'):format(color,subject)
- end
- local GetClassColor = function(class)
- local CLASS_COLORS = {
- ['Death Knight'] = {r=196, g=31, b=59,},
- ['Druid'] = {r=255, g=125, b=10,},
- ['Hunter'] = {r=171, g=212, b=115,},
- ['Mage'] = {r=105, g=204, b=240,},
- ['Monk'] = {r=0, g=255, b=150,},
- ['Paladin'] = {r=245, g=140, b=186,},
- ['Priest'] = {r=255, g=255, b=255,},
- ['Rogue'] = {r=255, g=245, b=105,},
- ['Shaman'] = {r=0, g=112, b=222,},
- ['Warlock'] = {r=148, g=130, b=201,},
- ['Warrior'] = {r=199, g=156, b=110,},
- }
- if CLASS_COLORS[class] then return CLASS_COLORS[class].r, CLASS_COLORS[class].g, CLASS_COLORS[class].b end
- end
- local RAID_SIZE = 10 -- CHANGE THIS
- if not aura then return end
- local auraName = aura
- if type(aura) == 'number' then auraName = GetSpellInfo(aura) end
- for i=1,RAID_SIZE do
- local unitCaster = select(8, UnitAura('raid'..i, auraName))
- if unitCaster and UnitExists(unitCaster) then return ColorizeString(UnitName(unitCaster), GetClassColor(UnitClass(unitCaster))) end
- end
- local unitCaster = select(8, UnitAura('player', auraName))
- if unitCaster and UnitExists(unitCaster) then return ColorizeString(UnitName(unitCaster), GetClassColor(UnitClass(unitCaster))) end
- end
- return GetAuraSourceName(select(5, ...))
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement