Advertisement
wit4er

6.0.3 pre-WoD

Nov 10th, 2014
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 60.29 KB | None | 0 0
  1. print("Autoscript v6.0.3 loaded!\n")
  2. print("Autoscript v6.0.3 loaded!\n")
  3. print("Autoscript v6.0.3 loaded!\n")
  4. --config//
  5. local EnemyCooldowns = 1
  6. local FCTtweaks = 1
  7. local Macro = 1
  8. local LoCRemover = 1
  9. local ArenaTrinkets = 1
  10. local ArenaDR = 0
  11. local RogueDR = 1
  12. local Combat = 1
  13. local UnitFrames = 1
  14. local ShadowDanceBar = 0
  15. local InterruptA = 1
  16. local Flash = 1
  17. local cArenas = 1
  18. local DRTrackerWoD = 1
  19. --//config
  20.  
  21. --enemy cooldowns
  22. if (EnemyCooldowns == 1) then
  23.  
  24. USS="UNIT_SPELLCAST_SUCCEEDED";OE="OnEvent";F="Frame";CF=CreateFrame;BO="Border";xb=630;yb=320;sb=24;ib=1;ii=1  
  25. function TrS(f,x,y,cd,T,s,h)f:SetPoint("BOTTOMLEFT",x,y)f:SetSize(s,s)f.c=CF("Cooldown",cd,nil,"CooldownFrameTemplate")f.c:SetAllPoints(f)f.t=f:CreateTexture(nil,BO)f.t:SetAllPoints()f.t:SetTexture(T);if not h then f:Hide();end f:RegisterEvent(USS)end
  26. function Ts(f,cd,U,N,S,TI)if CPz(N,S,U) then f:Show();CooldownFrame_SetTimer(cd,GetTime(),TI,1)f.elapsed = 0 f:SetScript('OnUpdate', function(self, elapsed)if self.elapsed > TI+1 then self:SetScript('OnUpdate', nil) self:Hide();else self.elapsed = self.elapsed + elapsed end end)end end
  27. function CPz(N,S,U)if(N==S and (U=="arena1" or U=="arena2" or U=="arena3" or U=="arenapet1" or U=="arenapet2" or U=="arenapet3" or U=="target" or U=="focus"))then return true else return false end end
  28. --rogue
  29. t1p="Interface\\Icons\\ability_rogue_preparation";t1=CF(F);TrS(t1,xb,yb,"cd1",t1p,sb,false);t1:SetScript(OE,function(self,event,...) Ts(t1,cd1,select(1,...),select(5,...),14185,300) end);
  30. t2p="Interface\\Icons\\ability_rogue_kidneyshot";t2=CF(F);TrS(t2,xb+sb+ii,yb,"cd2",t2p,sb,false);t2:SetScript(OE,function(self,event,...) Ts(t2,cd2,select(1,...),select(5,...),408,20) end);
  31. t3p="Interface\\Icons\\spell_shadow_nethercloak";t3=CF(F);TrS(t3,xb+sb*2+ii*2,yb,"cd3",t3p,sb,false);t3:SetScript(OE,function(self,event,...) Ts(t3,cd3,select(1,...),select(5,...),31224,60) end);
  32. t4p="Interface\\Icons\\ability_rogue_combatreadiness";t4=CF(F);TrS(t4,xb+sb*3+ii*3,yb,"cd4",t4p,sb,false);t4:SetScript(OE,function(self,event,...) Ts(t4,cd4,select(1,...),select(5,...),74001,120) end);
  33. t5p="Interface\\Icons\\ability_vanish";t5=CF(F);TrS(t5,xb+sb*4+ii*4,yb,"cd5",t5p,sb,false);t5:SetScript(OE,function(self,event,...) Ts(t5,cd5,select(1,...),select(5,...),1856,120) end);
  34. t6p="Interface\\Icons\\ability_rogue_shadowstep";t6=CF(F);TrS(t6,xb+sb*5+ii*5,yb,"cd6",t6p,sb,false);t6:SetScript(OE,function(self,event,...) Ts(t6,cd6,select(1,...),select(5,...),36554,20) end);
  35. t7p="Interface\\Icons\\spell_shadow_mindsteal";t7=CF(F);TrS(t7,xb+sb*6+ii*6,yb,"cd7",t7p,sb,false);t7:SetScript(OE,function(self,event,...) Ts(t7,cd7,select(1,...),select(5,...),2094,120) end);
  36. t8p="Interface\\Icons\\ability_rogue_smoke";t8=CF(F);TrS(t8,xb+sb*7+ii*7,yb,"cd8",t8p,sb,false);t8:SetScript(OE,function(self,event,...) Ts(t8,cd8,select(1,...),select(5,...),76577,180) end);
  37. t9p="Interface\\Icons\\ability_rogue_shadowdance";t9=CF(F);TrS(t9,xb+sb*8+ii*8,yb,"cd9",t9p,sb,false);t9:SetScript(OE,function(self,event,...) Ts(t9,cd9,select(1,...),select(5,...),51713,60) end);
  38. t10p="Interface\\Icons\\achievement_bg_killingblow_berserker";t10=CF(F);TrS(t10,xb+sb*9+ii*9,yb,"cd10",t10p,sb,false);t10:SetScript(OE,function(self,event,...) Ts(t10,cd10,select(1,...),select(5,...),137619,60) end);
  39.  
  40. --warlock
  41. t11p="Interface\\Icons\\ability_warlock_howlofterror";t11=CF(F);TrS(t11,xb,yb-(sb+ib),"cd11",t11p,sb,false);t11:SetScript(OE,function(self,event,...) Ts(t11,cd11,select(1,...),select(5,...),5484,40) end);
  42. t12p="Interface\\Icons\\ability_warlock_mortalcoil";t12=CF(F);TrS(t12,xb+sb+ii,yb-(sb+ib),"cd12",t12p,sb,false);t12:SetScript(OE,function(self,event,...) Ts(t12,cd12,select(1,...),select(5,...),6789,45) end);
  43. t13p="Interface\\Icons\\ability_warlock_shadowfurytga";t13=CF(F);TrS(t13,xb+sb*2+ii*2,yb-(sb+ib),"cd13",t13p,sb,false);t13:SetScript(OE,function(self,event,...) Ts(t13,cd13,select(1,...),select(5,...),30283,30) end);
  44. t14p="Interface\\Icons\\spell_shadow_demoniccircleteleport";t14=CF(F);TrS(t14,xb+sb*3+ii*3,yb-(sb+ib),"cd14",t14p,sb,false);t14:SetScript(OE,function(self,event,...) Ts(t14,cd14,select(1,...),select(5,...),48020,26) end);
  45. t15p="Interface\\Icons\\spell_shadow_demonictactics";t15=CF(F);TrS(t15,xb+sb*4+ii*4,yb-(sb+ib),"cd15",t15p,sb,false);t15:SetScript(OE,function(self,event,...) Ts(t15,cd15,select(1,...),select(5,...),104773,180) end);
  46. t16p="Interface\\Icons\\spell_warlock_darkregeneration";t16=CF(F);TrS(t16,xb+sb*5+ii*5,yb-(sb+ib),"cd16",t16p,sb,false);t16:SetScript(OE,function(self,event,...) Ts(t16,cd16,select(1,...),select(5,...),108359,120) end);
  47. t17p="Interface\\Icons\\ability_deathwing_bloodcorruption_death";t17=CF(F);TrS(t17,xb+sb*6+ii*6,yb-(sb+ib),"cd17",t17p,sb,false);t17:SetScript(OE,function(self,event,...) Ts(t17,cd17,select(1,...),select(5,...),110913,180) end);
  48. t18p="Interface\\Icons\\warlock_sacrificial_pact";t18=CF(F);TrS(t18,xb+sb*7+ii*7,yb-(sb+ib),"cd18",t18p,sb,false);t18:SetScript(OE,function(self,event,...) Ts(t18,cd18,select(1,...),select(5,...),108416,60) end);
  49. t19p="Interface\\Icons\\warlock_spelldrain";t19=CF(F);TrS(t19,xb+sb*8+ii*8,yb-(sb+ib),"cd19",t19p,sb,false);t19:SetScript(OE,function(self,event,...) Ts(t19,cd19,select(1,...),select(5,...),108482,120) end);
  50.  
  51.  
  52. --mage
  53. t20p="Interface\\Icons\\spell_arcane_blink";t20=CF(F);TrS(t20,xb,yb-2*(sb+ib),"cd20",t20p,sb,false);t20:SetScript(OE,function(self,event,...) Ts(t20,cd20,select(1,...),select(5,...),1953,15) end);
  54. t21p="Interface\\Icons\\ability_mage_deepfreeze";t21=CF(F);TrS(t21,xb+sb+ii,yb-2*(sb+ib),"cd21",t21p,sb,false);t21:SetScript(OE,function(self,event,...) Ts(t21,cd21,select(1,...),select(5,...),44572,30) end);
  55. t22p="Interface\\Icons\\spell_frost_iceshard";t22=CF(F);TrS(t22,xb+sb*2+ii*2,yb-2*(sb+ib),"cd22",t22p,sb,false);t22:SetScript(OE,function(self,event,...) Ts(t22,cd22,select(1,...),select(5,...),113724,45) end);
  56. t23p="Interface\\Icons\\spell_frost_frost";t23=CF(F);TrS(t23,xb+sb*3+ii*3,yb-2*(sb+ib),"cd23",t23p,sb,false);t23:SetScript(OE,function(self,event,...) Ts(t23,cd23,select(1,...),select(5,...),45438,300) end);
  57. t24p="Interface\\Icons\\spell_frost_wizardmark";t24=CF(F);TrS(t24,xb+sb*4+ii*4,yb-2*(sb+ib),"cd24",t24p,sb,false);t24:SetScript(OE,function(self,event,...) Ts(t24,cd24,select(1,...),select(5,...),11958,180) end);
  58. t25p="Interface\\Icons\\spell_mage_altertime";t25=CF(F);TrS(t25,xb+sb*5+ii*5,yb-2*(sb+ib),"cd25",t25p,sb,false);t25:SetScript(OE,function(self,event,...) Ts(t25,cd25,select(1,...),select(5,...),108978,90) end);
  59.  
  60. --dk
  61. t26p="Interface\\Icons\\spell_deathknight_strangulate";t26=CF(F);TrS(t26,xb,yb-3*(sb+ib),"cd26",t26p,sb,false);t26:SetScript(OE,function(self,event,...) Ts(t26,cd26,select(1,...),select(5,...),49576,25) end);
  62. t27p="Interface\\Icons\\spell_deathknight_gnaw_ghoul";t27=CF(F);TrS(t27,xb+sb+ii,yb-3*(sb+ib),"cd27",t27p,sb,false);t27:SetScript(OE,function(self,event,...) Ts(t27,cd27,select(1,...),select(5,...),91800,60) end);
  63. t28p="Interface\\Icons\\ability_deathknight_asphixiate";t28=CF(F);TrS(t28,xb+sb*2+ii*2,yb-3*(sb+ib),"cd28",t28p,sb,false);t28:SetScript(OE,function(self,event,...) Ts(t28,cd28,select(1,...),select(5,...),108194,30) end);
  64. t29p="Interface\\Icons\\spell_shadow_antimagicshell";t29=CF(F);TrS(t29,xb+sb*3+ii*3,yb-3*(sb+ib),"cd29",t29p,sb,false);t29:SetScript(OE,function(self,event,...) Ts(t29,cd29,select(1,...),select(5,...),48707,45) end);
  65. t30p="Interface\\Icons\\spell_deathknight_antimagiczone";t30=CF(F);TrS(t30,xb+sb*4+ii*4,yb-3*(sb+ib),"cd30",t30p,sb,false);t30:SetScript(OE,function(self,event,...) Ts(t30,cd30,select(1,...),select(5,...),51052,120) end);
  66. t31p="Interface\\Icons\\spell_deathknight_iceboundfortitude";t31=CF(F);TrS(t31,xb+sb*5+ii*5,yb-3*(sb+ib),"cd31",t31p,sb,false);t31:SetScript(OE,function(self,event,...) Ts(t31,cd31,select(1,...),select(5,...),48792,180) end);
  67. t32p="Interface\\Icons\\spell_shadow_demonicempathy";t32=CF(F);TrS(t32,xb+sb*6+ii*6,yb-3*(sb+ib),"cd32",t32p,sb,false);t32:SetScript(OE,function(self,event,...) Ts(t32,cd32,select(1,...),select(5,...),96268,30) end);
  68. t33p="Interface\\Icons\\ability_deathknight_pillaroffrost";t33=CF(F);TrS(t33,xb+sb*7+ii*7,yb-3*(sb+ib),"cd33",t33p,sb,false);t33:SetScript(OE,function(self,event,...) Ts(t33,cd33,select(1,...),select(5,...),51271,60) end);
  69. t34p="Interface\\Icons\\spell_holy_consumemagic";t34=CF(F);TrS(t34,xb+sb*8+ii*8,yb-3*(sb+ib),"cd34",t34p,sb,false);t34:SetScript(OE,function(self,event,...) Ts(t34,cd34,select(1,...),select(5,...),77606,60) end);
  70. t35p="Interface\\Icons\\spell_shadow_raisedead";t35=CF(F);TrS(t35,xb+sb*9+ii*9,yb-3*(sb+ib),"cd35",t35p,sb,false);t35:SetScript(OE,function(self,event,...) Ts(t35,cd35,select(1,...),select(5,...),49039,120) end);
  71.  
  72.  
  73. --priest
  74. t36p="Interface\\Icons\\spell_shadow_psychichorrors";t36=CF(F);TrS(t36,xb,yb-4*(sb+ib),"cd36",t36p,sb,false);t36:SetScript(OE,function(self,event,...) Ts(t36,cd36,select(1,...),select(5,...),64044,35) end);
  75. t37p="Interface\\Icons\\spell_priest_voidtendrils";t37=CF(F);TrS(t37,xb+sb+ii,yb-4*(sb+ib),"cd37",t37p,sb,false);t37:SetScript(OE,function(self,event,...) Ts(t37,cd37,select(1,...),select(5,...),108920,30) end);
  76. t38p="Interface\\Icons\\spell_shadow_psychicscream";t38=CF(F);TrS(t38,xb+sb*2+ii*2,yb-4*(sb+ib),"cd38",t38p,sb,false);t38:SetScript(OE,function(self,event,...) Ts(t38,cd38,select(1,...),select(5,...),8122,45) end);
  77. t39p="Interface\\Icons\\spell_shadow_dispersion";t39=CF(F);TrS(t39,xb+sb*3+ii*3,yb-4*(sb+ib),"cd39",t39p,sb,false);t39:SetScript(OE,function(self,event,...) Ts(t39,cd39,select(1,...),select(5,...),47585,105) end);
  78. t40p="Interface\\Icons\\spell_priest_spectralguise";t40=CF(F);TrS(t40,xb+sb*4+ii*4,yb-4*(sb+ib),"cd40",t40p,sb,false);t40:SetScript(OE,function(self,event,...) Ts(t40,cd40,select(1,...),select(5,...),112833,30) end);
  79. t41p="Interface\\Icons\\spell_holy_painsupression";t41=CF(F);TrS(t41,xb+sb*5+ii*5,yb-4*(sb+ib),"cd41",t41p,sb,false);t41:SetScript(OE,function(self,event,...) Ts(t41,cd41,select(1,...),select(5,...),33206,180) end);
  80.  
  81. --paladin
  82. t42p="Interface\\Icons\\spell_holy_prayerofhealing";t42=CF(F);TrS(t42,xb,yb-5*(sb+ib),"cd42",t42p,sb,false);t42:SetScript(OE,function(self,event,...) Ts(t42,cd42,select(1,...),select(5,...),20066,15) end);
  83. t43p="Interface\\Icons\\spell_holy_sealofmight";t43=CF(F);TrS(t43,xb+sb+ii,yb-5*(sb+ib),"cd43",t43p,sb,false);t43:SetScript(OE,function(self,event,...) Ts(t43,cd43,select(1,...),select(5,...),853,60) end);
  84. t44p="Interface\\Icons\\spell_holy_fistofjustice";t44=CF(F);TrS(t44,xb+sb*2+ii*2,yb-5*(sb+ib),"cd44",t44p,sb,false);t44:SetScript(OE,function(self,event,...) Ts(t44,cd44,select(1,...),select(5,...),105593,30) end);
  85. t45p="Interface\\Icons\\ability_paladin_blindinglight";t45=CF(F);TrS(t45,xb+sb*3+ii*3,yb-5*(sb+ib),"cd45",t45p,sb,false);t45:SetScript(OE,function(self,event,...) Ts(t45,cd45,select(1,...),select(5,...),115750,120) end);
  86. t46p="Interface\\Icons\\spell_holy_divineshield";t46=CF(F);TrS(t46,xb+sb*4+ii*4,yb-5*(sb+ib),"cd46",t46p,sb,false);t46:SetScript(OE,function(self,event,...) Ts(t46,cd46,select(1,...),select(5,...),642,300) end);
  87. t47p="Interface\\Icons\\spell_holy_avenginewrath";t47=CF(F);TrS(t47,xb+sb*5+ii*5,yb-5*(sb+ib),"cd47",t47p,sb,false);t47:SetScript(OE,function(self,event,...) Ts(t47,cd47,select(1,...),select(5,...),31884,120) end);
  88. t48p="Interface\\Icons\\ability_paladin_holyavenger";t48=CF(F);TrS(t48,xb+sb*6+ii*6,yb-5*(sb+ib),"cd48",t48p,sb,false);t48:SetScript(OE,function(self,event,...) Ts(t48,cd48,select(1,...),select(5,...),105809,120) end);
  89. t49p="Interface\\Icons\\ability_paladin_speedoflight";t49=CF(F);TrS(t49,xb+sb*7+ii*7,yb-5*(sb+ib),"cd49",t49p,sb,false);t49:SetScript(OE,function(self,event,...) Ts(t49,cd49,select(1,...),select(5,...),85499,45) end);
  90.  
  91. --warrior
  92. t50p="Interface\\Icons\\ability_warrior_charge";t50=CF(F);TrS(t50,xb,yb-6*(sb+ib),"cd50",t50p,sb,false);t50:SetScript(OE,function(self,event,...) Ts(t50,cd50,select(1,...),select(5,...),100,20) end);
  93. t51p="Interface\\Icons\\ability_golemthunderclap";t51=CF(F);TrS(t51,xb+sb+ii,yb-6*(sb+ib),"cd51",t51p,sb,false);t51:SetScript(OE,function(self,event,...) Ts(t51,cd51,select(1,...),select(5,...),5246,90) end);
  94. t52p="Interface\\Icons\\ability_warrior_shockwave";t52=CF(F);TrS(t52,xb+sb*2+ii*2,yb-6*(sb+ib),"cd52",t52p,sb,false);t52:SetScript(OE,function(self,event,...) Ts(t52,cd52,select(1,...),select(5,...),46968,40) end);
  95. t53p="Interface\\Icons\\ability_warrior_dragonroar";t53=CF(F);TrS(t53,xb+sb*3+ii*3,yb-6*(sb+ib),"cd53",t53p,sb,false);t53:SetScript(OE,function(self,event,...) Ts(t53,cd53,select(1,...),select(5,...),118000,60) end);
  96. t54p="Interface\\Icons\\ability_warrior_challange";t54=CF(F);TrS(t54,xb+sb*4+ii*4,yb-6*(sb+ib),"cd54",t54p,sb,false);t54:SetScript(OE,function(self,event,...) Ts(t54,cd54,select(1,...),select(5,...),118038,120) end);
  97. t55p="Interface\\Icons\\ability_warrior_shieldwall";t55=CF(F);TrS(t55,xb+sb*5+ii*5,yb-6*(sb+ib),"cd55",t55p,sb,false);t55:SetScript(OE,function(self,event,...) Ts(t55,cd55,select(1,...),select(5,...),871,180) end);
  98. t56p="Interface\\Icons\\ability_warrior_bladestorm";t56=CF(F);TrS(t56,xb+sb*6+ii*6,yb-6*(sb+ib),"cd56",t56p,sb,false);t56:SetScript(OE,function(self,event,...) Ts(t56,cd56,select(1,...),select(5,...),46924,60) end);
  99. t57p="Interface\\Icons\\warrior_skullbanner";t57=CF(F);TrS(t57,xb+sb*7+ii*7,yb-6*(sb+ib),"cd57",t57p,sb,false);t57:SetScript(OE,function(self,event,...) Ts(t57,cd57,select(1,...),select(5,...),1719,180) end);
  100. t58p="Interface\\Icons\\ability_warrior_bloodbath";t58=CF(F);TrS(t58,xb+sb*8+ii*8,yb-6*(sb+ib),"cd58",t58p,sb,false);t58:SetScript(OE,function(self,event,...) Ts(t58,cd58,select(1,...),select(5,...),12292,60) end);
  101. t59p="Interface\\Icons\\warrior_talent_icon_avatar";t59=CF(F);TrS(t59,xb+sb*9+ii*9,yb-6*(sb+ib),"cd59",t59p,sb,false);t59:SetScript(OE,function(self,event,...) Ts(t59,cd59,select(1,...),select(5,...),107574,180) end);
  102. t60p="Interface\\Icons\\spell_nature_ancestralguardian";t60=CF(F);TrS(t60,xb+sb*10+ii*10,yb-6*(sb+ib),"cd60",t60p,sb,false);t60:SetScript(OE,function(self,event,...) Ts(t60,cd60,select(1,...),select(5,...),18499,30) end);
  103.  
  104. --druid
  105. t61p="Interface\\Icons\\spell_druid_massentanglement";t61=CF(F);TrS(t61,xb,yb-7*(sb+ib),"cd61",t61p,sb,false);t61:SetScript(OE,function(self,event,...) Ts(t61,cd61,select(1,...),select(5,...),102359,30) end);
  106. t62p="Interface\\Icons\\ability_druid_bash";t62=CF(F);TrS(t62,xb+sb+ii,yb-7*(sb+ib),"cd62",t62p,sb,false);t62:SetScript(OE,function(self,event,...) Ts(t62,cd62,select(1,...),select(5,...),5211,50) end);
  107. t63p="Interface\\Icons\\ability_druid_demoralizingroar";t63=CF(F);TrS(t63,xb+sb*2+ii*2,yb-7*(sb+ib),"cd63",t63p,sb,false);t63:SetScript(OE,function(self,event,...) Ts(t63,cd63,select(1,...),select(5,...),99,30) end);
  108. t64p="Interface\\Icons\\spell_druid_ursolsvortex";t64=CF(F);TrS(t64,xb+sb*3+ii*3,yb-7*(sb+ib),"cd64",t64p,sb,false);t64:SetScript(OE,function(self,event,...) Ts(t64,cd64,select(1,...),select(5,...),102793,60) end);
  109. t65p="Interface\\Icons\\spell_nature_stoneclawtotem";t65=CF(F);TrS(t65,xb+sb*4+ii*4,yb-7*(sb+ib),"cd65",t65p,sb,false);t65:SetScript(OE,function(self,event,...) Ts(t65,cd65,select(1,...),select(5,...),22812,60) end);
  110. t66p="Interface\\Icons\\ability_druid_tigersroar";t66=CF(F);TrS(t66,xb+sb*5+ii*5,yb-7*(sb+ib),"cd66",t66p,sb,false);t66:SetScript(OE,function(self,event,...) Ts(t66,cd66,select(1,...),select(5,...),61336,180) end);
  111. t67p="Interface\\Icons\\spell_nature_natureblessing";t67=CF(F);TrS(t67,xb+sb*6+ii*6,yb-7*(sb+ib),"cd67",t67p,sb,false);t67:SetScript(OE,function(self,event,...) Ts(t67,cd67,select(1,...),select(5,...),108238,120) end);
  112. t68p="Interface\\Icons\\achievement_zone_feralas";t68=CF(F);TrS(t68,xb+sb*7+ii*7,yb-7*(sb+ib),"cd68",t68p,sb,false);t68:SetScript(OE,function(self,event,...) Ts(t68,cd68,select(1,...),select(5,...),124974,90) end);
  113. t69p="Interface\\Icons\\ability_druid_berserk";t69=CF(F);TrS(t69,xb+sb*8+ii*8,yb-7*(sb+ib),"cd69",t69p,sb,false);t69:SetScript(OE,function(self,event,...) Ts(t69,cd69,select(1,...),select(5,...),106952,180) end);
  114. t70p="Interface\\Icons\\spell_druid_displacement";t70=CF(F);TrS(t70,xb+sb*9+ii*9,yb-7*(sb+ib),"cd70",t70p,sb,false);t70:SetScript(OE,function(self,event,...) Ts(t70,cd70,select(1,...),select(5,...),102280,30) end);
  115. t71p="Interface\\Icons\\spell_druid_incarnation";t71=CF(F);TrS(t71,xb+sb*10+ii*10,yb-7*(sb+ib),"cd71",t71p,sb,false);t71:SetScript(OE,function(self,event,...) Ts(t71,cd71,select(1,...),select(5,...),102543,180) end);
  116.  
  117. --shaman
  118. t72p="Interface\\Icons\\spell_shaman_hex";t72=CF(F);TrS(t72,xb,yb-8*(sb+ib),"cd72",t72p,sb,false);t72:SetScript(OE,function(self,event,...) Ts(t72,cd72,select(1,...),select(5,...),51514,35) end);
  119. t73p="Interface\\Icons\\spell_nature_stranglevines";t73=CF(F);TrS(t73,xb+sb+ii,yb-8*(sb+ib),"cd73",t73p,sb,false);t73:SetScript(OE,function(self,event,...) Ts(t73,cd73,select(1,...),select(5,...),51485,30) end);
  120. t74p="Interface\\Icons\\spell_shaman_spiritlink";t74=CF(F);TrS(t74,xb+sb*2+ii*2,yb-8*(sb+ib),"cd74",t74p,sb,false);t74:SetScript(OE,function(self,event,...) Ts(t74,cd74,select(1,...),select(5,...),98008,180) end);
  121. t75p="Interface\\Icons\\ability_shaman_astralshift";t75=CF(F);TrS(t75,xb+sb*3+ii*3,yb-8*(sb+ib),"cd75",t75p,sb,false);t75:SetScript(OE,function(self,event,...) Ts(t75,cd75,select(1,...),select(5,...),108271,90) end);
  122. t76p="Interface\\Icons\\ability_shaman_healingtide";t76=CF(F);TrS(t76,xb+sb*4+ii*4,yb-8*(sb+ib),"cd76",t76p,sb,false);t76:SetScript(OE,function(self,event,...) Ts(t76,cd76,select(1,...),select(5,...),108280,180) end);
  123. t77p="Interface\\Icons\\ability_shaman_windwalktotem";t77=CF(F);TrS(t77,xb+sb*5+ii*5,yb-8*(sb+ib),"cd77",t77p,sb,false);t77:SetScript(OE,function(self,event,...) Ts(t77,cd77,select(1,...),select(5,...),108273,60) end);
  124. t78p="Interface\\Icons\\spell_fire_elementaldevastation";t78=CF(F);TrS(t78,xb+sb*6+ii*6,yb-8*(sb+ib),"cd78",t78p,sb,false);t78:SetScript(OE,function(self,event,...) Ts(t78,cd78,select(1,...),select(5,...),114049,180) end);
  125. t79p="Interface\\Icons\\spell_nature_wispheal";t79=CF(F);TrS(t79,xb+sb*7+ii*7,yb-8*(sb+ib),"cd79",t79p,sb,false);t79:SetScript(OE,function(self,event,...) Ts(t79,cd79,select(1,...),select(5,...),16166,120) end);
  126. t80p="Interface\\Icons\\ability_shaman_multitotemactivation";t80=CF(F);TrS(t80,xb+sb*8+ii*8,yb-8*(sb+ib),"cd80",t80p,sb,false);t80:SetScript(OE,function(self,event,...) Ts(t80,cd80,select(1,...),select(5,...),108285,180) end);
  127. t81p="Interface\\Icons\\spell_nature_tremortotem";t81=CF(F);TrS(t81,xb+sb*9+ii*9,yb-8*(sb+ib),"cd81",t81p,sb,false);t81:SetScript(OE,function(self,event,...) Ts(t81,cd81,select(1,...),select(5,...),8143,60) end);
  128. t82p="Interface\\Icons\\spell_nature_groundingtotem";t82=CF(F);TrS(t82,xb+sb*10+ii*10,yb-8*(sb+ib),"cd82",t82p,sb,false);t82:SetScript(OE,function(self,event,...) Ts(t82,cd82,select(1,...),select(5,...),8177,25) end);
  129.  
  130. --hunter
  131. t83p="Interface\\Icons\\ability_whirlwind";t83=CF(F);TrS(t83,xb,yb-9*(sb+ib),"cd83",t83p,sb,false);t83:SetScript(OE,function(self,event,...) Ts(t83,cd83,select(1,...),select(5,...),19263,180) end);
  132. t84p="Interface\\Icons\\ability_hunter_onewithnature";t84=CF(F);TrS(t84,xb+sb+ii,yb-9*(sb+ib),"cd84",t84p,sb,false);t84:SetScript(OE,function(self,event,...) Ts(t84,cd84,select(1,...),select(5,...),109304,120) end);
  133. t85p="Interface\\Icons\\ability_hunter_bestialdiscipline";t85=CF(F);TrS(t85,xb+sb*2+ii*2,yb-9*(sb+ib),"cd85",t85p,sb,false);t85:SetScript(OE,function(self,event,...) Ts(t85,cd85,select(1,...),select(5,...),121818,300) end);
  134. t86p="Interface\\Icons\\ability_druid_ferociousbite";t86=CF(F);TrS(t86,xb+sb*3+ii*3,yb-9*(sb+ib),"cd86",t86p,sb,false);t86:SetScript(OE,function(self,event,...) Ts(t86,cd86,select(1,...),select(5,...),19574,60) end);
  135. t87p="Interface\\Icons\\ability_hunter_resistanceisfutile";t87=CF(F);TrS(t87,xb+sb*4+ii*4,yb-9*(sb+ib),"cd87",t87p,sb,false);t87:SetScript(OE,function(self,event,...) Ts(t87,cd87,select(1,...),select(5,...),109259,45) end);
  136.  
  137. --monk
  138. t88p="Interface\\Icons\\ability_monk_paralysis";t88=CF(F);TrS(t88,xb+sb*5+ii*5,yb-9*(sb+ib),"cd88",t88p,sb,false);t88:SetScript(OE,function(self,event,...) Ts(t88,cd88,select(1,...),select(5,...),115078,15) end);
  139. t89p="Interface\\Icons\\ability_monk_fortifyingale_new";t89=CF(F);TrS(t89,xb+sb*6+ii*6,yb-9*(sb+ib),"cd89",t89p,sb,false);t89:SetScript(OE,function(self,event,...) Ts(t89,cd89,select(1,...),select(5,...),115203,180) end);
  140. t90p="Interface\\Icons\\ability_monk_zenmeditation";t90=CF(F);TrS(t90,xb+sb*7+ii*7,yb-9*(sb+ib),"cd90",t90p,sb,false);t90:SetScript(OE,function(self,event,...) Ts(t90,cd90,select(1,...),select(5,...),115176,180) end);
  141.  
  142. end
  143.  
  144.  
  145.  
  146.  
  147.  
  148. --FCTtweaks
  149. if (FCTtweaks == 1) then
  150. CompactRaidFrameContainer:SetScale(0.85)
  151. ObjectiveTrackerFrame:SetScale(0.75)
  152. ObjectiveTrackerBlocksFrame.QuestHeader:SetAlpha(0)
  153. hooksecurefunc("PlayerFrame_ResetPosition", function(self)
  154.  self:ClearAllPoints()
  155.  self:SetPoint("CENTER", -370, 70)
  156.  TargetFrame:ClearAllPoints()
  157.  TargetFrame:SetPoint("BOTTOMRIGHT",PlayerFrame,100,-45)
  158.  FocusFrame:ClearAllPoints()
  159.  FocusFrame:SetPoint("BOTTOMRIGHT",PlayerFrame,750,0)
  160. end)
  161.  StanceButton1:ClearAllPoints()
  162.  StanceButton1:SetPoint("BOTTOMLEFT",MultiBarBottomLeftButton2,-500,0)
  163.  StanceButton1.SetPoint = function() end
  164. local frame = CreateFrame("FRAME", "DefaultUIScrips")
  165. frame:RegisterEvent("PLAYER_ENTERING_WORLD")
  166.      local function eventHandler(self, event, ...)
  167.         LARGE_NUMBER_SEPERATOR = ""
  168.         COMBAT_TEXT_HEIGHT = 20;
  169.         COMBAT_TEXT_SCROLLSPEED = 3.0
  170.         --UIErrorsFrame:UnregisterEvent("UI_ERROR_MESSAGE")
  171.         UIErrorsFrame:SetScale(0.7)
  172.         COMBAT_TEXT_TYPE_INFO.PERIODIC_HEAL_ABSORB.show = nil
  173.         COMBAT_TEXT_TYPE_INFO.PERIODIC_HEAL.show = nil
  174.         COMBAT_TEXT_TYPE_INFO.PERIODIC_HEAL_CRIT.show = nil
  175.         --COMBAT_TEXT_TYPE_INFO.HEAL_CRIT.show = nil
  176.         --COMBAT_TEXT_TYPE_INFO.HEAL.show = nil
  177.         COMBAT_TEXT_TYPE_INFO.HEAL_CRIT_ABSORB.show = nil
  178.         COMBAT_TEXT_TYPE_INFO.HEAL_ABSORB.show = nil
  179.         COMBAT_TEXT_TYPE_INFO.ABSORB.show = nil
  180.         COMBAT_TEXT_TYPE_INFO.SPELL_ABSORB.show = nil
  181.         COMBAT_TEXT_TYPE_INFO["ENTERING_COMBAT"].r = 1
  182.         COMBAT_TEXT_TYPE_INFO["ENTERING_COMBAT"].g = 0.82
  183.         COMBAT_TEXT_TYPE_INFO["ENTERING_COMBAT"].b = 0
  184.         COMBAT_TEXT_TYPE_INFO["LEAVING_COMBAT"].r = 1
  185.         COMBAT_TEXT_TYPE_INFO["LEAVING_COMBAT"].g = 0.82
  186.         COMBAT_TEXT_TYPE_INFO["LEAVING_COMBAT"].b = 0
  187.         PlayerHitIndicator:SetFont("Fonts\\font.ttf",30)  
  188.         ENTERING_COMBAT = "+Combat"
  189.         LEAVING_COMBAT = "-Combat"     
  190. end
  191. frame:SetScript("OnEvent", eventHandler)
  192. --[[combat text font ]]
  193. local fontName = "Fonts\\font.ttf"
  194. local fontHeight = 40
  195. local fFlags = ""
  196. local function FS_SetFont()
  197.     DAMAGE_TEXT_FONT = fontName
  198.     COMBAT_TEXT_HEIGHT = fontHeight
  199.     COMBAT_TEXT_CRIT_MAXHEIGHT = fontHeight + 2
  200.     COMBAT_TEXT_CRIT_MINHEIGHT = fontHeight - 2
  201.     local fName, fHeight, fFlags = CombatTextFont:GetFont()
  202.     CombatTextFont:SetFont(fontName, fontHeight, fFlags)
  203. end
  204. FS_SetFont()
  205. --combat text location
  206. local f = CreateFrame("FRAME");
  207. f:SetScript("OnEvent", function(self,event,...)
  208. local arg1 =...;        
  209.      if (arg1=="Blizzard_CombatText") then
  210.         f:UnregisterEvent("ADDON_LOADED");
  211.         hooksecurefunc("CombatText_UpdateDisplayedMessages",
  212.         function ()
  213.         COMBAT_TEXT_LOCATIONS =
  214.         {startX  = 0,
  215.         --startY = 384 * COMBAT_TEXT_Y_SCALE, endX =0,endY = 159 * COMBAT_TEXT_Y_SCALE};
  216.         startY = 164 * COMBAT_TEXT_Y_SCALE, endX =0,endY = 80 * COMBAT_TEXT_Y_SCALE};          
  217. end)end end)
  218. f:RegisterEvent("ADDON_LOADED");
  219. end
  220.  
  221. --macro/binds
  222. if (Macro == 1) then
  223. --[[hooksecurefunc('ActionButton_UpdateHotkeys', function(self)
  224.     local macro, hotkey = _G[self:GetName()..'Name'], _G[self:GetName()..'HotKey']
  225.     if macro and hotkey then macro:Hide() hotkey:Hide() end
  226. end) ]]--
  227. hooksecurefunc('ActionButton_UpdateHotkeys', function(self)
  228.     local macro = _G[self:GetName()..'Name']
  229.     if macro then macro:Hide() end
  230. end)
  231. end
  232.  
  233. if (UnitFrames == 1) then
  234. --player frame tweaks
  235. hooksecurefunc("PlayerFrame_UpdateStatus", function()
  236. if IsResting("player") then PlayerStatusTexture:Hide()PlayerRestIcon:Hide()PlayerRestGlow:Hide()PlayerStatusGlow:Hide()
  237. elseif PlayerFrame.inCombat then PlayerStatusTexture:Hide()PlayerAttackIcon:Show()PlayerRestIcon:Hide()PlayerAttackGlow:Hide()
  238. PlayerRestGlow:Hide()PlayerStatusGlow:Hide()PlayerAttackBackground:Hide() end end)
  239. --background tweaks
  240. hooksecurefunc('TargetFrame_CheckFaction', function(self)
  241.   if ( not UnitPlayerControlled(self.unit)
  242.   and UnitIsTapped(self.unit)
  243.   and not UnitIsTappedByPlayer(self.unit)
  244.   and not UnitIsTappedByAllThreatList(self.unit) ) then
  245.     self.nameBackground:SetVertexColor(0.0, 0.0, 0.0, 0.5);
  246.     if ( self.portrait ) then
  247.       self.portrait:SetVertexColor(0.5, 0.5, 0.5);
  248.     end
  249.   else
  250.     self.nameBackground:SetVertexColor(0.0, 0.0, 0.0, 0.5);
  251.     if ( self.portrait ) then
  252.       self.portrait:SetVertexColor(1.0, 1.0, 1.0);
  253.     end
  254.   end  
  255. end)
  256. --[[ hp ]]
  257. local f=function(v)if(v>=1e4) then return ('%.1fk'):format(v/1e3):gsub('%.?0+([km])$','%1')  else return v end end
  258.         hooksecurefunc("TextStatusBar_UpdateTextString",function(s)
  259.         if not GetCVarBool("statusTextPercentage") then
  260.             if s.TextString and s.currValue then
  261.             s.TextString:SetText(f(s.currValue))           
  262.           end
  263.      end
  264. end)
  265. --[[class colored hp bars ]]
  266. local UnitIsPlayer,UnitIsConnected, UnitClass, RAID_CLASS_COLORS = UnitIsPlayer,UnitIsConnected,UnitClass, RAID_CLASS_COLORS
  267. local _, class, c
  268. local function colour(statusbar, unit, name)
  269.       if UnitIsPlayer(unit) and UnitIsConnected(unit) and unit == statusbar.unit and UnitClass(unit) then
  270.           _, class = UnitClass(unit) c = CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[class] or RAID_CLASS_COLORS[class]
  271.           statusbar:SetStatusBarColor(c.r, c.g, c.b)         
  272.           statusbar = _G["PlayerFrame".."HealthBar"]:SetStatusBarColor(0.1, 1.0, 0.1)--playerframe fix   
  273.       end    
  274. end
  275. hooksecurefunc("UnitFrameHealthBar_Update", colour)
  276. hooksecurefunc("HealthBar_OnValueChanged", function(self)colour(self, self.unit)end)
  277. --[[class colored names]]--
  278. hooksecurefunc("UnitFrame_Update", function(self)
  279. if UnitClass(self.unit) then
  280. local c = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[select(2,UnitClass(self.unit))]
  281. self.name:SetTextColor(c.r,c.g,c.b,1) self.name:SetFont("Fonts\\font.ttf", 13)end end)
  282. end
  283.  
  284. --[[Loss-Of-Control Remover  ]]
  285. if (LoCRemover == 1) then
  286. select(1,LossOfControlFrame:GetRegions()):SetAlpha(0)
  287. select(2,LossOfControlFrame:GetRegions()):SetAlpha(0)
  288. select(3,LossOfControlFrame:GetRegions()):SetAlpha(0)
  289. select(5,LossOfControlFrame:GetRegions()):SetAlpha(0)
  290. --[[hooksecurefunc("CooldownFrame_SetTimer", function(self)
  291.     if self.currentCooldownType == COOLDOWN_TYPE_LOSS_OF_CONTROL then
  292.         self:SetCooldown(0, 0)
  293.     end
  294. end)]]--
  295. hooksecurefunc('CooldownFrame_SetTimer',function(self)
  296. if self.currentCooldownType == COOLDOWN_TYPE_LOSS_OF_CONTROL then
  297. self:SetEdgeTexture("Interface\\Cooldown\\cooldown2");
  298. self:SetCooldown(4500,4500);
  299. self:SetSwipeColor(0.35,0.25,0.25,0);
  300. end
  301. end)
  302. end
  303.  
  304. --[[arena/bg trinkets]]
  305. if (ArenaTrinkets == 1) then
  306. -- // ArenaTrinkets
  307. -- // Lorti - 2013
  308. ArenaTrinkets = CreateFrame("Frame", nil, UIParent)
  309. function ArenaTrinkets:Initialize()
  310. for i = 1, MAX_ARENA_ENEMIES do
  311. local ArenaFrame = _G["ArenaEnemyFrame"..i]
  312. self:CreateIcon(ArenaFrame)
  313. end
  314. end
  315. function ArenaTrinkets:CreateIcon(frame)
  316. local trinket = CreateFrame("Cooldown", nil, frame, "CooldownFrameTemplate")
  317. trinket:SetFrameLevel(frame:GetFrameLevel() + 3)
  318. trinket:SetDrawEdge(false)
  319. trinket:ClearAllPoints()
  320. trinket:SetPoint("LEFT", frame, "RIGHT", 0, -1)
  321. trinket:SetSize(22, 22)
  322.  
  323. trinket.Icon = CreateFrame("Frame", nil, trinket)
  324. trinket.Icon:SetFrameLevel(trinket:GetFrameLevel() - 1)
  325. trinket.Icon:SetAllPoints()
  326. trinket.Icon.Texture = trinket.Icon:CreateTexture(nil, "BORDER")
  327. trinket.Icon.Texture:SetPoint("TOPLEFT", -3, 2)
  328. trinket.Icon.Texture:SetSize(24, 24)
  329. SetPortraitToTexture(trinket.Icon.Texture, UnitFactionGroup('player') == "Horde" and "Interface\\Icons\\inv_jewelry_trinketpvp_02" or "Interface\\Icons\\inv_jewelry_trinketpvp_01")
  330.  
  331. trinket.Icon.Border = CreateFrame("Frame", nil, trinket.Icon)
  332. trinket.Icon.Border:SetFrameLevel(trinket:GetFrameLevel() + 1)
  333. trinket.Icon.Border:SetAllPoints()
  334. trinket.Icon.Border.Texture = trinket.Icon.Border:CreateTexture(nil, "ARTWORK")
  335. trinket.Icon.Border.Texture:SetTexture("Interface\\Minimap\\MiniMap-TrackingBorder")
  336. if IsAddOnLoaded("Lorti UI") then
  337. trinket.Icon.Border.Texture:SetVertexColor(.005,.005,.005)
  338. end
  339. trinket.Icon.Border.Texture:SetPoint("TOPLEFT", -9, 7)
  340. trinket.Icon.Border.Texture:SetSize(63, 63)
  341. local id = frame:GetID()
  342. self["arena"..id] = trinket
  343.  
  344. if ( trinket ) then
  345. trinket.Icon:SetParent(trinket:GetParent())
  346. trinket.Icon:SetScale(1)
  347. trinket.Icon:SetFrameLevel(trinket:GetFrameLevel() - 1)
  348. else
  349. for i = 1, MAX_ARENA_ENEMIES do
  350. trinket.Icon:SetParent(trinket:GetParent())
  351. trinket.Icon:SetScale(1)
  352. trinket.Icon:SetFrameLevel(trinket:GetFrameLevel() - 1)
  353. end
  354. end
  355. end
  356. function ArenaTrinkets:ShowTrinkets()
  357. for i = 1, MAX_ARENA_ENEMIES do
  358. self["arena"..i].Icon:Show()
  359. self["arena"..i]:Show()
  360. self["arena"..i]:SetCooldown(0, 0)
  361. end
  362. end
  363. function ArenaTrinkets:HideTrinkets()
  364. for i = 1, MAX_ARENA_ENEMIES do
  365. self["arena"..i].Icon:Hide()
  366. self["arena"..i]:Hide()
  367. self["arena"..i]:SetCooldown(0, 0)
  368. end
  369. end
  370. ArenaTrinkets:SetScript("OnEvent", function(self, event, ...) return self[event](self, ...) end)
  371. function ArenaTrinkets:UNIT_SPELLCAST_SUCCEEDED(unitID, spell)
  372. if not ArenaTrinkets[unitID] then return end
  373.  
  374. if spell == GetSpellInfo(42292) or spell == GetSpellInfo(59752) then -- Trinket and EMFH
  375. CooldownFrame_SetTimer(self[unitID], GetTime(), 120, 1)
  376. elseif spell == GetSpellInfo(7744) then -- WOTF
  377. CooldownFrame_SetTimer(self[unitID], GetTime(), 30, 1)
  378. end
  379. end
  380. function ArenaTrinkets:PLAYER_ENTERING_WORLD()
  381. local _, instanceType = IsInInstance()
  382. if instanceType == "arena" then
  383. ArenaEnemyFrame1:ClearAllPoints()
  384. ArenaEnemyFrame1:SetPoint("BOTTOMLEFT", FocusFrame, "BOTTOMLEFT", 0, -30)
  385. ArenaEnemyFrame1.SetPoint = function() end
  386. ArenaEnemyFrame2:ClearAllPoints()
  387. ArenaEnemyFrame2:SetPoint("BOTTOMLEFT", ArenaEnemyFrame1, "BOTTOMLEFT", 0, -50)
  388. ArenaEnemyFrame2.SetPoint = function() end
  389. ArenaEnemyFrame3:ClearAllPoints()
  390. ArenaEnemyFrame3:SetPoint("BOTTOMLEFT", ArenaEnemyFrame1, "BOTTOMLEFT", 0, -100)
  391. ArenaEnemyFrame3.SetPoint = function() end
  392. ArenaEnemyFrame4:ClearAllPoints()
  393. ArenaEnemyFrame4:SetPoint("BOTTOMLEFT", ArenaEnemyFrame1, "BOTTOMLEFT", 0, -150)
  394. ArenaEnemyFrame4.SetPoint = function() end
  395. ArenaEnemyFrame5:ClearAllPoints()
  396. ArenaEnemyFrame5:SetPoint("BOTTOMLEFT", ArenaEnemyFrame1, "BOTTOMLEFT", 0, -200)
  397. ArenaEnemyFrame5.SetPoint = function() end
  398. ArenaPrepFrame1:ClearAllPoints()
  399. ArenaPrepFrame1:SetPoint("BOTTOMLEFT", FocusFrame, "BOTTOMLEFT", 0, -30)
  400. ArenaPrepFrame1.SetPoint = function() end
  401. ArenaPrepFrame2:ClearAllPoints()
  402. ArenaPrepFrame2:SetPoint("TOPRIGHT", ArenaPrepFrame1, "TOPRIGHT", 0, -50)
  403. ArenaPrepFrame2.SetPoint = function() end
  404. ArenaPrepFrame3:ClearAllPoints()
  405. ArenaPrepFrame3:SetPoint("TOPRIGHT", ArenaPrepFrame1, "TOPRIGHT", 0, -100)
  406. ArenaPrepFrame3.SetPoint = function() end
  407. ArenaPrepFrame4:ClearAllPoints()
  408. ArenaPrepFrame4:SetPoint("TOPRIGHT", ArenaPrepFrame1, "TOPRIGHT", 0, -150)
  409. ArenaPrepFrame4.SetPoint = function() end
  410. ArenaPrepFrame5:ClearAllPoints()
  411. ArenaPrepFrame5:SetPoint("TOPRIGHT", ArenaPrepFrame1, "TOPRIGHT", 0, -200)
  412. ArenaPrepFrame5.SetPoint = function() end
  413. self:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")
  414. ArenaTrinkets:ShowTrinkets()
  415. SetBinding("TAB", "TARGETNEARESTENEMYPLAYER")
  416. else
  417. ArenaTrinkets:HideTrinkets()
  418. SetBinding("TAB", "TARGETNEARESTENEMY")
  419. if ( self:IsEventRegistered("UNIT_SPELLCAST_SUCCEEDED") ) then
  420. self:UnregisterEvent("UNIT_SPELLCAST_SUCCEEDED")
  421. end
  422. end
  423. end
  424. ArenaTrinkets:RegisterEvent("PLAYER_ENTERING_WORLD")
  425. function ArenaTrinkets:PLAYER_LOGIN()
  426. if not IsAddOnLoaded("Blizzard_ArenaUI") then
  427. LoadAddOn("Blizzard_ArenaUI")
  428. end
  429. self:Initialize()
  430. end
  431. ArenaTrinkets:RegisterEvent("PLAYER_LOGIN")
  432. end
  433. --diminishing returns
  434.  
  435. --rogue drtracker
  436. if (RogueDR == 1) then
  437. USD="UNIT_SPELLCAST_SUCCEEDED";OT="OnEvent";FR="Frame";RF=CreateFrame;RD="Border";UE=UnitName
  438. CS=RF(FR) CS.c=RF("Cooldown","CST",CS.t,"CooldownFrameTemplate") CS.c:SetDrawEdge(false)CS:RegisterEvent(USD)
  439. CS.c:SetAllPoints(CS) CS:SetPoint("TOPRIGHT",PlayerFrame,-3,6)CS:SetSize(26,26)CS:Show()CS.t=CS:CreateTexture(nil,RD)CS.t:SetAllPoints()CS.t:SetTexture("Interface\\Icons\\ability_rogue_kidneyshot")
  440. CS:SetScript(OT,function(self,event,...)if UE(select(1,...))==UE("player")and select(5,...)==1833 then CST:SetCooldown(GetTime(),23)end if UE(select(1,...))==UE("player")and select(5,...)==408 then CST:SetCooldown(GetTime(),24)end end)
  441. SP=RF(FR) SP.c=RF("Cooldown","SAP",SP.t,"CooldownFrameTemplate") SP.c:SetDrawEdge(false) SP:RegisterEvent(USD)
  442. SP.c:SetAllPoints(SP) SP:SetPoint("TOPRIGHT",PlayerFrame,-29,6)SP:Show()SP:SetSize(26,26)SP.t=SP:CreateTexture(nil,RD)SP.t:SetAllPoints()SP.t:SetTexture("Interface\\Icons\\ability_sap")
  443. SP:SetScript(OT,function(self,event,...)if UE(select(1,...))==UE("player")and select(5,...)==6770 then SAP:SetCooldown(GetTime(),26)end if UE(select(1,...))==UE("player")and select(5,...)==1776 then SAP:SetCooldown(GetTime(),22)end end)
  444. --[[GR=RF(FR) GR.c=RF("Cooldown","GAR",GR.t,"CooldownFrameTemplate") GR.c:SetDrawEdge(false) GR:RegisterEvent(USD)
  445. GR.c:SetAllPoints(GR) GR:SetPoint("TOPRIGHT",PlayerFrame,-55,6)GR:Show()GR:SetSize(26,26)GR.t=GR:CreateTexture(nil,RD)GR.t:SetAllPoints()GR.t:SetTexture("Interface\\Icons\\spell_frost_iceshock")
  446. GR:SetScript(OT,function(self,event,...)if UE(select(1,...))==UE("player")and select(5,...)==703 then GAR:SetCooldown(GetTime(),23)end end) ]]--
  447. -- snd tracker
  448. local snd = CreateFrame("Cooldown", nil, PlayerFrame, "CooldownFrameTemplate")
  449. snd:SetDrawEdge(false)
  450. snd:ClearAllPoints()
  451. snd:SetPoint("BOTTOMRIGHT",PlayerFrame,115,6)
  452. snd:SetSize(34,34)
  453. snd.Icon = CreateFrame("Frame", nil, snd)
  454. snd.Icon:SetFrameLevel(snd:GetFrameLevel() - 1)
  455. snd:SetFrameStrata("HIGH")
  456. snd.Icon:SetAllPoints()
  457. snd.Icon.Texture = snd.Icon:CreateTexture(nil, "ARTWORK")
  458. snd.Icon.Texture:SetPoint("BOTTOMRIGHT",PlayerFrame,115,6)
  459. snd.Icon.Texture:SetSize(34,34)
  460. snd.Icon.Texture:SetTexture("Interface\\Icons\\ability_rogue_slicedice")
  461. snd.Icon.Border = CreateFrame("Frame", nil, snd.Icon)
  462. snd.Icon.Border:SetAllPoints()
  463. snd.Icon.Border.Texture = snd.Icon.Border:CreateTexture(nil, Border)
  464. snd:RegisterEvent("UNIT_AURA")
  465. snd:SetScript("OnEvent", function(self, event, unit)
  466. snd.CheckAura(unit)
  467. end)
  468. function snd.CheckAura(unit)
  469. local spellname = GetSpellInfo(5171)
  470. local _, _, _, _, _, duration, expirationTime, unitCaster, _, _, id = UnitBuff("player", spellname)
  471. if id and unitCaster == "player" then
  472. snd:Show()
  473. snd:SetCooldown(expirationTime - duration - 0.5, duration)
  474. return
  475. end
  476. snd:Hide()
  477. end
  478. -- recuperate tracker
  479. local recup = CreateFrame("Cooldown", nil, PlayerFrame, "CooldownFrameTemplate")
  480. recup:SetDrawEdge(false)
  481. recup:ClearAllPoints()
  482. recup:SetPoint("BOTTOMRIGHT",PlayerFrame,115,40)
  483. recup:SetSize(34,34)
  484. recup.Icon = CreateFrame("Frame", nil, recup)
  485. recup.Icon:SetFrameLevel(recup:GetFrameLevel() - 1)
  486. recup:SetFrameStrata("HIGH")
  487. recup.Icon:SetAllPoints()
  488. recup.Icon.Texture = recup.Icon:CreateTexture(nil, "ARTWORK")
  489. recup.Icon.Texture:SetPoint("BOTTOMRIGHT",PlayerFrame,115,40)
  490. recup.Icon.Texture:SetSize(34,34)
  491. recup.Icon.Texture:SetTexture("Interface\\Icons\\ability_rogue_recuperate")
  492. recup.Icon.Border = CreateFrame("Frame", nil, recup.Icon)
  493. recup.Icon.Border:SetAllPoints()
  494. recup.Icon.Border.Texture = recup.Icon.Border:CreateTexture(nil, Border)
  495. recup:RegisterEvent("UNIT_AURA")
  496. recup:SetScript("OnEvent", function(self, event, unit)
  497. recup.CheckAura(unit)
  498. end)
  499. function recup.CheckAura(unit)
  500. local spellname = GetSpellInfo(73651)
  501. local _, _, _, _, _, duration, expirationTime, unitCaster, _, _, id = UnitBuff("player", spellname)
  502. if id and unitCaster == "player" then
  503. recup:Show()
  504. recup:SetCooldown(expirationTime - duration - 0.5, duration)
  505. return
  506. end
  507. recup:Hide()
  508. end
  509.  
  510. --vendetta tracker
  511. local vend = CreateFrame("Cooldown", nil, PlayerFrame, "CooldownFrameTemplate")
  512. vend:SetDrawEdge(false)
  513. vend:ClearAllPoints()
  514. vend:SetPoint("BOTTOMRIGHT",PlayerFrame,149,6)
  515. vend:SetSize(34,34)
  516. vend.Icon = CreateFrame("Frame", nil, vend)
  517. vend.Icon:SetFrameLevel(vend:GetFrameLevel() - 1)
  518. vend:SetFrameStrata("HIGH")
  519. vend.Icon:SetAllPoints()
  520. vend.Icon.Texture = vend.Icon:CreateTexture(nil, "ARTWORK")
  521. vend.Icon.Texture:SetPoint("BOTTOMRIGHT",PlayerFrame,149,6)
  522. vend.Icon.Texture:SetSize(34,34)
  523. vend.Icon.Texture:SetTexture("Interface\\Icons\\ability_rogue_deadliness")
  524. vend.Icon.Border = CreateFrame("Frame", nil, vend.Icon)
  525. vend.Icon.Border:SetAllPoints()
  526. vend.Icon.Border.Texture = vend.Icon.Border:CreateTexture(nil, Border)
  527. vend:RegisterEvent("UNIT_AURA")
  528. vend:SetScript("OnEvent", function(self, event, unit)
  529. vend.CheckAura(unit)
  530. end)
  531. function vend.CheckAura(unit)
  532. local spellname = GetSpellInfo(79140)
  533. local _, _, _, _, _, duration, expirationTime, unitCaster, _, _, id = UnitDebuff("target", spellname)
  534. if id and unitCaster == "player" then
  535. vend:Show()
  536. vend:SetCooldown(expirationTime - duration - 0.5, duration)
  537. return
  538. end
  539. vend:Hide()
  540. end
  541. --rupture tracker
  542. local rupt = CreateFrame("Cooldown", nil, PlayerFrame, "CooldownFrameTemplate")
  543. rupt:SetDrawEdge(false)
  544. rupt:ClearAllPoints()
  545. rupt:SetPoint("BOTTOMRIGHT",PlayerFrame,149,40)
  546. rupt:SetSize(34,34)
  547. rupt.Icon = CreateFrame("Frame", nil, rupt)
  548. rupt.Icon:SetFrameLevel(rupt:GetFrameLevel() - 1)
  549. rupt:SetFrameStrata("HIGH")
  550. rupt.Icon:SetAllPoints()
  551. rupt.Icon.Texture = rupt.Icon:CreateTexture(nil, "ARTWORK")
  552. rupt.Icon.Texture:SetPoint("BOTTOMRIGHT",PlayerFrame,149,40)
  553. rupt.Icon.Texture:SetSize(34,34)
  554. rupt.Icon.Texture:SetTexture("Interface\\Icons\\ability_rogue_rupture")
  555. rupt.Icon.Border = CreateFrame("Frame", nil, rupt.Icon)
  556. rupt.Icon.Border:SetAllPoints()
  557. rupt.Icon.Border.Texture = rupt.Icon.Border:CreateTexture(nil, Border)
  558. rupt:RegisterEvent("UNIT_AURA")
  559. rupt:SetScript("OnEvent", function(self, event, unit)
  560. rupt.CheckAura(unit)
  561. end)
  562. function rupt.CheckAura(unit)
  563. local spellname = GetSpellInfo(1943)
  564. local _, _, _, _, _, duration, expirationTime, unitCaster, _, _, id = UnitDebuff("target", spellname)
  565. if id and unitCaster == "player" then
  566. rupt:Show()
  567. rupt:SetCooldown(expirationTime - duration - 0.5, duration)
  568. return
  569. end
  570. rupt:Hide()
  571. end
  572. end
  573. --CreateFrame("Cooldown", nil, DR, "CooldownFrameTemplate")
  574.  
  575.  
  576. --combat script
  577. if (Combat == 1) then
  578. CTT=CreateFrame("Frame")CTT:SetParent(TargetFrame)CTT:SetPoint("Left",TargetFrame,-30,5)CTT:SetSize(25,25)CTT.t=CTT:CreateTexture(nil,BORDER)CTT.t:SetAllPoints()CTT.t:SetTexture("Interface\\Icons\\ABILITY_DUALWIELD")CTT:Hide()
  579. local function FrameOnUpdate(self) if UnitAffectingCombat("target") then self:Show() else self:Hide() end end local g = CreateFrame("Frame") g:SetScript("OnUpdate", function(self) FrameOnUpdate(CTT) end)
  580. CFT=CreateFrame("Frame")CFT:SetParent(FocusFrame)CFT:SetPoint("Left",FocusFrame,-30,5)CFT:SetSize(25,25)CFT.t=CFT:CreateTexture(nil,BORDER)CFT.t:SetAllPoints()CFT.t:SetTexture("Interface\\Icons\\ABILITY_DUALWIELD")CFT:Hide()
  581. local function FrameOnUpdate(self) if UnitAffectingCombat("focus") then self:Show() else self:Hide() end end local g = CreateFrame("Frame") g:SetScript("OnUpdate", function(self) FrameOnUpdate(CFT) end)
  582. --CPT=CreateFrame("Frame")--[[CPT:SetParent(PlayerFrame)]]CPT:SetPoint("BOTTOMRIGHT",PlayerFrame,-55,6)CPT:SetSize(26,26)CPT.t=CPT:CreateTexture(nil,BORDER)CPT.t:SetAllPoints()CPT.t:SetTexture("Interface\\Icons\\ABILITY_DUALWIELD")CPT:Hide()
  583. --local function FrameOnUpdate(self) if UnitAffectingCombat("player") then self:Show() else self:Hide() end end local g = CreateFrame("Frame") g:SetScript("OnUpdate", function(self) FrameOnUpdate(CPT) end)
  584. end
  585.  
  586.  --SDB fix
  587. if (ShadowDanceBar == 1) then
  588. local shadowdancebar = 2 -- внимание! это номер панели для шд
  589. local f = CreateFrame('frame', 'myownstatedriver', UIParent, 'SecureHandlerStateTemplate')
  590. for i=1,12 do f:SetFrameRef('ActionButton'..i, _G['ActionButton'..i]) end
  591. f:Execute([[ buttons = table.new() for i = 1, 12 do table.insert(buttons, self:GetFrameRef('ActionButton'..i)) end ]])
  592. f:SetAttribute('_onstate-page', [[  for i, button in ipairs(buttons) do button:SetAttribute('actionpage', tonumber(newstate)) end ]])
  593. local getBar = function()
  594.     local class, spec = select(2, UnitClass('player')), GetSpecialization()
  595.     local pages = {
  596.         ['DRUID'] = '[bonusbar:1,nostealth] 7; [bonusbar:1,stealth] 8; [bonusbar:2] 8; [bonusbar:3] 9; [bonusbar:4] 10;',        
  597.         ['WARRIOR'] = '[bonusbar:1] 7; [bonusbar:2] 8; [bonusbar:3] 9;',
  598.         ['PRIEST'] = '[bonusbar:1] 7;',
  599.         ['ROGUE'] = '[form:1][form:'..(spec==3 and 3 or 2)..',stealth] 7; [form:'..(spec==3 and 3 or 2)..',nostealth]'..shadowdancebar..';',
  600.         ['WARLOCK'] = '[form:2] 10;',
  601.         ['MONK'] = '[form:1] '..(spec == 1 and 8 or spec == 2 and 9 or spec == 3 and 7 or 9)..'; [form:2] 7;',
  602.         ['DEFAULT'] = '[vehicleui] 12; [bar:2] 2; [bar:3] 3; [bar:4] 4; [bar:5] 5; [bar:6] 6;',
  603.     }
  604.     local condition, page = pages['DEFAULT'], pages[class]
  605.     if page then condition = condition..' '..page end
  606.     condition = condition..' 1'
  607.     return condition
  608. end
  609. RegisterStateDriver(f, 'page', getBar())
  610. end
  611. --interrupt announcer
  612. if (InterruptA == 1) then
  613. local f = CreateFrame("Frame")
  614. local function Update(self, event, ...)
  615.         if event == "COMBAT_LOG_EVENT_UNFILTERED" then     
  616.         local timestamp, eventType, _, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, _, spellID, spellName, _, extraskillID, extraSkillName = ...
  617.         if eventType == "SPELL_INTERRUPT" and sourceName == UnitName("player") then
  618.             SendChatMessage("Interrupted >> "..GetSpellLink(extraskillID).."!", "SAY")
  619.         end
  620.     end
  621. end
  622. f:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
  623. f:SetScript("OnEvent", Update)
  624. end
  625. --snowfallkeypress animation
  626. if (Flash == 1) then
  627. local animationsCount, animations = 5, {}
  628. local animationNum = 1
  629. local frame, texture, alpha1, scale1, scale2, rotation2
  630.  
  631. for i = 1, animationsCount do
  632.     frame = CreateFrame("Frame")
  633.     texture = frame:CreateTexture() texture:SetTexture('Interface\\Cooldown\\star4') texture:SetAlpha(0) texture:SetAllPoints() texture:SetBlendMode("ADD")
  634.     animationGroup = texture:CreateAnimationGroup()
  635.     alpha1 = animationGroup:CreateAnimation("Alpha") alpha1:SetChange(1) alpha1:SetDuration(0) alpha1:SetOrder(1)
  636.     scale1 = animationGroup:CreateAnimation("Scale") scale1:SetScale(1.5, 1.5) scale1:SetDuration(0) scale1:SetOrder(1)
  637.     scale2 = animationGroup:CreateAnimation("Scale") scale2:SetScale(0, 0) scale2:SetDuration(0.3) scale2:SetOrder(2)
  638.     rotation2 = animationGroup:CreateAnimation("Rotation") rotation2:SetDegrees(90) rotation2:SetDuration(0.3) rotation2:SetOrder(2)
  639.     animations[i] = {frame = frame, animationGroup = animationGroup}
  640. end
  641.  
  642. local AnimateButton = function(self)
  643.     if not self:IsVisible() then return true end
  644.     local animation = animations[animationNum]
  645.     local frame = animation.frame
  646.     local animationGroup = animation.animationGroup
  647.     frame:SetFrameStrata(self:GetFrameStrata())
  648.     frame:SetFrameLevel(self:GetFrameLevel() + 10)
  649.     frame:SetAllPoints(self)
  650.     animationGroup:Stop()
  651.     animationGroup:Play()
  652.     animationNum = (animationNum % animationsCount) + 1
  653.     return true
  654. end
  655.  
  656. hooksecurefunc('MultiActionButtonDown', function(bname, id) AnimateButton(_G[bname..'Button'..id]) end)
  657.  
  658. hooksecurefunc('ActionButtonDown', function(id)
  659.      local button
  660.      if C_PetBattles.IsInBattle() then
  661.           if PetBattleFrame then
  662.                if id > NUM_BATTLE_PET_HOTKEYS then return end
  663.                button = PetBattleFrame.BottomFrame.abilityButtons[id]
  664.                if id == BATTLE_PET_ABILITY_SWITCH then
  665.                     button = PetBattleFrame.BottomFrame.SwitchPetButton;
  666.                elseif id == BATTLE_PET_ABILITY_CATCH then
  667.                     button = PetBattleFrame.BottomFrame.CatchButton;
  668.                end
  669.                if not button then return end
  670.           end
  671.           return
  672.      end
  673.  
  674.      if OverrideActionBar and OverrideActionBar:IsShown() then
  675.           if id > NUM_OVERRIDE_BUTTONS then return end
  676.           button = _G["OverrideActionBarButton"..id]
  677.      else
  678.           button = _G["ActionButton"..id]
  679.      end
  680.      if not button then return end
  681.  
  682.      AnimateButton(button)
  683. end)    
  684. end
  685.  
  686. -- Class colors in arena frames
  687.  
  688. if (cArenas == 1) then
  689. local frame = CreateFrame("FRAME")
  690. frame:RegisterEvent("PLAYER_ENTERING_WORLD")
  691. frame:RegisterEvent("PARTY_MEMBERS_CHANGED")
  692. frame:RegisterEvent("PLAYER_TARGET_CHANGED")
  693. frame:RegisterEvent("PLAYER_FOCUS_CHANGED")
  694. frame:RegisterEvent("ARENA_OPPONENT_UPDATE")
  695. frame:RegisterEvent("PLAYER_CONTROL_GAINED")
  696. frame:RegisterEvent("PLAYER_CONTROL_LOST")
  697. frame:RegisterEvent("ADDON_LOADED");
  698. local function DoArenaColorHook()
  699.         hooksecurefunc("ArenaEnemyFrame_Unlock",
  700.                 function(self)
  701.                         local color=RAID_CLASS_COLORS[select(2,UnitClass(self.unit)) or ""]
  702.                         if color then
  703.                                 self.healthbar:SetStatusBarColor(color.r,color.g,color.b)
  704.                                 self.healthbar.lockColor=true
  705.                         end                                            
  706.                 end
  707.         )
  708. end
  709. local function eventHandler(self, event, arg, ...)
  710.         if event == "ADDON_LOADED" then
  711.                 if arg == "Blizzard_ArenaUI" then
  712.                         self:UnregisterEvent(event);
  713.                         DoArenaColorHook();
  714.                 end
  715.         end            
  716. end
  717. if IsAddOnLoaded("Blizzard_ArenaUI") then
  718.         DoArenaColorHook();
  719. end
  720. frame:SetScript("OnEvent", eventHandler)
  721. end
  722.  
  723. --DRTracker Warlords of Draenor
  724. if (DRTrackerWoD == 1) then
  725. local DRTracker = CreateFrame("Cooldown", "DRTracker", UIParent)
  726. local DRs = {}
  727. local lastChangedFrame = nil
  728. DRTracker:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
  729. DRTracker:RegisterEvent("ADDON_LOADED")
  730. local spellIds = { -- DR Categories listed here http://eu.battle.net/wow/en/forum/topic/11267997531
  731.     -- Many thanks to those that assisted the creation of the original list from LoseControl.
  732.     -- Categories: Stun (1), Silence (2), Disorient/Fear (3), Incapacitate/Polymorph (4), Roots (5)
  733.     -- Death Knight
  734.     [108194] = "Stun",      -- Asphyxiate
  735.     [115001] = "Stun",      -- Remorseless Winter
  736.     [47476]  = "Silence",       -- Strangulate
  737.     [96294]  = "Root",      -- Chains of Ice (Chilblains)
  738.     -- Death Knight Ghoul
  739.     [91800]  = "Stun",      -- Gnaw
  740.     [91797]  = "Stun",      -- Monstrous Blow (Dark Transformation)
  741.     [91807]  = "Root",      -- Shambling Rush (Dark Transformation)
  742.     -- Druid
  743.     [113801] = "Stun",      -- Bash (Force of Nature - Feral Treants)
  744.     [102795] = "Stun",      -- Bear Hug
  745.     [33786]  = "Disorient",     -- Cyclone
  746.     [99]     = "Incap",     -- Disorienting (Incapacitating) Roar
  747.     [22570]  = "Stun",      -- Maim
  748.     [5211]   = "Stun",      -- Mighty Bash
  749.     [163505]   = "Stun",        -- Rake
  750.     [114238] = "Silence",       -- Fae Silence (Glyph of Fae Silence)
  751.     [81261]  = "Silence",       -- Solar Beam
  752.     [339]    = "Root",      -- Entangling Roots
  753.     [113770] = "Root",      -- Entangling Roots (Force of Nature - Balance Treants)
  754.     [19975]  = "Root",      -- Entangling Roots (Nature's Grasp)
  755.     [45334]  = "Root",      -- Immobilized (Wild Charge - Bear)
  756.     [102359] = "Root",      -- Mass Entanglement
  757.     -- Hunter
  758.     [117526] = "Stun",      -- Binding Shot
  759.     [3355]   = "Incap",     -- Freezing Trap
  760.     [1513]   = "Disorient",     -- Scare Beast
  761.     [19386]  = "Incap",     -- Wyvern Sting
  762.     [34490]  = "Silence",       -- Silencing Shot
  763.     [19185]  = "Root",      -- Entrapment
  764.     [64803]  = "Root",      -- Entrapment
  765.     [128405] = "Root",      -- Narrow Escape
  766.     -- Mage
  767.     [118271] = "Stun",      -- Combustion Impact
  768.     [44572]  = "Stun",      -- Deep Freeze
  769.     [31661]  = "Disorient",     -- Dragon's Breath
  770.     [118]    = "Incap",     -- Polymorph
  771.     [61305]  = "Incap",     -- Polymorph: Black Cat
  772.     [28272]  = "Incap",     -- Polymorph: Pig
  773.     [61721]  = "Incap",     -- Polymorph: Rabbit
  774.     [61780]  = "Incap",     -- Polymorph: Turkey
  775.     [28271]  = "Incap",     -- Polymorph: Turtle
  776.     [82691]  = "Incap",     -- Ring of Frost
  777.     [102051] = "Silence",       -- Frostjaw (also a root)
  778.     [122]    = "Root",      -- Frost Nova
  779.     [111340] = "Root",      -- Ice Ward
  780.     -- Mage Water Elemental
  781.     [33395]  = "Root",      -- Freeze
  782.     -- Monk
  783.     [123393] = "Incap",     -- Breath of Fire (Glyph of Breath of Fire)
  784.     [119392] = "Stun",      -- Charging Ox Wave
  785.     [120086] = "Stun",      -- Fists of Fury
  786.     [119381] = "Stun",      -- Leg Sweep
  787.     [115078] = "Incap",     -- Paralysis
  788.     [137460] = "Incap",     -- Silenced (Ring of Peace)
  789.     [116706] = "Root",      -- Disable
  790.     [123407] = "Root",      -- Spinning Fire Blossom
  791.     -- Paladin
  792.     [105421] = "Disorient",     -- Blinding Light
  793.     [115752] = "Stun",      -- Blinding Light (Glyph of Blinding Light)
  794.     [105593] = "Stun",      -- Fist of Justice
  795.     [853]    = "Stun",      -- Hammer of Justice
  796.     [119072] = "Stun",      -- Holy Wrath
  797.     [20066]  = "Incap",     -- Repentance
  798.     [10326]  = "Disorient",     -- Turn Evil
  799.     [145067] = "Disorient",     -- Turn Evil (Evil is a Point of View)
  800.     [31935]  = "Silence",       -- Avenger's Shield
  801.     -- Priest
  802.     [605]    = "Incap",     -- Dominate Mind
  803.     [88625]  = "Incap",     -- Holy Word: Chastise
  804.     [64044]  = "Incap",     -- Psychic Horror
  805.     [8122]   = "Disorient",     -- Psychic Scream
  806.     [113792] = "Disorient",     -- Psychic Terror (Psyfiend)
  807.     [9484]   = "Disorient",     -- Shackle Undead
  808.     [15487]  = "Silence",       -- Silence
  809.     [87194]  = "Root",      -- Glyph of Mind Blast
  810.     [114404] = "Root",      -- Void Tendril's Grasp
  811.     -- Rogue
  812.     [2094]   = "Disorient",     -- Blind
  813.     [1833]   = "Stun",      -- Cheap Shot
  814.     [1776]   = "Incap",     -- Gouge
  815.     [408]    = "Stun",      -- Kidney Shot
  816.     [6770]   = "Incap",     -- Sap
  817.     [1330]   = "Silence",       -- Garrote - Silence
  818.     -- Shaman
  819.     [51514]  = "Incap",     -- Hex
  820.     [118905] = "Stun",      -- Static Charge (Capacitor Totem)
  821.     [64695]  = "Root",      -- Earthgrab (Earthgrab Totem)
  822.     [63685]  = "Root",      -- Freeze (Frozen Power)
  823.     -- Shaman Primal Earth Elemental
  824.     [118345] = "Stun",      -- Pulverize
  825.     -- Warlock
  826.     [710]    = "Incap",     -- Banish
  827.     [137143] = "Incap",     -- Blood Horror
  828.     [5782]   = "Disorient",     -- Fear
  829.     [118699] = "Disorient",     -- Fear
  830.     [130616] = "Disorient",     -- Fear (Glyph of Fear)
  831.     [5484]   = "Disorient",     -- Howl of Terror
  832.     [22703]  = "Stun",      -- Infernal Awakening
  833.     [6789]   = "Incap",     -- Mortal Coil
  834.     [132412] = "Disorient",     -- Seduction (Grimoire of Sacrifice)
  835.     [30283]  = "Stun",      -- Shadowfury
  836.     [132409] = "Silence",       -- Spell Lock (Grimoire of Sacrifice)
  837.     [31117]  = "Silence",       -- Unstable Affliction
  838.     -- Warlock Pets
  839.     [89766]  = "Stun",      -- Axe Toss (Felguard/Wrathguard)
  840.     [115268] = "Disorient",     -- Mesmerize (Shivarra)
  841.     [6358]   = "Disorient",     -- Seduction (Succubus)
  842.     [115782] = "Silence",       -- Optical Blast (Observer)
  843.     [24259]  = "Silence",       -- Spell Lock (Felhunter)
  844.     -- Warrior
  845.     --[7922]   = "Root",        -- Charge Stun
  846.     [5246]   = "Disorient",     -- Intimidating Shout (aoe)
  847.     [20511]  = "Disorient",     -- Intimidating Shout (targeted)
  848.     [132168] = "Stun",      -- Shockwave
  849.     [107570] = "Stun",      -- Storm Bolt
  850.     [132169] = "Stun",      -- Storm Bolt
  851.     [18498]  = "Silence",       -- Silenced - Gag Order (PvE only)
  852.     [107566] = "Root",      -- Staggering Shout
  853.     [105771] = "Root",      -- Warbringer
  854.     -- Other
  855.     [107079] = "Incap",     -- Quaking Palm
  856.     [13327]  = "Stun",      -- Reckless Charge
  857.     [20549]  = "Stun",      -- War Stomp
  858.     [25046]  = "Silence",       -- Arcane Torrent (Energy)
  859.     [28730]  = "Silence",       -- Arcane Torrent (Mana)
  860.     [50613]  = "Silence",       -- Arcane Torrent (Runic Power)
  861.     [69179]  = "Silence",       -- Arcane Torrent (Rage)
  862.     [80483]  = "Silence",       -- Arcane Torrent (Focus)
  863.     [129597] = "Silence",       -- Arcane Torrent (Chi)
  864.     [39965]  = "Root",      -- Frost Grenade
  865.     [55536]  = "Root",      -- Frostweave Net
  866.     [13099]  = "Root",      -- Net-o-Matic
  867. }
  868.  
  869. function DRTracker:GetSpellCategory(spellID) -- Returns CC category of the spellIDs listed above
  870.     return spellID and spellIds[spellID] or nil
  871. end
  872.  
  873. function DRTracker:OnEvent(event, ...) -- Runs things, and stuff.
  874.     self[event](self, ...)
  875. end
  876. DRTracker:SetScript("OnEvent", DRTracker.OnEvent)
  877.  
  878. function DRTracker:ADDON_LOADED(addonName) -- Anchor DR trackers
  879.     if addonName == "Blizzard_ArenaUI" then
  880.         local arenaFrame
  881.         for i = 1, 5 do
  882.         arenaFrame = "ArenaEnemyFrame"..i
  883.         --local loc = -30 -- (Depreciated) Distance between the left edge of each frame. Should match the width of the frame.
  884.             for j = 1, 5 do
  885.                 local DR = CreateFrame("Frame", arenaFrame.."DR"..j, ArenaEnemyFrames)
  886.                 DR:ClearAllPoints()
  887.                 DR:SetPoint("BOTTOMRIGHT", arenaFrame, "TOPLEFT", 0, -10)
  888.                 DR:SetSize(24, 24) -- (Width, Height) of each frame. A perfect square is preferable, otherwise the spell icon will look stretched.
  889.                 DR.border = DR:CreateTexture(nil, "LOW")
  890.                 DR.border:SetAllPoints()
  891.                 DR.border:SetTexture("Interface\\BUTTONS\\UI-Quickslot-Depress.png")
  892.                 DR.icon = DR:CreateTexture(nil, "BACKGROUND")
  893.                 DR.shown = false
  894.                 DR.severity = 1
  895.                 DR.unit = i
  896.                 DR.cate = j
  897.                 DR.applied = 0
  898.                 DR.sweep = CreateFrame("Cooldown", nil, DR, "CooldownFrameTemplate")
  899.                 DR.sweep:ClearAllPoints()
  900.                 DR.sweep:SetAllPoints(DR)
  901.                 local function OnShow(self)
  902.                     local curX = 0
  903.                     for b=1,5 do
  904.                         local curFrame = DRs["arena"..DR.unit..b]
  905.                         if curFrame.shown == true and b ~= self.cate then
  906.                             curX = curX - 30
  907.                         end
  908.                     end
  909.                     self:ClearAllPoints()
  910.                     self:SetPoint("BOTTOMRIGHT", "ArenaEnemyFrame"..self.unit, "TOPLEFT", curX, -10)
  911.                     self.shown = true
  912.                     self.applied = GetTime()
  913.                 end
  914.                 DR:HookScript("OnShow", OnShow)
  915.  
  916.                 local function OnHide(self)
  917.                     for b = 1,5 do
  918.                         local curFrame = DRs["arena"..self.unit..b]
  919.                         if curFrame and curFrame.shown == true and curFrame.applied > self.applied then
  920.                             local _, _, _, x = curFrame:GetPoint(1)
  921.                             curFrame:ClearAllPoints()
  922.                             curFrame:SetPoint("BOTTOMRIGHT", "ArenaEnemyFrame"..curFrame.unit, "TOPLEFT", x+30, -10)
  923.                         end
  924.                     end
  925.                     self:ClearAllPoints()
  926.                     self:SetPoint("BOTTOMRIGHT", "ArenaEnemyFrame"..self.unit, "TOPLEFT", 0, -10)
  927.                 end
  928.                 DR:HookScript("OnHide", OnHide)
  929.                
  930.                 local function DREnd(self, elapsed)
  931.                     if self.sweep:GetCooldownDuration() == 0 and self.shown == true then
  932.                         self:Hide()
  933.                         self.shown = false
  934.                         self.severity = 1
  935.                     end
  936.                 end
  937.                 DR:HookScript("OnUpdate", DREnd)
  938.                
  939.                 DR:Hide()
  940.                 DRs["arena"..i..j] = DR
  941.             end
  942.         end
  943.     end
  944. end
  945.  
  946. function DRTracker:SetTexture(Frame, spellID) -- Sets displayed icon to last spell.
  947.     if Frame.shown == true then
  948.         Frame.dur = Frame.sweep:GetCooldownDuration()
  949.         Frame:Hide()
  950.     end
  951.     lastChangedFrame = Frame
  952.     local _, _, icon, _, _, _, _, _, _ = GetSpellInfo(spellID)
  953.     Frame.icon:ClearAllPoints()
  954.     Frame.icon:SetAllPoints()
  955.     Frame.icon:SetTexture(icon)
  956.     Frame:Show()
  957.     if Frame.severity == 1 then
  958.         Frame.border:SetVertexColor(1, 1, 0, 1)
  959.         Frame.severity = 2
  960.     elseif Frame.severity == 2 then
  961.         Frame.border:SetVertexColor(1, .4, 0, 1)
  962.         Frame.severity = 3
  963.     elseif Frame.severity == 3 then
  964.         Frame.border:SetVertexColor(1, 0, 0, 1)
  965.     end
  966. end
  967.  
  968. function DRTracker:TimerStart(GUID, spellID, spellName) -- Primary function; begins CD sweep and icon updates. Not a good idea to edit any of this.
  969.     local _, instanceType = IsInInstance()
  970.     if instanceType ~= "arena" then
  971.         return
  972.     end
  973.     local cat = DRTracker:GetSpellCategory(spellID)
  974.     if(UnitGUID("arena1") == GUID) then
  975.         local name, rank, icon, count, dispelType, duration, expires, caster, isStealable, shouldConsolidate, spellID, canApplyAura, isBossDebuff, value1, value2, value3 = UnitDebuff("arena1", spellName)
  976.         if(cat=="Stun") then
  977.             DRTracker:SetTexture(DRs["arena1"..1], spellID)
  978.             CooldownFrame_SetTimer(DRs["arena1"..1].sweep, GetTime(), 17+duration, 1)
  979.         elseif(cat=="Silence") then
  980.             DRTracker:SetTexture(DRs["arena1"..2], spellID)
  981.             CooldownFrame_SetTimer(DRs["arena1"..2].sweep, GetTime(), 17+duration, 1)
  982.         elseif(cat=="Disorient") then
  983.             DRTracker:SetTexture(DRs["arena1"..3], spellID)
  984.             CooldownFrame_SetTimer(DRs["arena1"..3].sweep, GetTime(), 17+duration, 1)
  985.         elseif(cat=="Incap") then
  986.             DRTracker:SetTexture(DRs["arena1"..4], spellID)
  987.             CooldownFrame_SetTimer(DRs["arena1"..4].sweep, GetTime(), 17+duration, 1)
  988.         else
  989.             DRTracker:SetTexture(DRs["arena1"..5], spellID)
  990.             CooldownFrame_SetTimer(DRs["arena1"..5].sweep, GetTime(), 17+duration, 1)
  991.         end
  992.     elseif(UnitGUID("arena2") == GUID) then
  993.     local name, rank, icon, count, dispelType, duration, expires, caster, isStealable, shouldConsolidate, spellID, canApplyAura, isBossDebuff, value1, value2, value3 = UnitDebuff("arena2", spellName)
  994.         if(cat=="Stun") then
  995.             DRTracker:SetTexture(DRs["arena2"..1], spellID)
  996.             CooldownFrame_SetTimer(DRs["arena2"..1].sweep, GetTime(), 17+duration, 1)
  997.         elseif(cat=="Silence") then
  998.             DRTracker:SetTexture(DRs["arena2"..2], spellID)
  999.             CooldownFrame_SetTimer(DRs["arena2"..2].sweep, GetTime(), 17+duration, 1)
  1000.         elseif(cat=="Disorient") then
  1001.             DRTracker:SetTexture(DRs["arena2"..3], spellID)
  1002.             CooldownFrame_SetTimer(DRs["arena2"..3].sweep, GetTime(), 17+duration, 1)
  1003.         elseif(cat=="Incap") then
  1004.             DRTracker:SetTexture(DRs["arena2"..4], spellID)
  1005.             CooldownFrame_SetTimer(DRs["arena2"..4].sweep, GetTime(), 17+duration, 1)
  1006.         else
  1007.             DRTracker:SetTexture(DRs["arena2"..5], spellID)
  1008.             CooldownFrame_SetTimer(DRs["arena2"..5].sweep, GetTime(), 17+duration, 1)
  1009.         end
  1010.     elseif(UnitGUID("arena3") == GUID) then
  1011.     local name, rank, icon, count, dispelType, duration, expires, caster, isStealable, shouldConsolidate, spellID, canApplyAura, isBossDebuff, value1, value2, value3 = UnitDebuff("arena3", spellName)
  1012.         if(cat=="Stun") then
  1013.             DRTracker:SetTexture(DRs["arena3"..1], spellID)
  1014.             CooldownFrame_SetTimer(DRs["arena3"..1].sweep, GetTime(), 17+duration, 1)
  1015.         elseif(cat=="Silence") then
  1016.             DRTracker:SetTexture(DRs["arena3"..2], spellID)
  1017.             CooldownFrame_SetTimer(DRs["arena3"..2].sweep, GetTime(), 17+duration, 1)
  1018.         elseif(cat=="Disorient") then
  1019.             DRTracker:SetTexture(DRs["arena3"..3], spellID)
  1020.             CooldownFrame_SetTimer(DRs["arena3"..3].sweep, GetTime(), 17+duration, 1)
  1021.         elseif(cat=="Incap") then
  1022.             DRTracker:SetTexture(DRs["arena3"..4], spellID)
  1023.             CooldownFrame_SetTimer(DRs["arena3"..4].sweep, GetTime(), 17+duration, 1)
  1024.         else
  1025.             DRTracker:SetTexture(DRs["arena3"..5], spellID)
  1026.             CooldownFrame_SetTimer(DRs["arena3"..5].sweep, GetTime(), 17+duration, 1)
  1027.         end
  1028.     elseif(UnitGUID("arena4") == GUID) then
  1029.     local name, rank, icon, count, dispelType, duration, expires, caster, isStealable, shouldConsolidate, spellID, canApplyAura, isBossDebuff, value1, value2, value3 = UnitDebuff("arena4", spellName)
  1030.         if(cat=="Stun") then
  1031.             DRTracker:SetTexture(DRs["arena4"..1], spellID)
  1032.             CooldownFrame_SetTimer(DRs["arena4"..1].sweep, GetTime(), 17+duration, 1)
  1033.         elseif(cat=="Silence") then
  1034.             DRTracker:SetTexture(DRs["arena4"..2], spellID)
  1035.             CooldownFrame_SetTimer(DRs["arena4"..2].sweep, GetTime(), 17+duration, 1)
  1036.         elseif(cat=="Disorient") then
  1037.             DRTracker:SetTexture(DRs["arena4"..3], spellID)
  1038.             CooldownFrame_SetTimer(DRs["arena4"..3].sweep, GetTime(), 17+duration, 1)
  1039.         elseif(cat=="Incap") then
  1040.             DRTracker:SetTexture(DRs["arena4"..4], spellID)
  1041.             CooldownFrame_SetTimer(DRs["arena4"..4].sweep, GetTime(), 17+duration, 1)
  1042.         else
  1043.             DRTracker:SetTexture(DRs["arena4"..5], spellID)
  1044.             CooldownFrame_SetTimer(DRs["arena4"..5].sweep, GetTime(), 17+duration, 1)
  1045.         end
  1046.     elseif(UnitGUID("arena5") == GUID) then
  1047.         local name, rank, icon, count, dispelType, duration, expires, caster, isStealable, shouldConsolidate, spellID, canApplyAura, isBossDebuff, value1, value2, value3 = UnitDebuff("arena5", spellName)
  1048.         if(cat=="Stun") then
  1049.             DRTracker:SetTexture(DRs["arena5"..1], spellID)
  1050.             CooldownFrame_SetTimer(DRs["arena5"..1].sweep, GetTime(), 17+duration, 1)
  1051.         elseif(cat=="Silence") then
  1052.             DRTracker:SetTexture(DRs["arena5"..2], spellID)
  1053.             CooldownFrame_SetTimer(DRs["arena5"..2].sweep, GetTime(), 17+duration, 1)
  1054.         elseif(cat=="Disorient") then
  1055.             DRTracker:SetTexture(DRs["arena5"..3], spellID)
  1056.             CooldownFrame_SetTimer(DRs["arena5"..3].sweep, GetTime(), 17+duration, 1)
  1057.         elseif(cat=="Incap") then
  1058.             DRTracker:SetTexture(DRs["arena5"..4], spellID)
  1059.             CooldownFrame_SetTimer(DRs["arena5"..4].sweep, GetTime(), 17+duration, 1)
  1060.         else
  1061.             DRTracker:SetTexture(DRs["arena5"..5], spellID)
  1062.             CooldownFrame_SetTimer(DRs["arena5"..5].sweep, GetTime(), 17+duration, 1)
  1063.         end
  1064.     end
  1065.     return
  1066. end
  1067.  
  1068. function DRTracker:GetDRs()
  1069.     return DRTracker and DRs
  1070. end
  1071.  
  1072. function DRTracker:COMBAT_LOG_EVENT_UNFILTERED(timeStamp, eventType, hideCaster, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags, spellID, spellName, spellSchool, auraType)
  1073.     if eventType == "SPELL_AURA_APPLIED" or eventType == "SPELL_AURA_REFRESH" then -- Crowd control landed, time to do stuff.
  1074.         if auraType == "DEBUFF" and DRTracker:GetSpellCategory(spellID) then
  1075.             DRTracker:TimerStart(destGUID, spellID, spellName)
  1076.         end
  1077.     end
  1078. end
  1079. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement