Advertisement
Guest User

Untitled

a guest
Mar 13th, 2014
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 13.06 KB | None | 0 0
  1. local MAJOR, MINOR = 'KuiSpellList-1.0', 5
  2. local KuiSpellList = LibStub:NewLibrary(MAJOR, MINOR)
  3. local _
  4.  
  5. if not KuiSpellList then
  6.     -- already registered
  7.     return
  8. end
  9.  
  10. local listeners = {}
  11. local whitelist = {
  12. --[[ Important spells ----------------------------------------------------------
  13.     Target auras which the player needs to keep track of.
  14.  
  15.     -- LEGEND --
  16.     gp = guaranteed passive
  17.     nd = no damage
  18.     td = tanking dot
  19.     ma = modifies another ability when active
  20. ]]
  21.     DRUID = { -- 5.2 COMPLETE
  22.         [770] = true, -- faerie fire
  23.         [1079] = true, -- rip
  24.         [1822] = true, -- rake
  25.         [8921] = true, -- moonfire
  26.         [9007] = true, -- pounce bleed
  27.         [77758] = true, -- bear thrash; td ma
  28.         [106830] = true, -- cat thrash
  29.         [93402] = true, -- sunfire
  30.         [33745] = true, -- lacerate
  31.         [102546] = true, -- pounce
  32.        
  33.         [339] = true, -- entangling roots
  34.         [2637] = true, -- hibernate
  35.         [6795] = true, -- growl
  36.         [16914] = true, -- hurricane
  37.         [19975] = true, -- nature's grasp roots
  38.         [22570] = true, -- maim
  39.         [33786] = true, -- cyclone
  40.         --[58180] = true, -- infected wounds; gp nd
  41.         [78675] = true, -- solar beam silence
  42.         [102795] = true, -- bear hug
  43.  
  44.         [1126] = true, -- mark of the wild
  45.         [29166] = true, -- innervate
  46.         [110309] = true, -- symbiosis
  47.  
  48.         [774] = true, -- rejuvenation
  49.         [8936] = true, -- regrowth
  50.         [33763] = true, -- lifebloom
  51.         [48438] = true, -- wild growth
  52.         [102342] = true, -- ironbark
  53.  
  54.         -- talents
  55.         --[16979] = true, -- wild charge: bear; gp nd
  56.         --[49376] = true, -- wild charge: cat; gp nd
  57.         [102351] = true, -- cenarion ward
  58.         [102355] = true, -- faerie swarm
  59.         [102359] = true, -- mass entanglement
  60.         [61391] = true, -- typhoon daze
  61.         [99] = true, -- disorienting roar
  62.         [5211] = true, -- mighty bash
  63.        
  64.         [50613] = true, -- arcane torrent
  65.         [20549] = true, -- war stone
  66.         [107079] = true, -- quaking palm
  67.         [146198] = true, -- legendary cloak
  68.     },
  69.     HUNTER = { -- 5.2 COMPLETE
  70.         [1130] = true, -- hunter's mark
  71.         [3674] = true, -- black arrow
  72.         [53301] = true, -- explosive shot
  73.         [63468] = true, -- piercing shots
  74.         [118253] = true, -- serpent sting
  75.  
  76.         [5116] = true, -- concussive shot
  77.         [19503] = true, -- scatter shot
  78.         [20736] = true, -- distracting shot
  79.         [24394] = true, -- intimidation
  80.         [35101] = true, -- concussive barrage
  81.         [64803] = true, -- entrapment
  82.         [82654] = true, -- widow venom
  83.         [131894] = true, -- murder by way of crow
  84.  
  85.         [3355] = true, -- freezing trap
  86.         [13812] = true, -- explosive trap
  87.         [135299] = true, -- ice trap TODO isn't classed as caused by player
  88.  
  89.         [34477] = true, -- misdirection
  90.  
  91.         -- talents
  92.         [136634] = true, -- narrow escape
  93.         [34490] = true, -- silencing shot
  94.         [19386] = true, -- wyvern sting
  95.         [117405] = true, -- binding shot
  96.         [117526] = true, -- binding shot stun
  97.         [120761] = true, -- glaive toss slow
  98.         [121414] = true, -- glaive toss slow 2
  99.     },
  100.     MAGE = { -- 5.2 COMPLETE
  101.         [116] = true, -- frostbolt debuff
  102.         [11366] = true, -- pyroblast
  103.         [12654] = true, -- ignite
  104.         [31589] = true, -- slow
  105.         [83853] = true, -- combustion
  106.         [132210] = true, -- pyromaniac
  107.        
  108.         [118] = true, -- polymorph
  109.         [28271] = true, -- polymorph: turtle
  110.         [28272] = true, -- polymorph: pig
  111.         [61305] = true, -- polymorph: cat
  112.         [61721] = true, -- polymorph: rabbit
  113.         [61780] = true, -- polymorph: turkey
  114.         [44572] = true, -- deep freeze
  115.    
  116.         [1459] = true, -- arcane brilliance
  117.        
  118.         -- talents
  119.         [111264] = true, -- ice ward
  120.         [114923] = true, -- nether tempest
  121.         [44457] = true, -- living bomb
  122.         [112948] = true, -- frost bomb
  123.        
  124.         [50613] = true, -- arcane torrent
  125.         [20549] = true, -- war stone
  126.         [107079] = true, -- quaking palm
  127.         [146198] = true, -- legendary cloak
  128.     },
  129.     DEATHKNIGHT = { -- 5.2 COMPLETE
  130.         [55095] = true, -- frost fever
  131.         [55078] = true, -- blood plague
  132.         [114866] = true, -- soul reaper
  133.  
  134.         [43265] = true, -- death and decay
  135.         [45524] = true, -- chains of ice
  136.         [49560] = true, -- death grip taunt
  137.         [50435] = true, -- chillblains
  138.         [56222] = true, -- dark command    
  139.         [108194] = true, -- asphyxiate stun
  140.        
  141.         [3714] = true, -- path of frost
  142.         [57330] = true, -- horn of winter
  143.  
  144.         -- talents
  145.         [115000] = true, -- remorseless winter slow
  146.         [115001] = true, -- remorseless winter stun
  147.        
  148.         [50613] = true, -- arcane torrent
  149.         [20549] = true, -- war stone
  150.         [107079] = true, -- quaking palm
  151.     },
  152.     WARRIOR = { -- 5.2 COMPLETE
  153.         [86346] = true,  -- colossus smash
  154.         [113746] = true, -- weakened armour
  155.  
  156.         [355] = true,    -- taunt
  157.         [676] = true,    -- disarm
  158.         [1160] = true,   -- demoralizing shout
  159.         [1715] = true,   -- hamstring
  160.         [5246] = true,   -- intimidating shout
  161.         [7922] = true,   -- charge stun
  162.         [18498] = true,  -- gag order
  163.         [64382] = true,  -- shattering throw
  164.         [115767] = true, -- deep wounds; td
  165.         [137637] = true, -- warbringer slow
  166.        
  167.         [469] = true,    -- commanding shout
  168.         [3411] = true,   -- intervene
  169.         [6673] = true,   -- battle shout
  170.        
  171.                          -- talents
  172.         [12323] = true,  -- piercing howl
  173.         [107566] = true, -- staggering shout
  174.         [132168] = true, -- shockwave debuff
  175.         [114029] = true, -- safeguard
  176.         [114030] = true, -- vigilance
  177.         [113344] = true, -- bloodbath debuff
  178.         [132169] = true, -- storm bolt debuff
  179.        
  180.         [50613] = true, -- arcane torrent
  181.         [20549] = true, -- war stone
  182.         [107079] = true, -- quaking palm
  183.     },
  184.     PALADIN = { -- 5.2 COMPLETE
  185.         [114163] = true, -- eternal flame
  186.         [53563] = { colour = {1,.5,0} },  -- beacon of light
  187.         [20925] = { colour = {1,1,.3} },  -- sacred shield
  188.        
  189.         [19740] = { colour = {.2,.2,1} }, -- blessing of might
  190.         [20217] = { colour = {1,.3,.3} }, -- blessing of kings
  191.        
  192.         [26573] = true,  -- consecration; td
  193.         [31803] = true,  -- censure; td
  194.        
  195.                          -- hand of...
  196.         [114039] = true, -- purity
  197.         [6940] = true,   -- sacrifice
  198.         [1044] = true,   -- freedom
  199.         [1038] = true,   -- salvation
  200.         [1022] = true,   -- protection
  201.        
  202.         [853] = true,    -- hammer of justice
  203.         [2812] = true,   -- denounce
  204.         [10326] = true,  -- turn evil
  205.         [20066] = true,  -- repentance
  206.         [31935] = true,  -- avenger's shield silence
  207.         [62124] = true,  -- reckoning
  208.         [105593] = true, -- fist of justice
  209.         [119072] = true, -- holy wrath stun
  210.  
  211.         [114165] = true, -- holy prism
  212.         [114916] = true, -- execution sentence dot
  213.         [114917] = true, -- stay of execution hot
  214.        
  215.         [50613] = true, -- arcane torrent
  216.         [20549] = true, -- war stone
  217.         [107079] = true, -- quaking palm
  218.     },
  219.     WARLOCK = { -- 5.2 COMPLETE
  220.         [5697]  = true,  -- unending breath
  221.         [20707]  = true, -- soulstone
  222.         [109773] = true, -- dark intent
  223.    
  224.         [172] = true,    -- corruption, demo. version
  225.         [146739] = true, -- corruption
  226.         [114790] = true,  -- Soulburn: Seed of Corruption
  227.         [348] = true,    -- immolate
  228.         [108686] = true, -- immolate (aoe)
  229.         [980] = true,    -- agony
  230.         [27243] = true,  -- seed of corruption
  231.         [30108] = true,  -- unstable affliction
  232.         [47960] = true,  -- shadowflame
  233.         [48181] = true,  -- haunt
  234.         [80240] = true,  -- havoc
  235.        
  236.         [1490] = true,   -- curse of the elements
  237.         [18223] = true,  -- curse of exhaustion
  238.         [109466] = true, -- curse of enfeeblement
  239.        
  240.         [710] = true,    -- banish
  241.         [1098] = true,   -- enslave demon
  242.         [5782] = true,   -- fear
  243.  
  244.                          -- metamorphosis:
  245.         [603] = true,    -- doom
  246.         [124915] = true, -- chaos wave
  247.         [116202] = true, -- aura of the elements
  248.         [116198] = true, -- aura of enfeeblement
  249.        
  250.                          -- talents:
  251.         [5484] = true,   -- howl of terror
  252.         [111397] = true, -- blood fear
  253.        
  254.         [50613] = true, -- arcane torrent
  255.         [20549] = true, -- war stone
  256.         [107079] = true, -- quaking palm
  257.         [146198] = true, -- legendary cloak
  258.     },
  259.     SHAMAN = { -- 5.2 COMPLETE
  260.         [8050] = true,   -- flame shock
  261.         [8056] = true,   -- frost shock slow
  262.         [63685] = true,  -- frost shock root
  263.         [51490] = true,  -- thunderstorm slow
  264.         [17364] = true,  -- stormstrike
  265.         [61882] = true,  -- earthquake
  266.        
  267.         [3600] = true,   -- earthbind totem passive
  268.         [64695] = true,   -- earthgrap totem root
  269.         [116947] = true,   -- earthgrap totem slow
  270.  
  271.         [546] = true,    -- water walking
  272.         [974] = true,    -- earth shield
  273.         [51945] = true,  -- earthliving
  274.         [61295] = true,  -- riptide
  275.        
  276.         [51514] = true,  -- hex
  277.         [76780] = true,  -- bind elemental
  278.        
  279.         [50613] = true, -- arcane torrent
  280.         [20549] = true, -- war stone
  281.         [107079] = true, -- quaking palm
  282.         [146198] = true, -- legendary cloak
  283.     },
  284.     PRIEST = { -- 5.2 COMPLETE
  285.         [139] = true,    -- renew
  286.         [6346] = true,   -- fear ward
  287.         [33206] = true,  -- pain suppression
  288.         [41635] = true,  -- prayer of mending buff
  289.         [47753] = true,  -- divine aegis
  290.         [47788] = true,  -- guardian spirit
  291.         [114908] = true, -- spirit shell shield
  292.        
  293.         [17] = true,     -- power word: shield
  294.         [21562] = true,  -- power word: fortitude
  295.    
  296.         [2096] = true,   -- mind vision
  297.         [8122] = true,   -- psychic scream
  298.         [9484] = true,   -- shackle undead
  299.         [64044] = true,  -- psychic horror
  300.         [111759] = true, -- levitate
  301.        
  302.         [589] = true,    -- shadow word: pain
  303.         [2944] = true,   -- devouring plague
  304.         [14914] = true,  -- holy fire
  305.         [34914] = true,  -- vampiric touch
  306.        
  307.                          -- talents:
  308.         [605] = true,    -- dominate mind
  309.         [114404] = true, -- void tendril root
  310.         [113792] = true, -- psychic terror
  311.        
  312.         [50613] = true, -- arcane torrent
  313.         [20549] = true, -- war stone
  314.         [107079] = true, -- quaking palm
  315.         [146198] = true, -- legendary cloak
  316.     },
  317.     ROGUE = { -- 5.2 COMPLETE
  318.         [703] = true,    -- garrote
  319.         [1943] = true,   -- rupture
  320.         [79140] = true,  -- vendetta
  321.         [84617] = true,  -- revealing strike
  322.         [89775] = true,  -- hemorrhage
  323.         [113746] = true, -- weakened armour
  324.         [122233] = true, -- crimson tempest
  325.  
  326.         [2818] = true,   -- deadly poison
  327.         [3409] = true,   -- crippling poison
  328.         [115196] = true, -- debilitating poison
  329.         [5760] = true,   -- mind numbing poison
  330.         [115194] = true, -- mind paralysis
  331.         [8680] = true,   -- wound poison
  332.  
  333.         [408] = true,    -- kidney shot
  334.         [1776] = true,   -- gouge
  335.         [1833] = true,   -- cheap shot
  336.         [2094] = true,   -- blind
  337.         [6770] = true,   -- sap
  338.         [26679] = true,  -- deadly throw
  339.         [51722] = true,  -- dismantle
  340.         [88611] = true,  -- smoke bomb
  341.  
  342.         [57934] = true,  -- tricks of the trade
  343.  
  344.                          -- talents:
  345.         [112961] = true, -- leeching poison
  346.         [113952] = true, -- paralytic poison
  347.         [113953] = true, -- paralysis
  348.         [115197] = true, -- partial paralysis
  349.         [137619] = true, -- marked for death
  350.        
  351.         [50613] = true, -- arcane torrent
  352.         [20549] = true, -- war stone
  353.         [107079] = true, -- quaking palm
  354.     },
  355.     MONK = { -- 5.2 COMPLETE
  356.         [116189] = true, -- provoke taunt
  357.         [116330] = true, -- dizzying haze debuff
  358.         [123727] = true, -- keg smash - dizzying haze debuff
  359.         [123725] = true, -- breath of fire
  360.         [120086] = true, -- fists of fury stun
  361.         [122470] = true, -- touch of karma
  362.         [128531] = true, -- blackout kick debuff
  363.         [130320] = true, -- rising sun kick debuff
  364.  
  365.         [116781] = true, -- legacy of the white tiger
  366.         [116844] = true, -- ring of peace
  367.         [117666] = true, -- legacy of the emperor group
  368.         [117667] = true, -- legacy of the emperor target (um.)
  369.        
  370.         [116849] = true, -- life cocoon
  371.         [132120] = true, -- enveloping mist
  372.         [119611] = true, -- renewing mist
  373.        
  374.         [117368] = true, -- grapple weapon
  375.         [116095] = true, -- disable
  376.         [115078] = true, -- paralysis
  377.    
  378.                          -- talents:
  379.         [116841] = true, -- tiger's lust
  380.         [124081] = true, -- zen sphere
  381.         [119392] = true, -- charging ox wave
  382.         [119381] = true, -- leg sweep
  383.        
  384.         [50613] = true, -- arcane torrent
  385.         [20549] = true, -- war stone
  386.         [107079] = true, -- quaking palm
  387.     },
  388. -- Important auras regardless of caster (cc, flags...) -------------------------
  389. --[[
  390.     Global = {
  391.         -- PVP --
  392.         [34976] = true, -- Netherstorm Flag
  393.         [23335] = true, -- Alliance Flag
  394.         [23333] = true, -- Horde Flag
  395.     },
  396. ]]
  397. }
  398.  
  399. KuiSpellList.RegisterChanged = function(table, method)
  400.     -- register listener for whitelist updates
  401.     tinsert(listeners, { table, method })
  402. end
  403.  
  404. KuiSpellList.WhitelistChanged = function()
  405.     -- inform listeners of whitelist update
  406.     for _,listener in ipairs(listeners) do
  407.         if (listener[1])[listener[2]] then
  408.             (listener[1])[listener[2]]()
  409.         end
  410.     end
  411. end
  412.  
  413. KuiSpellList.GetDefaultSpells = function(class)
  414.     -- get spell list, ignoring KuiSpellListCustom
  415.     local list = {}
  416.  
  417.     -- return a copy of the list rather than a reference
  418.     for spellid,_ in pairs(whitelist[class]) do
  419.         list[spellid] = true
  420.     end
  421.  
  422.     return list
  423. end
  424.  
  425. KuiSpellList.GetImportantSpells = function(class)
  426.     -- get spell list and merge with KuiSpellListCustom if it is set
  427.     local list = KuiSpellList.GetDefaultSpells(class)
  428.  
  429.     if KuiSpellListCustom then
  430.         if KuiSpellListCustom.Ignore and
  431.            KuiSpellListCustom.Ignore[class]
  432.         then
  433.             -- remove ignored spells
  434.             for spellid,_ in pairs(KuiSpellListCustom.Ignore[class]) do
  435.                 list[spellid] = nil
  436.             end
  437.         end
  438.  
  439.         if KuiSpellListCustom.Classes and
  440.            KuiSpellListCustom.Classes[class]
  441.         then
  442.             -- merge custom added spells
  443.             for spellid,_ in pairs(KuiSpellListCustom.Classes[class]) do
  444.                 list[spellid] = true
  445.             end
  446.         end
  447.     end
  448.  
  449.     return list
  450. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement