Advertisement
Guest User

Untitled

a guest
Dec 28th, 2011
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 23.33 KB | None | 0 0
  1. --[[ my notes
  2.  
  3. SET gxApi "d3d11"
  4.  
  5. grounding totem similar to reflect
  6. killing blow for warr only
  7. display what my intervene takes
  8. revenge stun proc, warlock nightfall glyph
  9. imp hs, hs glyph
  10. warlock eradication (spell haste)
  11. druid aoe taunt and dk/pal taunt etc
  12. mage spell steal like sham purge
  13. 2 diff type of dispell resists
  14.  
  15. warnings on adrenaline rush
  16. reckless
  17. shield wall
  18. retal if rogue
  19.  
  20. 3/13 13:54:39.633  UNIT_DIED,0x0000000000000000,nil,0x80000000,0xF13000172504787F,"Grounding Totem",0x2111
  21. totem dying, add totem stomp warnings for all diff events
  22.  
  23. spell reflects on others, intervenes
  24.  
  25. --]]
  26.  
  27.  
  28. function SpellNotifications_OnLoad(self)
  29. _,SpellNotifications_Class = UnitClass("player");
  30. self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");
  31. self:RegisterEvent("UNIT_HEALTH");
  32. self:RegisterEvent("PLAYER_TARGET_CHANGED");
  33. self:RegisterEvent("PLAYER_REGEN_DISABLED"); -- enter combat
  34. self:RegisterEvent("PLAYER_REGEN_ENABLED"); -- leave combat
  35. self:RegisterEvent("PLAYER_ENTERING_WORLD");
  36. end
  37.  
  38. function SpellNotifications_OnEvent(event,...)
  39.  
  40. --[[
  41. if event=="PLAYER_ENTERING_WORLD" then
  42.     COMBAT_TEXT_TYPE_INFO["PERIODIC_HEAL"].show = nil;
  43.     COMBAT_TEXT_TYPE_INFO["HEAL_CRIT"].show = nil;
  44.     COMBAT_TEXT_TYPE_INFO["HEAL"].show = nil;
  45.     COMBAT_TEXT_TYPE_INFO["DAMAGE_CRIT"].show = nil;
  46.     COMBAT_TEXT_TYPE_INFO["DAMAGE"].show = nil;
  47.     COMBAT_TEXT_TYPE_INFO["SPELL_DAMAGE"].show = nil;
  48.     COMBAT_TEXT_TYPE_INFO["SPELL_DAMAGE_CRIT"].show = nil;
  49.     COMBAT_TEXT_TYPE_INFO["HEAL_ABSORB"].show = nil;
  50.     COMBAT_TEXT_TYPE_INFO["PERIODIC_HEAL_ABSORB"].show = nil;
  51.     COMBAT_TEXT_TYPE_INFO["HEAL_CRIT_ABSORB"].show = nil;
  52. end
  53. --]]
  54.  
  55.  
  56. local timestamp, type, sourceGUID, sourceName, hideCaster, sourceFlags, destGUID, destName, destFlags = select(1,...)
  57. --        1        2         3           4           5           6           7         8          9
  58.  
  59. if type=="SPELL_CAST_SUCCESS" or type=="SPELL_AURA_REMOVED" then
  60.     if bit.band(sourceFlags, COMBATLOG_OBJECT_AFFILIATION_MINE) > 0 then
  61.         local spellName = select(11,...)
  62.         if spellName=="Abolish Poison" or spellName=="Abolish Disease" then
  63.             if type=="SPELL_CAST_SUCCESS" then
  64.                 SpellNotifications_Abolished[destName] = true
  65.             else
  66.                 SpellNotifications_Abolished[destName] = false
  67.             end
  68.         end
  69.     end
  70. end
  71.  
  72. if (type=="SPELL_DISPEL") then
  73.     local spellName,_,_,extraSpellName = select(11,...)
  74.     if spellName=="Abolish Poison" or spellName=="Abolish Disease" then
  75.         if SpellNotifications_Abolished[destName] ~= nil then
  76.             if SpellNotifications_Abolished[destName] then
  77.                 if bit.band(destFlags, COMBATLOG_OBJECT_REACTION_FRIENDLY) > 0 then
  78.                     SpellNotifications_DisplaySmall("Dispelled "..extraSpellName..".","white") -- friendly target
  79.                     --SendChatMessage("Dispelled "..extraSpellName..".", "PARTY");
  80.                 end
  81.             end
  82.         end
  83.     end
  84. end
  85.  
  86. if (type=="SPELL_DISPEL") then
  87.     if bit.band(sourceFlags, COMBATLOG_OBJECT_AFFILIATION_MINE) > 0 then
  88.         local spellName,_,_,extraSpellName = select(11,...)
  89.         if spellName~="Abolish Poison" and spellName~="Abolish Disease" then
  90.             if bit.band(destFlags, COMBATLOG_OBJECT_REACTION_FRIENDLY) > 0 then
  91.                 SpellNotifications_DisplaySmall("Dispelled "..extraSpellName..".","white") -- friendly target
  92.                 --SendChatMessage("Dispelled "..extraSpellName..".", "PARTY");
  93.             else
  94.                 SpellNotifications_DisplaySmall("Dispelled "..extraSpellName..".","yellow") -- enemy target
  95.                 --SendChatMessage("Dispelled "..extraSpellName..".", "PARTY");
  96.             end
  97.         end
  98.     end
  99. end
  100.  
  101. if (type=="SPELL_STOLEN") then
  102.     if bit.band(sourceFlags, COMBATLOG_OBJECT_AFFILIATION_MINE) > 0 then
  103.         local spellName,_,_,extraSpellName = select(11,...)
  104.         SpellNotifications_DisplaySmall("Stole "..extraSpellName..".","yellow") -- enemy target
  105.     end
  106. end
  107.  
  108. if (type=="SPELL_DAMAGE") then
  109.     if bit.band(sourceFlags, COMBATLOG_OBJECT_AFFILIATION_MINE) > 0 then
  110.         local spellName = select(11,...)
  111.         if (spellName=="Unfair Advantage") then
  112.             SpellNotifications_PlaySound("cling")
  113.         end
  114.     end
  115. end
  116.  
  117. --1/23 12:17:59.705  SPELL_AURA_REMOVED,0x0500000003581096,"Cowpun",0x511,0x0500000003581096,"Cowpun",0x511,49281,"Lightning Shield",0x8,BUFF
  118. if (type=="SPELL_AURA_REMOVED") then
  119.     if bit.band(sourceFlags, COMBATLOG_OBJECT_AFFILIATION_MINE) > 0 then
  120.         local spellName = select(11,...)
  121.         if (spellName=="Lightning Shield") then
  122.             SpellNotifications_PlaySound("buzz")
  123.         end
  124.     end
  125. end
  126.  
  127. if (type=="SPELL_AURA_APPLIED") or (type=="SPELL_AURA_APPLIED_DOSE") or (type=="SPELL_EXTRA_ATTACKS") then
  128.     if bit.band(destFlags, COMBATLOG_OBJECT_AFFILIATION_MINE) > 0 then
  129.         local spellId,spellName = select(10,...)
  130.         if (type=="SPELL_AURA_APPLIED_DOSE") then
  131.             amount = select(14,...)
  132.         end
  133.        
  134.         --Death Knight
  135.         if (spellName=="Killing Machine") then
  136.             --SpellNotifications_DisplayBig("Killing Machine!","green") -- or say icy touch maybe
  137.             --SpellNotifications_PlaySound("cling")
  138.         elseif (spellName=="Freezing Fog") then
  139.             SpellNotifications_DisplayBig("Howling Blast!","blue")
  140.             SpellNotifications_PlaySound("ding")
  141.         elseif (spellName=="Death Trance!") then
  142.             SpellNotifications_DisplayBig("Death Coil!","green")
  143.             SpellNotifications_PlaySound("ding")
  144.        
  145.         --Druid
  146.         elseif (spellId==48517) then
  147.             SpellNotifications_DisplayBig("Wrath!","green")
  148.             SpellNotifications_PlaySound("ding")
  149.         elseif (spellId==48518) or (spellName=="Wrath of Elune") then
  150.             SpellNotifications_DisplayBig("Starfire!","green")
  151.             SpellNotifications_PlaySound("ding")
  152.         elseif (spellName=="Nature's Grace") then
  153.             SpellNotifications_PlaySound("cling")
  154.         elseif (spellName=="Clearcasting") and (SpellNotifications_Class=="DRUID") then
  155.             --SpellNotifications_DisplayBig("Clearcast!","green")
  156.             --SpellNotifications_PlaySound("ding")
  157.        
  158.         --Hunter
  159.         elseif (spellName=="Lock and Load") then
  160.             SpellNotifications_DisplayBig("Arcane Shot!","green") -- maybe say lock n load for explosive shot also
  161.             SpellNotifications_PlaySound("ding")
  162.        
  163.         --Mage
  164.         elseif (spellName=="Clearcasting") and (SpellNotifications_Class=="MAGE") then
  165.             --SpellNotifications_DisplayBig("Clearcast!","green")
  166.             --SpellNotifications_PlaySound("cling")
  167.         elseif (spellName=="Fingers of Frost") then
  168.             --SpellNotifications_DisplayBig("Fingers of Frost!","blue")
  169.             SpellNotifications_PlaySound("cling")
  170.         elseif (spellName=="Fireball!") then
  171.             --SpellNotifications_DisplayBig("Fireball!","orange")
  172.             --SpellNotifications_PlaySound("ding")
  173.         elseif (spellName=="Firestarter") then
  174.             SpellNotifications_DisplayBig("Flamestrike!","orange")
  175.             SpellNotifications_PlaySound("ding")
  176.         elseif (spellName=="Hot Streak") then
  177.             SpellNotifications_DisplayBig("Pyroblast!","orange")
  178.             SpellNotifications_PlaySound("ding")
  179.         elseif (spellName=="Missile Barrage") then
  180.             --SpellNotifications_DisplayBig("Arcane Missiles!","green")
  181.             --SpellNotifications_PlaySound("ding")
  182.        
  183.         --Paladin
  184.        
  185.         --Priest
  186.        
  187.         --Rogue
  188.         elseif (spellName=="Sword Specialization") or (spellName=="Hand of Justice") or (string.find(spellName,"Thrash")) then
  189.             SpellNotifications_PlaySound("cling")
  190.        
  191.         --Shaman
  192.         elseif (spellName=="Maelstrom Weapon") and (amount==5) and (type=="SPELL_AURA_APPLIED_DOSE") then
  193.             --SpellNotifications_DisplayBig("Maelstrom!","green")
  194.             SpellNotifications_PlaySound("ding")
  195.        
  196.         --Warlock
  197.         elseif (spellName=="Shadow Trance") then
  198.             --SpellNotifications_DisplayBig("Shadow Bolt!","purple")
  199.             --SpellNotifications_PlaySound("ding")
  200.         elseif (spellName=="Backlash") or (spellName=="Molten Core") then
  201.             SpellNotifications_DisplayBig("Incinerate!","orange")
  202.             SpellNotifications_PlaySound("ding")
  203.        
  204.         --Warrior
  205.         elseif (spellName=="Sword and Board") then
  206.             SpellNotifications_DisplayBig("Shield Slam!","green")
  207.             SpellNotifications_PlaySound("ding")
  208.         elseif (spellName=="Slam!") then
  209.             --SpellNotifications_DisplayBig("Slam!","green")
  210.             --SpellNotifications_PlaySound("ding")
  211.         elseif (spellName=="Sudden Death") then
  212.             --SpellNotifications_DisplayBig("Execute!","green")
  213.             --SpellNotifications_PlaySound("cling")
  214.         elseif spellName=="Taste for Blood" then
  215.             --SpellNotifications_DisplayBig("Overpower!","green")
  216.             --SpellNotifications_PlaySound("ding")
  217.        
  218.         end
  219.     end
  220. end
  221.  
  222. --1/12 20:09:21.644  SPELL_AURA_APPLIED,0x0500000003580F5F,"Veev",0x511,0xF130007F9A002B25,"Expert's Training Dummy",0x10a28,64382,"Shattering Throw",0x1,DEBUFF
  223. if (type=="SPELL_AURA_APPLIED") then
  224.     if bit.band(sourceFlags, COMBATLOG_OBJECT_AFFILIATION_MINE) > 0 then
  225.         local spellName = select(11,...)
  226.         if (spellName=="Improved Hamstring") or (spellName=="Glyph of Hamstring") then
  227.             SpellNotifications_PlaySound("cling")
  228.         end
  229.     end
  230. end
  231.  
  232.  
  233.  
  234. --4/27 18:22:29.177  SPELL_MISSED,0x05000000027EF48C,"Veev",0x511,0x050000000285EB2D,"Valrathlol",0x10548,1715,"Hamstring",0x1,DODGE
  235. --1/12 20:09:21.644  SPELL_AURA_APPLIED,0x0500000003580F5F,"Veev",0x511,0xF130007F9A002B25,"Expert's Training Dummy",0x10a28,64382,"Shattering Throw",0x1,DEBUFF
  236. if (SpellNotifications_Class=="WARRIOR") then
  237.     if (type=="SWING_MISSED") or (type=="SPELL_MISSED") then
  238.         if bit.band(sourceFlags, COMBATLOG_OBJECT_AFFILIATION_MINE) > 0 then
  239.             if (type=="SWING_MISSED") then
  240.                 missType = select(10,...)
  241.             else
  242.                 missType = select(13,...)
  243.             end
  244.             if (missType=="DODGE") then
  245.                 --SpellNotifications_PlaySound("ding")
  246.             end
  247.         end
  248.     elseif type=="SPELL_AURA_APPLIED" then
  249.         if bit.band(sourceFlags, COMBATLOG_OBJECT_AFFILIATION_MINE) > 0 then
  250.             local spellName = select(11,...)
  251.             if (spellName=="Shattering Throw") then
  252.                 --SendChatMessage("Shattering Throw up on "..destName.."!", "YELL");
  253.             end
  254.         end
  255.     end
  256. end
  257.  
  258.  
  259. --3/13 14:00:54.839  SPELL_PERIODIC_DAMAGE,0x000000000280B239,"Vèéx",0x511,0x0000000002967F3C,"Yødå",0x10548,47857,"Drain Life",0x20,414,0,32,46,0,0,nil,nil,nil
  260. --3/13 14:01:00.244  SPELL_PERIODIC_LEECH,0x000000000280B239,"Vèéx",0x511,0x0000000002967F3C,"Yødå",0x10548,5138,"Drain Mana",0x20,389,0,389
  261. if (type=="SPELL_CAST_SUCCESS") or (type=="SPELL_PERIODIC_DAMAGE") then
  262.     if bit.band(sourceFlags, COMBATLOG_OBJECT_AFFILIATION_MINE) > 0 then
  263.         local spellName = select(11,...)
  264.         if (spellName=="Drain Soul") then
  265.             local amount = select(13,...)
  266.             local critical = select(19,...)
  267.             if (type=="SPELL_CAST_SUCCESS") then
  268.                 SpellNotifications_DrainCount = 0
  269.             elseif (type=="SPELL_PERIODIC_DAMAGE") then
  270.                 SpellNotifications_DrainCount = SpellNotifications_DrainCount + 1
  271.                 if (SpellNotifications_DrainColor=="orange") or (SpellNotifications_DrainColor==nil) then
  272.                     SpellNotifications_DrainColor = "blue"
  273.                 elseif (SpellNotifications_DrainColor=="blue") then
  274.                     SpellNotifications_DrainColor = "purple"
  275.                 elseif (SpellNotifications_DrainColor=="purple") then
  276.                     SpellNotifications_DrainColor = "red"
  277.                 elseif (SpellNotifications_DrainColor=="red") then
  278.                     SpellNotifications_DrainColor = "orange"
  279.                 end
  280.                 if critical==1 then
  281.                     SpellNotifications_DisplaySmall(""..amount.."!",SpellNotifications_DrainColor)
  282.                 else
  283.                     SpellNotifications_DisplaySmall(""..amount.."",SpellNotifications_DrainColor)
  284.                 end
  285.                 if (spellName=="Drain Soul") then
  286.                     SpellNotifications_PlaySound("bell")
  287.                 end
  288.             end
  289.         end
  290.     end
  291. end
  292.  
  293. --12/26 19:53:55.151  UNIT_DIED,0x0000000000000000,nil,0x80000000,0xF140A698C50150C4,"Czaafum",0x11111
  294. if (type=="UNIT_DIED") then
  295.     if bit.band(destFlags, COMBATLOG_OBJECT_AFFILIATION_MINE) > 0 then
  296.         if bit.band(destFlags, COMBATLOG_OBJECT_TYPE_PET) > 0 then
  297.             SpellNotifications_DisplayBig("Pet dead.","red")
  298.             SpellNotifications_PlaySound("buzz")
  299.         end
  300.     end
  301. end
  302.    
  303.    
  304.  
  305.  
  306. if (event=="UNIT_HEALTH") then
  307.     if (not SpellNotifications_ExecuteWarn) then
  308.         if (UnitClassification("target")=="worldboss") or (UnitIsPlayer("target")) then
  309.             if (SpellNotifications_Class=="WARLOCK") then
  310.                 if (((UnitHealth("target") / UnitHealthMax("target")) * 100) <= 25) and (UnitHealth("target") > 0) then
  311.                     if (UnitClassification("target")=="worldboss") then
  312.                         RaidNotice_AddMessage(RaidBossEmoteFrame, "Drain Soul!", ChatTypeInfo["RAID_WARNING"])
  313.                         --SpellNotifications_PlaySound("lock_execute")
  314.                         SpellNotifications_PlaySound("laser")
  315.                     else
  316.                         --SpellNotifications_PlaySound("laser")
  317.                     end
  318.                     SpellNotifications_ExecuteWarn = true;
  319.                 end
  320.             end
  321.         end
  322.     end
  323. end
  324.  
  325. if (event=="UNIT_HEALTH") then
  326.     if (not SpellNotifications_ExecuteWarn) then
  327.         if (UnitClassification("target")=="worldboss") or (UnitIsPlayer("target")) then
  328.             if (SpellNotifications_Class=="WARLOCK") then
  329.                 if (((UnitHealth("target") / UnitHealthMax("target")) * 100) > 25) then
  330.                     SpellNotifications_ExecuteWarn = false;
  331.                 end
  332.             end
  333.         end
  334.     end
  335. end
  336.  
  337. if (event=="PLAYER_TARGET_CHANGED") then
  338.     SpellNotifications_ExecuteWarn = false;
  339. end
  340.  
  341.  
  342.  
  343.    
  344. if (type=="SPELL_INTERRUPT") then
  345.     if bit.band(sourceFlags, COMBATLOG_OBJECT_AFFILIATION_MINE) > 0 then
  346.         local extraSchool = select(15,...)
  347.         if (extraSchool==1) then
  348.             SpellSchool = "physical"
  349.         elseif (extraSchool==2) then
  350.             SpellSchool = "holy"
  351.         elseif (extraSchool==4) then
  352.             SpellSchool = "fire"
  353.         elseif (extraSchool==8) then
  354.             SpellSchool = "nature"
  355.         elseif (extraSchool==12) then
  356.             SpellSchool = "firestorm"
  357.         elseif (extraSchool==16) then
  358.             SpellSchool = "frost"
  359.         elseif (extraSchool==20) then
  360.             SpellSchool = "frostfire"
  361.         elseif (extraSchool==24) then
  362.             SpellSchool = "froststorm"
  363.         elseif (extraSchool==32) then
  364.             SpellSchool = "shadow"
  365.         elseif (extraSchool==40) then
  366.             SpellSchool = "shadowstorm"
  367.         elseif (extraSchool==48) then
  368.             SpellSchool = "shadowfrost"
  369.         elseif (extraSchool==64) then
  370.             SpellSchool = "arcane"
  371.         elseif (extraSchool==68) then
  372.             SpellSchool = "spellfire"
  373.         else
  374.             SpellSchool = "unknown spell school"
  375.         end
  376.         if SpellSchool==nil then
  377.             SpellSchool = "unknown spell school"
  378.         end
  379.         SpellNotifications_DisplaySmall("Interrupted "..SpellSchool..".","green")
  380.     end
  381. end
  382.  
  383.  
  384. --4/25 02:32:33.564  SPELL_AURA_APPLIED,0x0500000000284BB9,"Galdin-Black Dragonflight",0x528,0x05000000020F9CC7,"Nerishana-Steamwheedle Cartel",0x514,64850,"Unrelenting Assault",0x1,DEBUFF
  385. if (type=="SPELL_AURA_APPLIED") then
  386.     if bit.band(sourceFlags, COMBATLOG_OBJECT_AFFILIATION_MINE) > 0 then
  387.         local spellName = select(11,...)
  388.         if (spellName=="Unrelenting Assault") then
  389.             SpellNotifications_DisplaySmall("Reduced spell power.","green")
  390.         end
  391.     end
  392. end
  393.  
  394.  
  395.  
  396.  
  397. if (type=="SPELL_MISSED") then
  398. --  if (bit.band(destFlags, COMBATLOG_OBJECT_AFFILIATION_MINE) > 0) or (bit.band(destFlags, COMBATLOG_OBJECT_AFFILIATION_PARTY) > 0) then
  399.     if (bit.band(destFlags, COMBATLOG_OBJECT_AFFILIATION_MINE) > 0) then
  400.         local spellName,_,missType = select(11,...)
  401.         if (missType=="REFLECT") then
  402.             SpellNotifications_DisplaySmall("Reflected "..spellName..".","white")
  403.             --SendChatMessage("Reflected "..spellName..".", "PARTY");
  404.         elseif (destName=="Grounding Totem") and (bit.band(destFlags, COMBATLOG_OBJECT_AFFILIATION_MINE) > 0) then
  405.             SpellNotifications_DisplaySmall("Grounded "..spellName..".","white")
  406.             --SendChatMessage("Grounded "..spellName..".", "PARTY");
  407.         end
  408.     end
  409. end
  410. if (type=="SPELL_DAMAGE") then
  411.     if bit.band(destFlags, COMBATLOG_OBJECT_AFFILIATION_MINE) > 0 then
  412.         local spellName = select(11,...)
  413.         if (destName=="Grounding Totem") then
  414.             SpellNotifications_DisplaySmall("Grounded "..spellName..".","white")
  415.             --SendChatMessage("Grounded "..spellName..".", "PARTY");
  416.         end
  417.     end
  418. end
  419.  
  420.  
  421.  
  422. if (type=="SPELL_MISSED") then
  423.     if bit.band(sourceFlags, COMBATLOG_OBJECT_AFFILIATION_MINE) > 0 then
  424.         if (destGUID==UnitGUID("target")) or (destGUID==UnitGUID("targettarget")) or (destGUID==UnitGUID("focus")) or (destGUID==UnitGUID("player")) or (destGUID==UnitGUID("pet")) or (destGUID==UnitGUID("pettarget")) or (destGUID==UnitGUID("mouseover")) or (destGUID==UnitGUID("mouseovertarget")) or (destGUID==UnitGUID("arena1")) or (destGUID==UnitGUID("arena2")) or (destGUID==UnitGUID("arena3")) or (destGUID==UnitGUID("arena4")) or (destGUID==UnitGUID("arena5")) or (destGUID==UnitGUID("party1")) or (destGUID==UnitGUID("party2")) or (destGUID==UnitGUID("party3")) or (destGUID==UnitGUID("party4")) or (destGUID==UnitGUID("party5")) then -- makes sure dest targ wasn't some random aoe
  425.             local spellName,_,missType = select(11,...)
  426.             local lowspell = string.lower(spellName)
  427.            
  428.             if (string.find(lowspell,"pvp trinket")) or (string.find(lowspell,"every man for himself")) or (string.find(lowspell,"soul fragment")) or (string.find(lowspell,"chaos bane")) or (string.find(lowspell,"frostforged")) or (string.find(lowspell,"berserk")) or (string.find(lowspell,"hurricane")) or (string.find(lowspell,"power torrent"))
  429.             --Death Knight
  430.            
  431.             --Druid
  432.            
  433.             --Hunter
  434.            
  435.             --Mage
  436.             or (string.find(lowspell,"frostbite")) or ((string.find(lowspell,"deep freeze")) and missType=="IMMUNE") or (string.find(lowspell,"frost nova")) or (string.find(lowspell,"shattered barrier")) or (string.find(lowspell,"waterbolt"))
  437.            
  438.             --Paladin
  439.             or (string.find(lowspell,"seal of "))
  440.            
  441.             --Priest
  442.            
  443.             --Rogue
  444.             or (string.find(lowspell," poison"))
  445.            
  446.             --Shaman
  447.             or (string.find(lowspell,"healing stream")) or (string.find(lowspell,"earth shield")) or (string.find(lowspell,"ancestral awakening"))
  448.            
  449.             --Warlock
  450.             or (string.find(lowspell,"torment")) or (string.find(lowspell,"shadow bite")) or (string.find(lowspell,"jinx")) or (string.find(lowspell,"dark intent")) or (string.find(lowspell,"siphon life")) or (string.find(lowspell,"fel synergy")) or (string.find(lowspell,"eradication")) or (string.find(lowspell,"nightfall")) or (string.find(lowspell,"devour magic")) or (string.find(lowspell,"shadow embrace")) or (string.find(lowspell,"doom bolt")) or (string.find(lowspell,"everlasting affliction")) or (string.find(lowspell,"immolation")) or (string.find(lowspell,"shadowsnare")) or (string.find(lowspell,"shadow and flame")) or (string.find(lowspell,"improved shadow")) or (string.find(lowspell,"felstorm")) or (string.find(lowspell,"legion strike")) or (string.find(lowspell,"pursuit")) or (string.find(lowspell,"curse of gul'dan")) or (string.find(lowspell,"fel armor")) or (string.find(lowspell,"volcanic destruction"))
  451.            
  452.             --Warrior          
  453.             or (string.find(lowspell,"retaliation")) or (string.find(lowspell,"gag order")) or (string.find(lowspell,"heroic strike")) or (string.find(lowspell,"cleave")) or (string.find(lowspell,"deep wound")) or (string.find(lowspell,"enrage")) or (string.find(lowspell,"taste for blood"))
  454.            
  455.             then
  456.                 return;
  457.             end
  458.                
  459.             if (string.find(lowspell,"charge")) then
  460.                 spellName = "Charge"
  461.             elseif (string.find(lowspell,"intercept")) then
  462.                 spellName = "Intercept"
  463.             end            
  464.             if (missType=="ABSORB") then
  465.                 return;
  466.             elseif (destName=="Grounding Totem") then
  467.                 ResistMethod = "grounded"
  468.                 MySpellGrounded = true;
  469.             elseif (missType=="REFLECT") then
  470.                 ResistMethod = "reflected"
  471.                 MySpellReflected = true;
  472.             elseif (missType=="IMMUNE") then
  473.                 ResistMethod = "immune"
  474.             elseif (missType=="EVADE") then
  475.                 ResistMethod = "evaded"
  476.             elseif (missType=="PARRY") then
  477.                 ResistMethod = "parried"
  478.             elseif (missType=="DODGE") then
  479.                 ResistMethod = "dodged"
  480.             elseif (missType=="BLOCK") then
  481.                 ResistMethod = "blocked"
  482.             elseif (missType=="DEFLECT") then
  483.                 ResistMethod = "deflected"
  484.             elseif (missType=="RESIST") then
  485.                 ResistMethod = "resisted"
  486.             else
  487.                 ResistMethod = "missed"
  488.             end
  489.            
  490.             if (ResistMethod=="immune") and (spellName=="Shattering Throw") then
  491.                 SpellNotifications_DisplayBig("Shattered!","green")
  492.                 return;
  493.             end
  494.            
  495.             if (ResistMethod=="immune") or (ResistMethod=="evaded") then
  496.                 SpellNotifications_DisplayBig(""..spellName.." "..ResistMethod..".","red")
  497.             else
  498.                 SpellNotifications_DisplayBig(""..spellName.." "..ResistMethod..".","white")
  499.                 SpellNotifications_PlaySound("thud")
  500.             end
  501.             if (ResistMethod ~= "immune") then
  502.                 if (spellName=="Mocking Blow") or (spellName=="Challenging Shout") or (spellName=="Taunt") or (spellName=="Growl") or (spellName=="Challenging Roar") then
  503.                     lowerspellName = string.lower(spellName)
  504.                     if (SpellNotifications_Class=="WARRIOR") or (SpellNotifications_Class=="DRUID") or (SpellNotifications_Class=="PALADIN") or (SpellNotifications_Class=="DEATHKNIGHT") then
  505.                         if (ResistMethod ~= "missed") then
  506.                             SendChatMessage("My "..lowerspellName.." was "..ResistMethod..".");
  507.                         else
  508.                             SendChatMessage("My "..lowerspellName.." "..ResistMethod..".");
  509.                         end
  510.                     end
  511.                 end
  512.             end
  513.         end
  514.     end
  515. end
  516.  
  517.    
  518.    
  519.    
  520.    
  521.    
  522.    
  523.    
  524.    
  525.    
  526.    
  527.    
  528.    
  529.    
  530.    
  531.    
  532.    
  533.    
  534.    
  535.    
  536.    
  537.    
  538.    
  539.    
  540.    
  541.    
  542.    
  543.    
  544.    
  545.    
  546.    
  547.    
  548.    
  549.    
  550.    
  551.  
  552.  
  553.  
  554.  
  555.  
  556. end
  557.  
  558.  
  559.  
  560. function SpellNotifications_DisplayBig(text,color)
  561. ZoneTextString:SetText(text);
  562. PVPInfoTextString:SetText("");
  563. ZoneTextFrame.startTime = GetTime()
  564. ZoneTextFrame.fadeInTime = 0
  565. ZoneTextFrame.holdTime = 1
  566. ZoneTextFrame.fadeOutTime = 2
  567. if (color=="red") then
  568.     ZoneTextString:SetTextColor(1,0,0);
  569. elseif (color=="orange") then
  570.     ZoneTextString:SetTextColor(1,0.5,0);
  571. elseif (color=="yellow") then
  572.     ZoneTextString:SetTextColor(1,1,0);
  573. elseif (color=="green") then
  574.     ZoneTextString:SetTextColor(0,1,0);
  575. elseif (color=="blue") then
  576.     ZoneTextString:SetTextColor(0,0.75,1);
  577. elseif (color=="purple") then
  578.     ZoneTextString:SetTextColor(1,0,1);
  579. else -- white
  580.     ZoneTextString:SetTextColor(1,1,1);
  581. end
  582. ZoneTextFrame:Show()
  583. end
  584.  
  585. function SpellNotifications_DisplaySmall(text,color)
  586. if (color=="red") then
  587.     UIErrorsFrame:AddMessage(text,1,0,0);
  588. elseif (color=="orange") then
  589.     UIErrorsFrame:AddMessage(text,1,0.5,0);
  590. elseif (color=="yellow") then
  591.     UIErrorsFrame:AddMessage(text,1,1,0);
  592. elseif (color=="green") then
  593.     UIErrorsFrame:AddMessage(text,0,1,0);
  594. elseif (color=="blue") then
  595.     UIErrorsFrame:AddMessage(text,0,0.75,1);
  596. elseif (color=="purple") then
  597.     UIErrorsFrame:AddMessage(text,1,0,1);
  598. else -- white
  599.     UIErrorsFrame:AddMessage(text,1,1,1);
  600. end
  601. end
  602.  
  603. function SpellNotifications_PlaySound(sound)
  604. PlaySoundFile("Interface\\AddOns\\SpellNotifications\\Sounds\\"..sound..".mp3");
  605. end
  606.  
  607. function SpellNotifications_ErrorsFrame_AddMessage(self,msg,...)
  608. local lowermsg = string.lower(msg)
  609. if (string.find(lowermsg,"not enough")) or (string.find(lowermsg,"not ready")) or (string.find(lowermsg,"nothing to attack")) or (string.find(lowermsg,"can't attack")) or (string.find(lowermsg,"can't do")) or (string.find(lowermsg,"unable to move")) or (string.find(lowermsg,"must equip")) or (lowermsg=="interrupted") or (string.find(lowermsg,"target is dead")) or (string.find(lowermsg,"invalid target")) or (string.find(lowermsg,"line of sight")) or (string.find(lowermsg,"you are dead")) or (string.find(lowermsg,"no target")) or (string.find(lowermsg,"another action")) or (string.find(lowermsg,"you are stunned")) or (string.find(lowermsg,"wrong way")) or (string.find(lowermsg,"out of range")) or (string.find(lowermsg,"front of you")) or (string.find(lowermsg,"you cannot attack")) or (string.find(lowermsg,"too far away")) or (string.find(lowermsg,"must be in")) or (string.find(lowermsg,"too close")) or (string.find(lowermsg,"requires combo")) or (string.find(lowermsg,"in combat")) or (string.find(lowermsg,"not in control")) or (string.find(lowermsg,"must have")) or (string.find(lowermsg,"nothing to dispel")) or (string.find(lowermsg,"in an arena")) or (string.find(lowermsg,"while pacified")) then
  610.     return;
  611. end
  612. return self:SpellNotifications_Orig_AddMessage(msg,...);
  613. end
  614.  
  615. function SpellNotifications_HookErrorsFrame()
  616. local ef = getglobal("UIErrorsFrame");
  617. ef.SpellNotifications_Orig_AddMessage = ef.AddMessage;
  618. ef.AddMessage = SpellNotifications_ErrorsFrame_AddMessage;
  619. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement