--[[
sFilter
Copyright (c) 2009, Nils Ruesch
All rights reserved.
Edited by ALZA
]]
--[[ Options start here ]]
-- "true" means enabled, "false" means disabled
local configmode = false -- In this mode all icons are shown and can be moved.
local FontSize = 20 -- Font size for stacks text
local r, g, b = .8, .8, .8 -- Text color for stacks text More info:
http://www.wowwiki.com/API_FontString_SetTextColorlocal CountPoint = { "TOPLEFT" ,-5,5} -- Stacks text position. More info:
http://www.wowwiki.com/API_Region_SetPoint--[[ More info about config mode:
You can move icons with left mouse button while holding Alt OR Shift. Changed position won't be saved between sessions.
After click on icon you will see in chat info about its position. This can be used to change setPoint attribute is spell list.
Clicking on icon with right mouse button will reset its position to default.
]]
--[[ Closer look at spell lists:
All classes have their own spell list.
Each entry in list creates a separate icon. Entry is a table with values in it:
- spellId - id of spell you want to track. If you don't know it - check wowhead.com - last number in any spell link is spellid (example:
http://www.wowhead.com/?spell=55095, id is 55095)
- spellId2, spellId3, spellId4, spellId5 - optional entries, these are the spellids you want to track if primary spell is NOT active.
- size - icon size in pixels
- unitId - unit at which you wish to track selected spell(s). More info:
http://www.wowwiki.com/UnitId- isMine - this is filter. isMine = 1 means only effects from units in MyUnits table will be shown (see below for this table. Note: isMine = "1" will NOT work, it should be number, not string. Any other value will show effect from any source
- filter - filter again =). Needs to be "HELPFUL" for buffs and "HARMFUL" for debuffs.
- setPoint - where to place the icon. It's a table with coordinates inside. More info:
http://www.wowwiki.com/API_Region_SetPointI removed alpha settings and some other things, you can use original addon version for these features:
http://toxila.googlecode.com/svn/zips/sFilter/]]
local sFilter_Spells = {
["HUNTER"] = {
-- Ток кровожадный
{spellId = 145974, size = 64, unitId = "boss2", isMine = 0, filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 0, 140}},
{spellId = 143411, size = 32, unitId = "target", isMine = 0, filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 0, 100}},
-- Тринкеты
{spellId = 126554, spellId2 = 60233 , spellId3 = 126707 , size = 32, unitId = "player", isMine = "1", filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 180, 0}},
{spellId = 128984, spellId2 = 105132 , spellId3= 126649, size = 32, unitId = "player", isMine = "1", filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 215, 0}},
-- 5.2
{spellId = 138756, size = 32, unitId = "player", isMine = "1", filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 180, 0}},
{spellId = 138737, spellId2 = 138699 , size = 32, unitId = "player", isMine = "1", filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 180, 0}},
{spellId = 138938, spellId3 = 139121 ,size = 32, unitId = "player", isMine = "1", filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 215, 0}},
-- 5.4
--{spellId = 146310, size = 32, unitId = "player", isMine = "1", filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 180, 0}},
--{spellId = 146308,size = 32, unitId = "player", isMine = "1", filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 215, 0}},
-- Плащ
{spellId = 146194,size = 32, unitId = "player", isMine = "1", filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 145, 0}},
--Важные дебаффы
{spellId = 138609, spellId2 = 135695, spellId3 = 136228 , size = 80, unitId = "player", isMine = 0, filter = "HARMFUL", setPoint = {"CENTER", UIParent, "CENTER", 0, 120}},
{spellId = 138308, spellId2 = 138288, spellId3 = 146594 , size = 80, unitId = "player", isMine = 0, filter = "HARMFUL", setPoint = {"CENTER", UIParent, "CENTER", 0, 120}},
{spellId = 142913, spellId2 = 142913, spellId3 = 142913 , size = 80, unitId = "player", isMine = 0, filter = "HARMFUL", setPoint = {"CENTER", UIParent, "CENTER", 0, 120}},
-- Дебаффы боссов
{spellId = 123059, spellId2 = 123059, spellId3 =123712 , size = 44, unitId = "target", isMine = 0, filter = "HARMFUL", setPoint = {"CENTER", UIParent, "CENTER", 0, 200}},
{spellId = 134092, spellId2 = 123059, spellId3 =123712 , size = 44, unitId = "target", isMine = 0, filter = "HARMFUL", setPoint = {"CENTER", UIParent, "CENTER", 0, 200}},
--Баффы боссов
{spellId = 113682, spellId2 = 117697, spellId3 = 117837 , size = 64, unitId = "target", isMine = 0, filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 0, 140}},
{spellId = 117961, spellId2 = 118162, spellId3 = 117309 , size = 64, unitId = "target", isMine = 0, filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 0, 140}},
{spellId = 145790, spellId2 = 145974, spellId3 = 145813 , size = 64, unitId = "target", isMine = 0, filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 0, 140}},
-- Важные баффы игрока
{spellId = 117687, spellId2 = 130742 , spellId3 = 140741 ,size = 45, unitId = "player", isMine = 0, filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 0, 200}},
--Героизм
{spellId = 32182, spellId2 = 80353, spellId3 = 90355 ,size = 50, unitId = "player", isMine = 0 , filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 250, 200}},
{spellId = 2825, spellId2 = 146555 ,size = 50, unitId = "player", isMine = 0 , filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 250, 200}},
-- Рейд баффы
{spellId = 33206, spellId2 = 1022 , spellId3 = 47788 , size = 50, unitId = "player", isMine = 0, filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 190, 200}},
{spellId = 1038, spellId2 = 57934 , spellId3 = 34477 , size = 50, unitId = "player", isMine = 0, filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 190, 200}},
{spellId = 6940, spellId2 = 97462 , size = 50, unitId = "player", isMine = 0, filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 190, 200}},
{spellId = 19263, spellId2 = 1022 , spellId3 = 47788 , size = 50, unitId = "player", isMine = 0, filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 190, 200}},
{spellId = 105588, spellId2 = 53480 , spellId3 = 53476 , size = 50, unitId = "player", isMine = 0, filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 190, 200}},
{spellId = 3411, spellId2 = 53480 , spellId3 = 53476 , size = 50, unitId = "player", isMine = 0, filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 190, 200}},
{spellId = 53480 , spellId2 = 53476 , size = 50, unitId = "player", isMine = 0, filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 190, 200}},
{spellId = 22842, spellId2 = 55233 , spellId3 = 55233 , size = 50, unitId = "player", isMine = 0, filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 190, 200}},
{spellId = 54216, spellId2 = 55233 , size = 50, unitId = "player", isMine = 0, filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 190, 200}},
{spellId = 81782, spellId2 = 55233 , size = 50, unitId = "player", isMine = 0, filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 190, 200}},
{spellId = 90361, spellId2 = 114207 , spellId3 = 54861 ,size = 45, unitId = "player", isMine = 0, filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 190, 200}},
--Пли ! , ЛНЛ , BW и другие проки
{spellId = 34471, size = 50, unitId = "player", isMine = 1, filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 190, 140}},
{spellId = 144670, size = 50, unitId = "player", isMine = 1, filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 190, 140}},
{spellId = 144659, spellId2 = 82926, spellId3 = 56453 ,size = 50, unitId = "player", isMine = 1, filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 190, 140}},
-- Рапид фаер - БМ Сконцентрированный огонь
{spellId = 3045 ,spellId2 = 82692 , spellId3 = 82726 , size = 50, unitId = "player", isMine = 1, filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 250, 140}},
{spellId = 3045 ,spellId2 = 82692 , spellId3 = 34720 , size = 50, unitId = "player", isMine = 1, filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 250, 140}},
-- Сандеры
{spellId = 113746 , size = 25, unitId = "target", isMine = "0", filter = "HARMFUL", setPoint = {"CENTER", UIParent, "CENTER", 180, -40}},
-- Кое
{spellId = 24844, spellId2 = 1490 , spellId3 = 93068 , size = 25, unitId = "target", isMine = 0, filter = "HARMFUL", setPoint = {"CENTER", UIParent, "CENTER", 215, -40}},
{spellId = 116202, spellId2 = 34889 , spellId3 = 58410 , size = 25, unitId = "target", isMine = 0, filter = "HARMFUL", setPoint = {"CENTER", UIParent, "CENTER", 215, -40}},
{spellId = 104225, spellId2 = 104225 , spellId3 = 104225 , size = 25, unitId = "target", isMine = 0, filter = "HARMFUL", setPoint = {"CENTER", UIParent, "CENTER", 215, -40}},
--Сокрушающий бросок
{spellId = 64382, size = 32, unitId = "target", isMine = 0, filter = "HARMFUL", setPoint = {"CENTER", UIParent, "CENTER", 250, 0}},
-- Hunter's Mark, Marked for Death
{spellId = 1130, size = 32, unitId = "target", isMine = "0", filter = "HARMFUL", setPoint = {"CENTER", UIParent, "CENTER", 180, 40}},
-- Serpent Sting
{spellId = 1978, size = 32, unitId = "target", isMine = 1, filter = "HARMFUL", setPoint = {"CENTER", UIParent, "CENTER", 215, 40}},
-- Токсин чёрной вдовы - Вороны
{spellId = 82654, spellId2 = 131894 , spellId3 = 120699 , size = 32, unitId = "target", isMine = 1, filter = "HARMFUL", setPoint = {"CENTER", UIParent, "CENTER", 285, 40}},
-- ММ аое
{spellId = 82921, size = 32, unitId = "player", isMine = 1, filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 250, 40}},
-- Black Arrow
{spellId = 3674, size = 32, unitId = "target", isMine = 1, filter = "HARMFUL", setPoint = {"CENTER", UIParent, "CENTER", 250, 40}},
-- Контроли
{spellId = 128405 , spellId2 = 1499 , spellId3= 1513, size = 32, unitId = "target", isMine = 0, filter = "HARMFUL", setPoint = {"CENTER", UIParent, "CENTER", 285, 0}},
{spellId = 64803, spellId2 = 24394 , spellId3 = 34490, size = 32, unitId = "target", isMine = 0, filter = "HARMFUL", setPoint = {"CENTER", UIParent, "CENTER", 285, 0}},
{spellId = 20736, spellId2 = 19503 , spellId3 = 34490, size = 32, unitId = "target", isMine = 0, filter = "HARMFUL", setPoint = {"CENTER", UIParent, "CENTER", 285, 0}},
{spellId = 408, spellId2 = 853 , spellId3 = 46968, size = 32, unitId = "target", isMine = 0, filter = "HARMFUL", setPoint = {"CENTER", UIParent, "CENTER", 285, 0}},
{spellId = 105593, spellId2 = 853 , spellId3 = 46968, size = 32, unitId = "target", isMine = 0, filter = "HARMFUL", setPoint = {"CENTER", UIParent, "CENTER", 285, 0}},
{spellId = 5211, spellId2 = 853 , spellId3 = 46968, size = 32, unitId = "target", isMine = 0, filter = "HARMFUL", setPoint = {"CENTER", UIParent, "CENTER", 285, 0}},
{spellId = 108194, spellId2 = 119381 , spellId3 = 113656, size = 32, unitId = "target", isMine = 0, filter = "HARMFUL", setPoint = {"CENTER", UIParent, "CENTER", 285, 0}},
{spellId = 114404, spellId2 = 114404 , spellId3 = 114404, size = 32, unitId = "target", isMine = 0, filter = "HARMFUL", setPoint = {"CENTER", UIParent, "CENTER", 285, 0}},
-- Замедления
{spellId = 13810, spellId2 = 5116 , spellId3 = 35102, size = 25, unitId = "target", isMine = 0, filter = "HARMFUL", setPoint = {"CENTER", UIParent, "CENTER", 285, 0}},
-- Explosive Shot debuff
{spellId = 53301, size = 32, unitId = "target", isMine = 1, filter = "HARMFUL", setPoint = {"CENTER", UIParent, "CENTER", 215, 80}},
-- Лечение питомца
{spellId = 136, size = 32, unitId = "pet", isMine = "1", filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 250, 0}},
-- БМ аое петом
{spellId = 118455, size = 32, unitId = "pet", isMine = "1", filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 250, 40}},
-- Аспекты
{spellId = 13159, spellId2 = 13159 , spellId3 = 5118,size = 32, unitId = "player", isMine = "1", filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 180, 80}},
{spellId = 13165, spellId2 = 109260 , size = 32, unitId = "player", isMine = "1", filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 180, 80}},
--Снайпер , Улучшенный ВВ , стаки пета
{spellId = 53220, size = 32, unitId = "player", isMine = "1", filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 215, 80}},
{spellId = 19615, size = 32, unitId = "player", isMine = "1", filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 215, 80}},
-- готовься целься пли ! раж
{spellId = 82925 ,size = 32, unitId = "player", isMine = "1", filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 250, 80}},
--{spellId = 53401, size = 32, unitId = "pet", isMine = "1", filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 250, 80}},
-- ускорялка пета
--{spellId = 61684, size = 32, unitId = "pet", isMine = "1", filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 250, 80}},
-- Толвиры
{spellId = 105697,size = 32, unitId = "player", isMine = "1", filter = "HELPFUL", setPoint = {"CENTER", UIParent, "CENTER", 285, 80}},
},
}
local MyUnits = {
player = true,
vehicle = true,
pet = true,
}
--[[ Options end ]]
local backdrop = {
bgFile = [=[Interface\ChatFrame\ChatFrameBackground]=],
edgeFile = [=[Interface\ChatFrame\ChatFrameBackground]=], edgeSize = 1,
insets = {top = 0, left = 0, bottom = 0, right = 0},
}
local CreateBG = CreateBG or function(parent)
local bg = CreateFrame("Frame", nil, parent)
bg:SetPoint("TOPLEFT", -1, 1)
bg:SetPoint("BOTTOMRIGHT", 1, -1)
bg:SetFrameLevel(parent:GetFrameLevel() - 1)
bg:SetBackdrop(backdrop)
bg:SetBackdropColor(0, 0, 0, 0.5)
bg:SetBackdropBorderColor(0, 0, 0, 1)
return bg
end
local function sFilter_CreateFrame(data)
local spellName, _, spellIcon = GetSpellInfo(data.spellId)
local frame = CreateFrame("Frame", "sFilter_" .. data.unitId .. "_" .. data.spellId, UIParent)
frame:SetWidth(data.size - 2)
frame:SetHeight(data.size - 2)
frame:SetPoint(unpack(data.setPoint))
frame:RegisterEvent("UNIT_AURA")
frame:RegisterEvent("PLAYER_TARGET_CHANGED")
frame:RegisterEvent("PLAYER_ENTERING_WORLD")
frame:SetScript("OnEvent", function(self, event, ...)
local unit = ...
if(data.unitId==unit or event=="PLAYER_TARGET_CHANGED" or event=="PLAYER_ENTERING_WORLD") then
self.found = false
self:SetAlpha(1)
for i=1, 40 do
local name, rank, icon, count, debuffType, duration, expirationTime, caster, isStealable = UnitAura(data.unitId, i, data.filter)
if(name and (data.isMine~=1 or MyUnits[caster]) and (name==GetSpellInfo(data.spellId) or (data.spellId2 and name==GetSpellInfo(data.spellId2)) or (data.spellId3 and name==GetSpellInfo(data.spellId3)))) then
self.found = true
self.icon:SetTexture(icon)
self.count:SetText(count>1 and count or "")
if(duration>0) then
self.cooldown:Show()
CooldownFrame_SetTimer(self.cooldown, expirationTime-duration, duration, 1)
else
self.cooldown:Hide()
end
break
end
end
if(not self.found) then
self:SetAlpha(0)
self.icon:SetTexture(spellIcon)
self.count:SetText("")
self.cooldown:Hide()
end
end
if(configmode==true) then
self:SetAlpha(1)
self.count:SetText(9)
end
end)
if(configmode==true) then
frame:SetMovable(true)
frame:EnableMouse(true)
frame:RegisterForDrag("LeftButton", "RightButton")
frame:SetScript("OnMouseDown", function(self)
if(arg1=="LeftButton") then
if(IsShiftKeyDown() or IsAltKeyDown()) then
self:StartMoving()
end
else
self:ClearAllPoints()
self:SetPoint(unpack(data.setPoint))
end
end)
frame:SetScript("OnMouseUp", function(self)
self:StopMovingOrSizing()
if(arg1=="LeftButton") then
local x, y = self:GetCenter()
print(format("|cffff00ffs|rFilter: setPoint for %s (%s): {\"%s\", UIParent, \"%s\", %s, %s}", data.spellId, spellName, "CENTER", "BOTTOMLEFT", floor(x + 0.5), floor(y + 0.5)))
end
end)
end
frame.icon = frame:CreateTexture("$parentIcon", "OVERLAY")
frame.icon:SetAllPoints()
frame.icon:SetTexture(spellIcon)
frame.icon:SetTexCoord(0.07, 0.93, 0.07, 0.93)
frame.count = frame:CreateFontString(nil, "OVERLAY")
frame.count:SetFont("Fonts\\FRIZQT__.TTF", FontSize, "OUTLINE")
frame.count:SetTextColor(r, g, b)
frame.count:SetPoint(unpack(CountPoint))
frame.count:SetJustifyH("CENTER")
frame.cooldown = CreateFrame("Cooldown", nil, frame, "CooldownFrameTemplate")
frame.cooldown:SetPoint("TOPLEFT")
frame.cooldown:SetPoint("BOTTOMRIGHT")
frame.cooldown:SetReverse()
frame.bg = CreateBG(frame)
end
local class = select(2, UnitClass("player"))
if(sFilter_Spells and sFilter_Spells[class]) then
for index in pairs(sFilter_Spells) do
if(index~=class) then
sFilter_Spells[index] = nil
end
end
for i=1, #sFilter_Spells[class], 1 do
sFilter_CreateFrame(sFilter_Spells[class]
)
end
end