Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 13th, 2012  |  syntax: None  |  size: 4.00 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.  
  2. -- CheckBuffs() -- Check if the player needs a buff when we receive certain events
  3. function SelfBuffReminder:CheckBuffs(event, arg1, ...)
  4.  
  5.         -- Don't show reminders under certain circumstances
  6.         if not inCombat or (inBG and not self.db.char.pvp) or IsFlying() or UnitOnTaxi("player") then
  7.                 self:HideReminder()
  8.                 return
  9.         end
  10.        
  11.         self:HideReminder()
  12.  
  13.        
  14.         -- Warrior shouts
  15.         if className == "WARRIOR" and UnitPower("player", SPELL_POWER_RAGE) >= 10 then
  16.        
  17.                 -- Shouts
  18.                 if playerLevel >= 20 and not self:FindBuff(buffList["AP"]) and not self:FindBuff(buffList["Fort"]) and not self:IsOnCooldown("Battle Shout") then
  19.                         self:ShowReminder("Cast a Shout!")
  20.                 end
  21.                        
  22.         -- Death knight buffs
  23.         elseif className == "DEATHKNIGHT" then
  24.        
  25.                 -- Presences
  26.                 if not self:FindBuff("Blood Presence") and not self:FindBuff("Blood Presence") and not self:FindBuff("Blood Presence") then
  27.                         self:ShowReminder("Cast a Presence!")
  28.                         return
  29.                 end
  30.                
  31.                 -- Horn of Winter
  32.                 if playerLevel >= 65 and not self:FindBuff(buffList["AP"]) then
  33.                         self:ShowReminder("Cast Horn of Winter!")
  34.                         return
  35.                 end
  36.                
  37.         -- Priest buffs
  38.         elseif className == "PRIEST" then
  39.        
  40.                 -- Inner Fire/Will
  41.                 if playerLevel >= 7 and not self:FindBuff("Inner Fire") and not self:FindBuff("Inner Will") then
  42.                         self:ShowReminder("Cast Inner Fire!")
  43.                         return
  44.                 end
  45.                
  46.                 -- Power Word: Fortitude
  47.                 if playerLevel >= 14 and not self:FindBuff(buffList["Fort"]) then
  48.                         self:ShowReminder("Cast Power Word: Fortitude!")
  49.                         return
  50.                 end
  51.                
  52.                 -- Shadow Protection
  53.                 if playerLevel >= 52 and not self:FindBuff("Shadow Protection") then
  54.                         self:ShowReminder("Cast Shadow Protection!")
  55.                         return
  56.                 end
  57.        
  58.         -- Warlock buffs
  59.         elseif className == "WARLOCK" then
  60.        
  61.                 -- Warlock Armor
  62.                 if playerLevel >= 8 and not self:FindBuff("Demon Armor") and not self:FindBuff("Fel Armor") then
  63.                         self:ShowReminder("Cast a Warlock Armor!")
  64.                         return
  65.                 end
  66.                
  67.                 -- Soul Link
  68.                 if playerLevel >= 20 and not self:FindBuff("Soul Link") then
  69.                         self:ShowReminder("Cast Soul Link!")
  70.                         return
  71.                 end            
  72.        
  73.         -- Mage buffs
  74.         elseif className == "MAGE" then
  75.        
  76.                 -- Arcane Intellect
  77.                 if playerLevel >= 58 and not self:FindBuff("Arcane Brilliance") and not self:FindBuff("Dalaran Brilliance") then
  78.                         self:ShowReminder("Cast Arcane Brilliance!")
  79.                         return
  80.                 end
  81.                
  82.                 -- Mage armor
  83.                 if playerLevel >= 35 and not self:FindBuff("Molten Armor") and not self:FindBuff("Mage Armor") and not self:FindBuff("Frost Armor") then
  84.                         self:ShowReminder("Cast a Mage Armor!")
  85.                         return
  86.                 end
  87.                
  88.         -- Shaman buffs
  89.         elseif className == "SHAMAN" then
  90.        
  91.                 -- Weapon enchants (windfury, flame tongue, etc..)
  92.                 if self.db.char.weapon then
  93.                         mainHandEnchant, _, _, offHandEnchant = GetWeaponEnchantInfo()
  94.                         if not mainHandEnchant or not offHandEnchant then
  95.                                 self:ShowReminder("Apply Weapon Enchant!")
  96.                                 return
  97.                         end
  98.                 end
  99.                
  100.                 -- Shields
  101.                 if playerLevel >= 8 and not self:FindBuff("Earth Shield") and not self:FindBuff("Lightning Shield") and not self:FindBuff("Water Shield") then
  102.                         self:ShowReminder("Cast a Shaman Shield!")
  103.                         return
  104.                 end
  105.        
  106.         -- Rogue buffs
  107.         elseif className == "ROGUE" then
  108.        
  109.                 -- Poisons
  110.                 if self.db.char.weapon then
  111.                         mainHandEnchant, _, _, offHandEnchant = GetWeaponEnchantInfo()
  112.                         if not mainHandEnchant or not offHandEnchant then
  113.                                 self:ShowReminder("Apply Poisons!")
  114.                                 return
  115.                         end
  116.                 end
  117.                
  118.         -- Paladin buffs
  119.         elseif className == "PALADIN" then
  120.        
  121.                 -- Blessing of Kings/Might
  122.                 if playerLevel >= 22 and not self:FindBuff(buffList["Kings"]) and not self:FindBuff("Blessing of Might") then
  123.                         self:ShowReminder("Cast a Blessing!")
  124.                         return
  125.                 end
  126.                
  127.                 -- Righteous Fury
  128.                 if playerLevel >= 12 and GetPrimaryTalentTree() == 2 and not self:FindBuff("Righteous Fury") then
  129.                         self:ShowReminder("Cast Righteous Fury!")
  130.                 end
  131.        
  132.         -- Druid buffs
  133.         elseif className == "DRUID" then
  134.        
  135.                 -- Mark of the Wild
  136.                 if playerLevel >= 30 and not self:FindBuff(buffList["Kings"]) then
  137.                         self:ShowReminder("Cast Mark of the Wild!")
  138.                         return
  139.                 end
  140.         end
  141. end