Advertisement
wit4er

Autoscript 6.0.3

Nov 7th, 2014
356
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 56.49 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 = 0
  8. local LoCRemover = 1
  9. local ArenaTrinkets = 0
  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 cArenas = 1
  17. local DRTrackerWoD = 1
  18. --//config
  19. --[[enemy cooldowns ]]
  20. if (EnemyCooldowns == 1) then
  21.  
  22. USS="UNIT_SPELLCAST_SUCCEEDED";OE="OnEvent";F="Frame";CF=CreateFrame;BO="Border";xb=630;yb=320;sb=24;ib=1;ii=1  
  23. 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
  24. 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
  25. 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
  26. --rogue
  27. 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);
  28. 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);
  29. 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);
  30. 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);
  31. 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);
  32. 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);
  33. 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);
  34. 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);
  35. 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);
  36. 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);
  37.  
  38. --warlock
  39. 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);
  40. 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);
  41. 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);
  42. 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);
  43. 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);
  44. 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);
  45. 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);
  46. 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);
  47. 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);
  48.  
  49.  
  50. --mage
  51. 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);
  52. 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);
  53. 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);
  54. 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);
  55. 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);
  56. 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);
  57.  
  58. --dk
  59. 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);
  60. 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);
  61. 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);
  62. 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);
  63. 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);
  64. 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);
  65. 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);
  66. 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);
  67. 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);
  68. 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);
  69.  
  70.  
  71. --priest
  72. 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);
  73. 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);
  74. 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);
  75. 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);
  76. 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);
  77. 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);
  78.  
  79. --paladin
  80. 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);
  81. 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);
  82. 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);
  83. 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);
  84. 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);
  85. 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);
  86. 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);
  87. 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);
  88.  
  89. --warrior
  90. 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);
  91. 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);
  92. 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);
  93. 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);
  94. 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);
  95. 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);
  96. 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);
  97. 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);
  98. 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);
  99. 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);
  100. 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);
  101.  
  102. --druid
  103. 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);
  104. 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);
  105. 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);
  106. 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);
  107. 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);
  108. 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);
  109. 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);
  110. 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);
  111. 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);
  112. 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);
  113. 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);
  114.  
  115. --shaman
  116. 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);
  117. 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);
  118. 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);
  119. 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);
  120. 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);
  121. 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);
  122. 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);
  123. 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);
  124. 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);
  125. 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);
  126. 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);
  127.  
  128. --hunter
  129. 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);
  130. 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);
  131. 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);
  132. 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);
  133. 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);
  134.  
  135. --monk
  136. 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);
  137. 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);
  138. 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);
  139.  
  140. end
  141.  
  142.  
  143.  
  144.  
  145.  
  146. --[[FCTtweaks]]
  147. if (FCTtweaks == 1) then
  148. CompactRaidFrameContainer:SetScale(0.85)
  149. ObjectiveTrackerFrame:SetScale(0.75)
  150. ObjectiveTrackerBlocksFrame.QuestHeader:SetAlpha(0)
  151. hooksecurefunc("PlayerFrame_ResetPosition", function(self)
  152.  self:ClearAllPoints()
  153.  self:SetPoint("CENTER", -370, 70)
  154.  TargetFrame:ClearAllPoints()
  155.  TargetFrame:SetPoint("BOTTOMRIGHT",PlayerFrame,100,-45)
  156.  FocusFrame:ClearAllPoints()
  157.  FocusFrame:SetPoint("BOTTOMRIGHT",PlayerFrame,750,0)
  158. end)
  159.  StanceButton1:ClearAllPoints()
  160.  StanceButton1:SetPoint("BOTTOMLEFT",MultiBarBottomLeftButton2,-500,0)
  161.  StanceButton1.SetPoint = function() end
  162. local frame = CreateFrame("FRAME", "DefaultUIScrips")
  163. frame:RegisterEvent("PLAYER_ENTERING_WORLD")
  164.      local function eventHandler(self, event, ...)
  165.         LARGE_NUMBER_SEPERATOR = ""
  166.         --UIErrorsFrame:UnregisterEvent("UI_ERROR_MESSAGE")
  167.         UIErrorsFrame:SetScale(0.7)
  168.         COMBAT_TEXT_TYPE_INFO.PERIODIC_HEAL_ABSORB.show = nil
  169.         COMBAT_TEXT_TYPE_INFO.PERIODIC_HEAL.show = nil
  170.         COMBAT_TEXT_TYPE_INFO.PERIODIC_HEAL_CRIT.show = nil
  171.         --COMBAT_TEXT_TYPE_INFO.HEAL_CRIT.show = nil
  172.         --COMBAT_TEXT_TYPE_INFO.HEAL.show = nil
  173.         --COMBAT_TEXT_TYPE_INFO.HEAL_CRIT_ABSORB.show = nil
  174.         --COMBAT_TEXT_TYPE_INFO.HEAL_ABSORB.show = nil
  175.         COMBAT_TEXT_TYPE_INFO.ABSORB.show = nil
  176.         COMBAT_TEXT_TYPE_INFO.SPELL_ABSORB.show = nil
  177.         COMBAT_TEXT_TYPE_INFO["ENTERING_COMBAT"].r = 1
  178.         COMBAT_TEXT_TYPE_INFO["ENTERING_COMBAT"].g = 0.82
  179.         COMBAT_TEXT_TYPE_INFO["ENTERING_COMBAT"].b = 0
  180.         COMBAT_TEXT_TYPE_INFO["LEAVING_COMBAT"].r = 1
  181.         COMBAT_TEXT_TYPE_INFO["LEAVING_COMBAT"].g = 0.82
  182.         COMBAT_TEXT_TYPE_INFO["LEAVING_COMBAT"].b = 0
  183.         PlayerHitIndicator:SetFont("Fonts\\font.ttf",30)           
  184. end
  185. frame:SetScript("OnEvent", eventHandler)
  186. --[[combat text font ]]
  187. local fontName = "Fonts\\font.ttf"
  188. local fontHeight = 40
  189. local fFlags = ""
  190. local function FS_SetFont()
  191.     DAMAGE_TEXT_FONT = fontName
  192.     COMBAT_TEXT_HEIGHT = fontHeight
  193.     COMBAT_TEXT_CRIT_MAXHEIGHT = fontHeight + 2
  194.     COMBAT_TEXT_CRIT_MINHEIGHT = fontHeight - 2
  195.     local fName, fHeight, fFlags = CombatTextFont:GetFont()
  196.     CombatTextFont:SetFont(fontName, fontHeight, fFlags)
  197. end
  198. FS_SetFont()
  199. --[[combat text location]]
  200. local f = CreateFrame("FRAME");
  201. f:SetScript("OnEvent", function(self,event,...)
  202. local arg1 =...;        
  203.      if (arg1=="Blizzard_CombatText") then
  204.         f:UnregisterEvent("ADDON_LOADED");
  205.         hooksecurefunc("CombatText_UpdateDisplayedMessages",
  206.         function ()
  207.         COMBAT_TEXT_LOCATIONS =
  208.         {startX  = 0,
  209.         --startY = 384 * COMBAT_TEXT_Y_SCALE, endX =0,endY = 159 * COMBAT_TEXT_Y_SCALE};
  210.         startY = 164 * COMBAT_TEXT_Y_SCALE, endX =0,endY = 80 * COMBAT_TEXT_Y_SCALE};          
  211. end)end end)
  212. f:RegisterEvent("ADDON_LOADED");
  213. end
  214.  
  215. --[[macro/binds]]
  216. if (Macro == 1) then
  217. hooksecurefunc('ActionButton_UpdateHotkeys', function(self)
  218.     local macro, hotkey = _G[self:GetName()..'Name'], _G[self:GetName()..'HotKey']
  219.     if macro and hotkey then macro:Hide() hotkey:Hide() end
  220. end)
  221. end
  222.  
  223. if (UnitFrames == 1) then
  224. --[[player frame tweaks]]
  225. hooksecurefunc("PlayerFrame_UpdateStatus", function()
  226. if IsResting("player") then PlayerStatusTexture:Hide()PlayerRestIcon:Hide()PlayerRestGlow:Hide()PlayerStatusGlow:Hide()
  227. elseif PlayerFrame.inCombat then PlayerStatusTexture:Hide()PlayerAttackIcon:Show()PlayerRestIcon:Hide()PlayerAttackGlow:Hide()
  228. PlayerRestGlow:Hide()PlayerStatusGlow:Hide()PlayerAttackBackground:Hide() end end)
  229. --[[ background tweaks ]]
  230. hooksecurefunc('TargetFrame_CheckFaction', function(self)
  231.   if ( not UnitPlayerControlled(self.unit)
  232.   and UnitIsTapped(self.unit)
  233.   and not UnitIsTappedByPlayer(self.unit)
  234.   and not UnitIsTappedByAllThreatList(self.unit) ) then
  235.     self.nameBackground:SetVertexColor(0.0, 0.0, 0.0, 0.5);
  236.     if ( self.portrait ) then
  237.       self.portrait:SetVertexColor(0.5, 0.5, 0.5);
  238.     end
  239.   else
  240.     self.nameBackground:SetVertexColor(0.0, 0.0, 0.0, 0.5);
  241.     if ( self.portrait ) then
  242.       self.portrait:SetVertexColor(1.0, 1.0, 1.0);
  243.     end
  244.   end  
  245. end)
  246. --[[ hp ]]
  247. local f=function(v)if(v>=1e4) then return ('%.1fk'):format(v/1e3):gsub('%.?0+([km])$','%1')  else return v end end
  248.         hooksecurefunc("TextStatusBar_UpdateTextString",function(s)
  249.         if not GetCVarBool("statusTextPercentage") then
  250.             if s.TextString and s.currValue then
  251.             s.TextString:SetText(f(s.currValue))           
  252.           end
  253.      end
  254. end)
  255. --[[class colored hp bars ]]
  256. local UnitIsPlayer,UnitIsConnected, UnitClass, RAID_CLASS_COLORS = UnitIsPlayer,UnitIsConnected,UnitClass, RAID_CLASS_COLORS
  257. local _, class, c
  258. local function colour(statusbar, unit, name)
  259.       if UnitIsPlayer(unit) and UnitIsConnected(unit) and unit == statusbar.unit and UnitClass(unit) then
  260.           _, class = UnitClass(unit) c = CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[class] or RAID_CLASS_COLORS[class]
  261.           statusbar:SetStatusBarColor(c.r, c.g, c.b)         
  262.           statusbar = _G["PlayerFrame".."HealthBar"]:SetStatusBarColor(0.1, 1.0, 0.1)--playerframe fix   
  263.       end    
  264. end
  265. hooksecurefunc("UnitFrameHealthBar_Update", colour)
  266. hooksecurefunc("HealthBar_OnValueChanged", function(self)colour(self, self.unit)end)
  267. --[[class colored names]]--
  268. hooksecurefunc("UnitFrame_Update", function(self)
  269. if UnitClass(self.unit) then
  270. local c = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[select(2,UnitClass(self.unit))]
  271. self.name:SetTextColor(c.r,c.g,c.b,1) self.name:SetFont("Fonts\\font.ttf", 13)end end)
  272. end
  273.  
  274. --[[Loss-Of-Control Remover  ]]
  275. if (LoCRemover == 1) then
  276. select(1,LossOfControlFrame:GetRegions()):SetAlpha(0)
  277. select(2,LossOfControlFrame:GetRegions()):SetAlpha(0)
  278. select(3,LossOfControlFrame:GetRegions()):SetAlpha(0)
  279. select(5,LossOfControlFrame:GetRegions()):SetAlpha(0)
  280. --[[hooksecurefunc("CooldownFrame_SetTimer", function(self)
  281.     if self.currentCooldownType == COOLDOWN_TYPE_LOSS_OF_CONTROL then
  282.         self:SetCooldown(0, 0)
  283.     end
  284. end)]]--
  285. hooksecurefunc('CooldownFrame_SetTimer',function(self)
  286. if self.currentCooldownType == COOLDOWN_TYPE_LOSS_OF_CONTROL then
  287. self:SetEdgeTexture("Interface\\Cooldown\\cooldown2");
  288. self:SetCooldown(4500,4500);
  289. self:SetSwipeColor(0.35,0.25,0.25,0);
  290. end
  291. end)
  292. end
  293.  
  294. --[[arena/bg trinkets]]
  295. if (ArenaTrinkets == 1) then
  296. local trinkets = {}
  297. local events = CreateFrame("Frame")
  298. function events:ADDON_LOADED(addonName)
  299. if addonName ~= "Blizzard_ArenaUI" then
  300. return
  301. end
  302. ArenaEnemyFrame1:ClearAllPoints()
  303. ArenaEnemyFrame1:SetPoint("CENTER", nil, "CENTER", 345.0, 175.0)
  304. ArenaEnemyFrame1.SetPoint = function() end
  305. ArenaEnemyFrame2:ClearAllPoints()
  306. ArenaEnemyFrame2:SetPoint("BOTTOMLEFT", ArenaEnemyFrame1, "BOTTOMLEFT", 0, -50)
  307. ArenaEnemyFrame2.SetPoint = function() end
  308. ArenaEnemyFrame3:ClearAllPoints()
  309. ArenaEnemyFrame3:SetPoint("BOTTOMLEFT", ArenaEnemyFrame1, "BOTTOMLEFT", 0, -100)
  310. ArenaEnemyFrame3.SetPoint = function() end
  311. ArenaEnemyFrame4:ClearAllPoints()
  312. ArenaEnemyFrame4:SetPoint("BOTTOMLEFT", ArenaEnemyFrame1, "BOTTOMLEFT", 0, -150)
  313. ArenaEnemyFrame4.SetPoint = function() end
  314. ArenaEnemyFrame5:ClearAllPoints()
  315. ArenaEnemyFrame5:SetPoint("BOTTOMLEFT", ArenaEnemyFrame1, "BOTTOMLEFT", 0, -200)
  316. ArenaEnemyFrame5.SetPoint = function() end
  317. ArenaPrepFrame1:ClearAllPoints()
  318. ArenaPrepFrame1:SetPoint("CENTER", nil, "CENTER", 345.0, 175.0)
  319. ArenaPrepFrame1.SetPoint = function() end
  320. ArenaPrepFrame2:ClearAllPoints()
  321. ArenaPrepFrame2:SetPoint("TOPRIGHT", ArenaPrepFrame1, "TOPRIGHT", 0, -50)
  322. ArenaPrepFrame2.SetPoint = function() end
  323. ArenaPrepFrame3:ClearAllPoints()
  324. ArenaPrepFrame3:SetPoint("TOPRIGHT", ArenaPrepFrame1, "TOPRIGHT", 0, -100)
  325. ArenaPrepFrame3.SetPoint = function() end
  326. ArenaPrepFrame4:ClearAllPoints()
  327. ArenaPrepFrame4:SetPoint("TOPRIGHT", ArenaPrepFrame1, "TOPRIGHT", 0, -150)
  328. ArenaPrepFrame4.SetPoint = function() end
  329. ArenaPrepFrame5:ClearAllPoints()
  330. ArenaPrepFrame5:SetPoint("TOPRIGHT", ArenaPrepFrame1, "TOPRIGHT", 0, -200)
  331. ArenaPrepFrame5.SetPoint = function() end
  332. local arenaFrame, trinket
  333. for i = 1, MAX_ARENA_ENEMIES do
  334. arenaFrame = "ArenaEnemyFrame"..i
  335. trinket = CreateFrame("Cooldown", nil,arenaFrame.."Trinket", ArenaEnemyFrames)
  336. trinket:SetPoint("TOPRIGHT", arenaFrame, 30, -6)
  337. trinket:SetSize(27, 27)
  338. trinket.icon = trinket:CreateTexture(nil, "BACKGROUND")
  339. trinket.icon:SetAllPoints()
  340. trinket.icon:SetTexture("Interface\\Icons\\inv_jewelry_trinketpvp_01")
  341. trinket:Hide()
  342. trinkets["arena"..i] = trinket
  343. end
  344. self:UnregisterEvent("ADDON_LOADED")
  345. end
  346. function events:UNIT_SPELLCAST_SUCCEEDED(unitID, spell, rank, lineID, spellID)
  347. if not trinkets[unitID] then
  348. return
  349. end
  350. if spellID == 59752 or spellID == 42292 then
  351. CooldownFrame_SetTimer(trinkets[unitID], GetTime(), 120, 1)
  352. SendChatMessage("Trinket used by: "..GetUnitName(unitID, true), "PARTY")
  353. elseif spellID == 7744 then
  354. CooldownFrame_SetTimer(trinkets[unitID], GetTime(), 45, 1)
  355. SendChatMessage("WotF used by: "..GetUnitName(unitID, true), "PARTY")
  356. end
  357. end
  358. function events:PLAYER_ENTERING_WORLD()
  359. local _, instanceType = IsInInstance()
  360. if instanceType == "arena" then
  361. self:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")
  362. elseif self:IsEventRegistered("UNIT_SPELLCAST_SUCCEEDED") then
  363. self:UnregisterEvent("UNIT_SPELLCAST_SUCCEEDED")
  364. for _, trinket in pairs(trinkets) do
  365. trinket:SetCooldown(0, 0)
  366. trinket:Hide()
  367. end
  368. end
  369. end
  370. events:SetScript("OnEvent", function(self, event, ...) return self[event](self, ...) end)
  371. events:RegisterEvent("ADDON_LOADED")
  372. events:RegisterEvent("PLAYER_ENTERING_WORLD")
  373. SLASH_TESTAEF1 = "/testaef"
  374. SlashCmdList["TESTAEF"] = function(msg, editBox)
  375. if not IsAddOnLoaded("Blizzard_ArenaUI") then
  376. LoadAddOn("Blizzard_ArenaUI")
  377. end
  378. ArenaEnemyFrames:Show()
  379. local arenaFrame
  380. for i = 1, 5 do
  381. arenaFrame = _G["ArenaEnemyFrame"..i]
  382. arenaFrame.classPortrait:SetTexture("Interface\\TargetingFrame\\UI-Classes-Circles")
  383. arenaFrame.classPortrait:SetTexCoord(unpack(CLASS_ICON_TCOORDS["WARRIOR"]))
  384. arenaFrame.name:SetText("Dispelme")
  385. arenaFrame:Show()
  386. CooldownFrame_SetTimer(trinkets["arena"..i], GetTime(), 120, 1)
  387. end
  388. end
  389. events:SetScript("OnEvent", function(self, event, ...) return self[event](self, ...) end)
  390. events:RegisterEvent("ADDON_LOADED")
  391. events:RegisterEvent("PLAYER_ENTERING_WORLD")
  392. end
  393. --diminishing returns
  394.  
  395. --rogue drtracker
  396. if (RogueDR == 1) then
  397. USD="UNIT_SPELLCAST_SUCCEEDED";OT="OnEvent";FR="Frame";RF=CreateFrame;RD="Border";UE=UnitName
  398. CS=RF(FR) CS.c=RF("Cooldown","CST",CS.t,"CooldownFrameTemplate") CS.c:SetDrawEdge(false)CS:RegisterEvent(USD)
  399. 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")
  400. 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)
  401. SP=RF(FR) SP.c=RF("Cooldown","SAP",SP.t,"CooldownFrameTemplate") SP.c:SetDrawEdge(false) SP:RegisterEvent(USD)
  402. 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")
  403. 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)
  404. --[[GR=RF(FR) GR.c=RF("Cooldown","GAR",GR.t,"CooldownFrameTemplate") GR.c:SetDrawEdge(false) GR:RegisterEvent(USD)
  405. 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")
  406. GR:SetScript(OT,function(self,event,...)if UE(select(1,...))==UE("player")and select(5,...)==703 then GAR:SetCooldown(GetTime(),23)end end) ]]--
  407. -- snd tracker
  408. local snd = CreateFrame("Cooldown", nil, PlayerFrame, "CooldownFrameTemplate")
  409. snd:SetDrawEdge(false)
  410. snd:ClearAllPoints()
  411. snd:SetPoint("BOTTOMRIGHT",PlayerFrame,115,6)
  412. snd:SetSize(34,34)
  413. snd.Icon = CreateFrame("Frame", nil, snd)
  414. snd.Icon:SetFrameLevel(snd:GetFrameLevel() - 1)
  415. snd:SetFrameStrata("HIGH")
  416. snd.Icon:SetAllPoints()
  417. snd.Icon.Texture = snd.Icon:CreateTexture(nil, "ARTWORK")
  418. snd.Icon.Texture:SetPoint("BOTTOMRIGHT",PlayerFrame,115,6)
  419. snd.Icon.Texture:SetSize(34,34)
  420. snd.Icon.Texture:SetTexture("Interface\\Icons\\ability_rogue_slicedice")
  421. snd.Icon.Border = CreateFrame("Frame", nil, snd.Icon)
  422. snd.Icon.Border:SetAllPoints()
  423. snd.Icon.Border.Texture = snd.Icon.Border:CreateTexture(nil, Border)
  424. snd:RegisterEvent("UNIT_AURA")
  425. snd:SetScript("OnEvent", function(self, event, unit)
  426. snd.CheckAura(unit)
  427. end)
  428. function snd.CheckAura(unit)
  429. local spellname = GetSpellInfo(5171)
  430. local _, _, _, _, _, duration, expirationTime, unitCaster, _, _, id = UnitBuff("player", spellname)
  431. if id and unitCaster == "player" then
  432. snd:Show()
  433. snd:SetCooldown(expirationTime - duration - 0.5, duration)
  434. return
  435. end
  436. snd:Hide()
  437. end
  438. -- recuperate tracker
  439. local recup = CreateFrame("Cooldown", nil, PlayerFrame, "CooldownFrameTemplate")
  440. recup:SetDrawEdge(false)
  441. recup:ClearAllPoints()
  442. recup:SetPoint("BOTTOMRIGHT",PlayerFrame,115,40)
  443. recup:SetSize(34,34)
  444. recup.Icon = CreateFrame("Frame", nil, recup)
  445. recup.Icon:SetFrameLevel(recup:GetFrameLevel() - 1)
  446. recup:SetFrameStrata("HIGH")
  447. recup.Icon:SetAllPoints()
  448. recup.Icon.Texture = recup.Icon:CreateTexture(nil, "ARTWORK")
  449. recup.Icon.Texture:SetPoint("BOTTOMRIGHT",PlayerFrame,115,40)
  450. recup.Icon.Texture:SetSize(34,34)
  451. recup.Icon.Texture:SetTexture("Interface\\Icons\\ability_rogue_recuperate")
  452. recup.Icon.Border = CreateFrame("Frame", nil, recup.Icon)
  453. recup.Icon.Border:SetAllPoints()
  454. recup.Icon.Border.Texture = recup.Icon.Border:CreateTexture(nil, Border)
  455. recup:RegisterEvent("UNIT_AURA")
  456. recup:SetScript("OnEvent", function(self, event, unit)
  457. recup.CheckAura(unit)
  458. end)
  459. function recup.CheckAura(unit)
  460. local spellname = GetSpellInfo(73651)
  461. local _, _, _, _, _, duration, expirationTime, unitCaster, _, _, id = UnitBuff("player", spellname)
  462. if id and unitCaster == "player" then
  463. recup:Show()
  464. recup:SetCooldown(expirationTime - duration - 0.5, duration)
  465. return
  466. end
  467. recup:Hide()
  468. end
  469.  
  470. --vendetta tracker
  471. local vend = CreateFrame("Cooldown", nil, PlayerFrame, "CooldownFrameTemplate")
  472. vend:SetDrawEdge(false)
  473. vend:ClearAllPoints()
  474. vend:SetPoint("BOTTOMRIGHT",PlayerFrame,149,6)
  475. vend:SetSize(34,34)
  476. vend.Icon = CreateFrame("Frame", nil, vend)
  477. vend.Icon:SetFrameLevel(vend:GetFrameLevel() - 1)
  478. vend:SetFrameStrata("HIGH")
  479. vend.Icon:SetAllPoints()
  480. vend.Icon.Texture = vend.Icon:CreateTexture(nil, "ARTWORK")
  481. vend.Icon.Texture:SetPoint("BOTTOMRIGHT",PlayerFrame,149,6)
  482. vend.Icon.Texture:SetSize(34,34)
  483. vend.Icon.Texture:SetTexture("Interface\\Icons\\ability_rogue_deadliness")
  484. vend.Icon.Border = CreateFrame("Frame", nil, vend.Icon)
  485. vend.Icon.Border:SetAllPoints()
  486. vend.Icon.Border.Texture = vend.Icon.Border:CreateTexture(nil, Border)
  487. vend:RegisterEvent("UNIT_AURA")
  488. vend:SetScript("OnEvent", function(self, event, unit)
  489. vend.CheckAura(unit)
  490. end)
  491. function vend.CheckAura(unit)
  492. local spellname = GetSpellInfo(79140)
  493. local _, _, _, _, _, duration, expirationTime, unitCaster, _, _, id = UnitDebuff("target", spellname)
  494. if id and unitCaster == "player" then
  495. vend:Show()
  496. vend:SetCooldown(expirationTime - duration - 0.5, duration)
  497. return
  498. end
  499. vend:Hide()
  500. end
  501. --rupture tracker
  502. local rupt = CreateFrame("Cooldown", nil, PlayerFrame, "CooldownFrameTemplate")
  503. rupt:SetDrawEdge(false)
  504. rupt:ClearAllPoints()
  505. rupt:SetPoint("BOTTOMRIGHT",PlayerFrame,149,40)
  506. rupt:SetSize(34,34)
  507. rupt.Icon = CreateFrame("Frame", nil, rupt)
  508. rupt.Icon:SetFrameLevel(rupt:GetFrameLevel() - 1)
  509. rupt:SetFrameStrata("HIGH")
  510. rupt.Icon:SetAllPoints()
  511. rupt.Icon.Texture = rupt.Icon:CreateTexture(nil, "ARTWORK")
  512. rupt.Icon.Texture:SetPoint("BOTTOMRIGHT",PlayerFrame,149,40)
  513. rupt.Icon.Texture:SetSize(34,34)
  514. rupt.Icon.Texture:SetTexture("Interface\\Icons\\ability_rogue_rupture")
  515. rupt.Icon.Border = CreateFrame("Frame", nil, rupt.Icon)
  516. rupt.Icon.Border:SetAllPoints()
  517. rupt.Icon.Border.Texture = rupt.Icon.Border:CreateTexture(nil, Border)
  518. rupt:RegisterEvent("UNIT_AURA")
  519. rupt:SetScript("OnEvent", function(self, event, unit)
  520. rupt.CheckAura(unit)
  521. end)
  522. function rupt.CheckAura(unit)
  523. local spellname = GetSpellInfo(1943)
  524. local _, _, _, _, _, duration, expirationTime, unitCaster, _, _, id = UnitDebuff("target", spellname)
  525. if id and unitCaster == "player" then
  526. rupt:Show()
  527. rupt:SetCooldown(expirationTime - duration - 0.5, duration)
  528. return
  529. end
  530. rupt:Hide()
  531. end
  532. end
  533. --CreateFrame("Cooldown", nil, DR, "CooldownFrameTemplate")
  534.  
  535.  
  536. --combat script
  537. if (Combat == 1) then
  538. 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()
  539. 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)
  540. 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()
  541. 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)
  542. --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()
  543. --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)
  544. end
  545.  
  546.  --SDB fix
  547. if (ShadowDanceBar == 1) then
  548. local shadowdancebar = 2 -- внимание! это номер панели для шд
  549. local f = CreateFrame('frame', 'myownstatedriver', UIParent, 'SecureHandlerStateTemplate')
  550. for i=1,12 do f:SetFrameRef('ActionButton'..i, _G['ActionButton'..i]) end
  551. f:Execute([[ buttons = table.new() for i = 1, 12 do table.insert(buttons, self:GetFrameRef('ActionButton'..i)) end ]])
  552. f:SetAttribute('_onstate-page', [[  for i, button in ipairs(buttons) do button:SetAttribute('actionpage', tonumber(newstate)) end ]])
  553. local getBar = function()
  554.     local class, spec = select(2, UnitClass('player')), GetSpecialization()
  555.     local pages = {
  556.         ['DRUID'] = '[bonusbar:1,nostealth] 7; [bonusbar:1,stealth] 8; [bonusbar:2] 8; [bonusbar:3] 9; [bonusbar:4] 10;',        
  557.         ['WARRIOR'] = '[bonusbar:1] 7; [bonusbar:2] 8; [bonusbar:3] 9;',
  558.         ['PRIEST'] = '[bonusbar:1] 7;',
  559.         ['ROGUE'] = '[form:1][form:'..(spec==3 and 3 or 2)..',stealth] 7; [form:'..(spec==3 and 3 or 2)..',nostealth]'..shadowdancebar..';',
  560.         ['WARLOCK'] = '[form:2] 10;',
  561.         ['MONK'] = '[form:1] '..(spec == 1 and 8 or spec == 2 and 9 or spec == 3 and 7 or 9)..'; [form:2] 7;',
  562.         ['DEFAULT'] = '[vehicleui] 12; [bar:2] 2; [bar:3] 3; [bar:4] 4; [bar:5] 5; [bar:6] 6;',
  563.     }
  564.     local condition, page = pages['DEFAULT'], pages[class]
  565.     if page then condition = condition..' '..page end
  566.     condition = condition..' 1'
  567.     return condition
  568. end
  569. RegisterStateDriver(f, 'page', getBar())
  570. end
  571. --interrupt announcer
  572. if (InterruptA == 1) then
  573. local f = CreateFrame("Frame")
  574. local function Update(self, event, ...)
  575.         if event == "COMBAT_LOG_EVENT_UNFILTERED" then     
  576.         local timestamp, eventType, _, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, _, spellID, spellName, _, extraskillID, extraSkillName = ...
  577.         if eventType == "SPELL_INTERRUPT" and sourceName == UnitName("player") then
  578.             SendChatMessage("Interrupted >> "..GetSpellLink(extraskillID).."!", "SAY")
  579.         end
  580.     end
  581. end
  582. f:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
  583. f:SetScript("OnEvent", Update)
  584. end
  585. --recup/snd tracker
  586.  
  587. -- Class colors in arena frames
  588.  
  589. if (cArenas == 1) then
  590. local frame = CreateFrame("FRAME")
  591. frame:RegisterEvent("PLAYER_ENTERING_WORLD")
  592. frame:RegisterEvent("PARTY_MEMBERS_CHANGED")
  593. frame:RegisterEvent("PLAYER_TARGET_CHANGED")
  594. frame:RegisterEvent("PLAYER_FOCUS_CHANGED")
  595. frame:RegisterEvent("ARENA_OPPONENT_UPDATE")
  596. frame:RegisterEvent("PLAYER_CONTROL_GAINED")
  597. frame:RegisterEvent("PLAYER_CONTROL_LOST")
  598. frame:RegisterEvent("ADDON_LOADED");
  599. local function DoArenaColorHook()
  600.         hooksecurefunc("ArenaEnemyFrame_Unlock",
  601.                 function(self)
  602.                         local color=RAID_CLASS_COLORS[select(2,UnitClass(self.unit)) or ""]
  603.                         if color then
  604.                                 self.healthbar:SetStatusBarColor(color.r,color.g,color.b)
  605.                                 self.healthbar.lockColor=true
  606.                         end                                            
  607.                 end
  608.         )
  609. end
  610. local function eventHandler(self, event, arg, ...)
  611.         if event == "ADDON_LOADED" then
  612.                 if arg == "Blizzard_ArenaUI" then
  613.                         self:UnregisterEvent(event);
  614.                         DoArenaColorHook();
  615.                 end
  616.         end            
  617. end
  618. if IsAddOnLoaded("Blizzard_ArenaUI") then
  619.         DoArenaColorHook();
  620. end
  621. frame:SetScript("OnEvent", eventHandler)
  622. end
  623.  
  624. --DRTracker Warlords of Draenor
  625. if (DRTrackerWoD == 1) then
  626. local DRTracker = CreateFrame("Cooldown", "DRTracker", UIParent)
  627. local DRs = {}
  628. local lastChangedFrame = nil
  629. DRTracker:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
  630. DRTracker:RegisterEvent("ADDON_LOADED")
  631. local spellIds = { -- DR Categories listed here http://eu.battle.net/wow/en/forum/topic/11267997531
  632.     -- Many thanks to those that assisted the creation of the original list from LoseControl.
  633.     -- Categories: Stun (1), Silence (2), Disorient/Fear (3), Incapacitate/Polymorph (4), Roots (5)
  634.     -- Death Knight
  635.     [108194] = "Stun",      -- Asphyxiate
  636.     [115001] = "Stun",      -- Remorseless Winter
  637.     [47476]  = "Silence",       -- Strangulate
  638.     [96294]  = "Root",      -- Chains of Ice (Chilblains)
  639.     -- Death Knight Ghoul
  640.     [91800]  = "Stun",      -- Gnaw
  641.     [91797]  = "Stun",      -- Monstrous Blow (Dark Transformation)
  642.     [91807]  = "Root",      -- Shambling Rush (Dark Transformation)
  643.     -- Druid
  644.     [113801] = "Stun",      -- Bash (Force of Nature - Feral Treants)
  645.     [102795] = "Stun",      -- Bear Hug
  646.     [33786]  = "Disorient",     -- Cyclone
  647.     [99]     = "Incap",     -- Disorienting (Incapacitating) Roar
  648.     [22570]  = "Stun",      -- Maim
  649.     [5211]   = "Stun",      -- Mighty Bash
  650.     [163505]   = "Stun",        -- Rake
  651.     [114238] = "Silence",       -- Fae Silence (Glyph of Fae Silence)
  652.     [81261]  = "Silence",       -- Solar Beam
  653.     [339]    = "Root",      -- Entangling Roots
  654.     [113770] = "Root",      -- Entangling Roots (Force of Nature - Balance Treants)
  655.     [19975]  = "Root",      -- Entangling Roots (Nature's Grasp)
  656.     [45334]  = "Root",      -- Immobilized (Wild Charge - Bear)
  657.     [102359] = "Root",      -- Mass Entanglement
  658.     -- Hunter
  659.     [117526] = "Stun",      -- Binding Shot
  660.     [3355]   = "Incap",     -- Freezing Trap
  661.     [1513]   = "Disorient",     -- Scare Beast
  662.     [19386]  = "Incap",     -- Wyvern Sting
  663.     [34490]  = "Silence",       -- Silencing Shot
  664.     [19185]  = "Root",      -- Entrapment
  665.     [64803]  = "Root",      -- Entrapment
  666.     [128405] = "Root",      -- Narrow Escape
  667.     -- Mage
  668.     [118271] = "Stun",      -- Combustion Impact
  669.     [44572]  = "Stun",      -- Deep Freeze
  670.     [31661]  = "Disorient",     -- Dragon's Breath
  671.     [118]    = "Incap",     -- Polymorph
  672.     [61305]  = "Incap",     -- Polymorph: Black Cat
  673.     [28272]  = "Incap",     -- Polymorph: Pig
  674.     [61721]  = "Incap",     -- Polymorph: Rabbit
  675.     [61780]  = "Incap",     -- Polymorph: Turkey
  676.     [28271]  = "Incap",     -- Polymorph: Turtle
  677.     [82691]  = "Incap",     -- Ring of Frost
  678.     [102051] = "Silence",       -- Frostjaw (also a root)
  679.     [122]    = "Root",      -- Frost Nova
  680.     [111340] = "Root",      -- Ice Ward
  681.     -- Mage Water Elemental
  682.     [33395]  = "Root",      -- Freeze
  683.     -- Monk
  684.     [123393] = "Incap",     -- Breath of Fire (Glyph of Breath of Fire)
  685.     [119392] = "Stun",      -- Charging Ox Wave
  686.     [120086] = "Stun",      -- Fists of Fury
  687.     [119381] = "Stun",      -- Leg Sweep
  688.     [115078] = "Incap",     -- Paralysis
  689.     [137460] = "Incap",     -- Silenced (Ring of Peace)
  690.     [116706] = "Root",      -- Disable
  691.     [123407] = "Root",      -- Spinning Fire Blossom
  692.     -- Paladin
  693.     [105421] = "Disorient",     -- Blinding Light
  694.     [115752] = "Stun",      -- Blinding Light (Glyph of Blinding Light)
  695.     [105593] = "Stun",      -- Fist of Justice
  696.     [853]    = "Stun",      -- Hammer of Justice
  697.     [119072] = "Stun",      -- Holy Wrath
  698.     [20066]  = "Incap",     -- Repentance
  699.     [10326]  = "Disorient",     -- Turn Evil
  700.     [145067] = "Disorient",     -- Turn Evil (Evil is a Point of View)
  701.     [31935]  = "Silence",       -- Avenger's Shield
  702.     -- Priest
  703.     [605]    = "Incap",     -- Dominate Mind
  704.     [88625]  = "Incap",     -- Holy Word: Chastise
  705.     [64044]  = "Incap",     -- Psychic Horror
  706.     [8122]   = "Disorient",     -- Psychic Scream
  707.     [113792] = "Disorient",     -- Psychic Terror (Psyfiend)
  708.     [9484]   = "Disorient",     -- Shackle Undead
  709.     [15487]  = "Silence",       -- Silence
  710.     [87194]  = "Root",      -- Glyph of Mind Blast
  711.     [114404] = "Root",      -- Void Tendril's Grasp
  712.     -- Rogue
  713.     [2094]   = "Disorient",     -- Blind
  714.     [1833]   = "Stun",      -- Cheap Shot
  715.     [1776]   = "Incap",     -- Gouge
  716.     [408]    = "Stun",      -- Kidney Shot
  717.     [6770]   = "Incap",     -- Sap
  718.     [1330]   = "Silence",       -- Garrote - Silence
  719.     -- Shaman
  720.     [51514]  = "Incap",     -- Hex
  721.     [118905] = "Stun",      -- Static Charge (Capacitor Totem)
  722.     [64695]  = "Root",      -- Earthgrab (Earthgrab Totem)
  723.     [63685]  = "Root",      -- Freeze (Frozen Power)
  724.     -- Shaman Primal Earth Elemental
  725.     [118345] = "Stun",      -- Pulverize
  726.     -- Warlock
  727.     [710]    = "Incap",     -- Banish
  728.     [137143] = "Incap",     -- Blood Horror
  729.     [5782]   = "Disorient",     -- Fear
  730.     [118699] = "Disorient",     -- Fear
  731.     [130616] = "Disorient",     -- Fear (Glyph of Fear)
  732.     [5484]   = "Disorient",     -- Howl of Terror
  733.     [22703]  = "Stun",      -- Infernal Awakening
  734.     [6789]   = "Incap",     -- Mortal Coil
  735.     [132412] = "Disorient",     -- Seduction (Grimoire of Sacrifice)
  736.     [30283]  = "Stun",      -- Shadowfury
  737.     [132409] = "Silence",       -- Spell Lock (Grimoire of Sacrifice)
  738.     [31117]  = "Silence",       -- Unstable Affliction
  739.     -- Warlock Pets
  740.     [89766]  = "Stun",      -- Axe Toss (Felguard/Wrathguard)
  741.     [115268] = "Disorient",     -- Mesmerize (Shivarra)
  742.     [6358]   = "Disorient",     -- Seduction (Succubus)
  743.     [115782] = "Silence",       -- Optical Blast (Observer)
  744.     [24259]  = "Silence",       -- Spell Lock (Felhunter)
  745.     -- Warrior
  746.     --[7922]   = "Root",        -- Charge Stun
  747.     [5246]   = "Disorient",     -- Intimidating Shout (aoe)
  748.     [20511]  = "Disorient",     -- Intimidating Shout (targeted)
  749.     [132168] = "Stun",      -- Shockwave
  750.     [107570] = "Stun",      -- Storm Bolt
  751.     [132169] = "Stun",      -- Storm Bolt
  752.     [18498]  = "Silence",       -- Silenced - Gag Order (PvE only)
  753.     [107566] = "Root",      -- Staggering Shout
  754.     [105771] = "Root",      -- Warbringer
  755.     -- Other
  756.     [107079] = "Incap",     -- Quaking Palm
  757.     [13327]  = "Stun",      -- Reckless Charge
  758.     [20549]  = "Stun",      -- War Stomp
  759.     [25046]  = "Silence",       -- Arcane Torrent (Energy)
  760.     [28730]  = "Silence",       -- Arcane Torrent (Mana)
  761.     [50613]  = "Silence",       -- Arcane Torrent (Runic Power)
  762.     [69179]  = "Silence",       -- Arcane Torrent (Rage)
  763.     [80483]  = "Silence",       -- Arcane Torrent (Focus)
  764.     [129597] = "Silence",       -- Arcane Torrent (Chi)
  765.     [39965]  = "Root",      -- Frost Grenade
  766.     [55536]  = "Root",      -- Frostweave Net
  767.     [13099]  = "Root",      -- Net-o-Matic
  768. }
  769.  
  770. function DRTracker:GetSpellCategory(spellID) -- Returns CC category of the spellIDs listed above
  771.     return spellID and spellIds[spellID] or nil
  772. end
  773.  
  774. function DRTracker:OnEvent(event, ...) -- Runs things, and stuff.
  775.     self[event](self, ...)
  776. end
  777. DRTracker:SetScript("OnEvent", DRTracker.OnEvent)
  778.  
  779. function DRTracker:ADDON_LOADED(addonName) -- Anchor DR trackers
  780.     if addonName == "Blizzard_ArenaUI" then
  781.         local arenaFrame
  782.         for i = 1, 5 do
  783.         arenaFrame = "ArenaEnemyFrame"..i
  784.         --local loc = -30 -- (Depreciated) Distance between the left edge of each frame. Should match the width of the frame.
  785.             for j = 1, 5 do
  786.                 local DR = CreateFrame("Frame", arenaFrame.."DR"..j, ArenaEnemyFrames)
  787.                 DR:ClearAllPoints()
  788.                 DR:SetPoint("BOTTOMRIGHT", arenaFrame, "TOPLEFT", 0, -10)
  789.                 DR:SetSize(24, 24) -- (Width, Height) of each frame. A perfect square is preferable, otherwise the spell icon will look stretched.
  790.                 DR.border = DR:CreateTexture(nil, "LOW")
  791.                 DR.border:SetAllPoints()
  792.                 DR.border:SetTexture("Interface\\BUTTONS\\UI-Quickslot-Depress.png")
  793.                 DR.icon = DR:CreateTexture(nil, "BACKGROUND")
  794.                 DR.shown = false
  795.                 DR.severity = 1
  796.                 DR.unit = i
  797.                 DR.cate = j
  798.                 DR.applied = 0
  799.                 DR.sweep = CreateFrame("Cooldown", nil, DR, "CooldownFrameTemplate")
  800.                 DR.sweep:ClearAllPoints()
  801.                 DR.sweep:SetAllPoints(DR)
  802.                 local function OnShow(self)
  803.                     local curX = 0
  804.                     for b=1,5 do
  805.                         local curFrame = DRs["arena"..DR.unit..b]
  806.                         if curFrame.shown == true and b ~= self.cate then
  807.                             curX = curX - 30
  808.                         end
  809.                     end
  810.                     self:ClearAllPoints()
  811.                     self:SetPoint("BOTTOMRIGHT", "ArenaEnemyFrame"..self.unit, "TOPLEFT", curX, -10)
  812.                     self.shown = true
  813.                     self.applied = GetTime()
  814.                 end
  815.                 DR:HookScript("OnShow", OnShow)
  816.  
  817.                 local function OnHide(self)
  818.                     for b = 1,5 do
  819.                         local curFrame = DRs["arena"..self.unit..b]
  820.                         if curFrame and curFrame.shown == true and curFrame.applied > self.applied then
  821.                             local _, _, _, x = curFrame:GetPoint(1)
  822.                             curFrame:ClearAllPoints()
  823.                             curFrame:SetPoint("BOTTOMRIGHT", "ArenaEnemyFrame"..curFrame.unit, "TOPLEFT", x+30, -10)
  824.                         end
  825.                     end
  826.                     self:ClearAllPoints()
  827.                     self:SetPoint("BOTTOMRIGHT", "ArenaEnemyFrame"..self.unit, "TOPLEFT", 0, -10)
  828.                 end
  829.                 DR:HookScript("OnHide", OnHide)
  830.                
  831.                 local function DREnd(self, elapsed)
  832.                     if self.sweep:GetCooldownDuration() == 0 and self.shown == true then
  833.                         self:Hide()
  834.                         self.shown = false
  835.                         self.severity = 1
  836.                     end
  837.                 end
  838.                 DR:HookScript("OnUpdate", DREnd)
  839.                
  840.                 DR:Hide()
  841.                 DRs["arena"..i..j] = DR
  842.             end
  843.         end
  844.     end
  845. end
  846.  
  847. function DRTracker:SetTexture(Frame, spellID) -- Sets displayed icon to last spell.
  848.     if Frame.shown == true then
  849.         Frame.dur = Frame.sweep:GetCooldownDuration()
  850.         Frame:Hide()
  851.     end
  852.     lastChangedFrame = Frame
  853.     local _, _, icon, _, _, _, _, _, _ = GetSpellInfo(spellID)
  854.     Frame.icon:ClearAllPoints()
  855.     Frame.icon:SetAllPoints()
  856.     Frame.icon:SetTexture(icon)
  857.     Frame:Show()
  858.     if Frame.severity == 1 then
  859.         Frame.border:SetVertexColor(1, 1, 0, 1)
  860.         Frame.severity = 2
  861.     elseif Frame.severity == 2 then
  862.         Frame.border:SetVertexColor(1, .4, 0, 1)
  863.         Frame.severity = 3
  864.     elseif Frame.severity == 3 then
  865.         Frame.border:SetVertexColor(1, 0, 0, 1)
  866.     end
  867. end
  868.  
  869. function DRTracker:TimerStart(GUID, spellID, spellName) -- Primary function; begins CD sweep and icon updates. Not a good idea to edit any of this.
  870.     local _, instanceType = IsInInstance()
  871.     if instanceType ~= "arena" then
  872.         return
  873.     end
  874.     local cat = DRTracker:GetSpellCategory(spellID)
  875.     if(UnitGUID("arena1") == GUID) then
  876.         local name, rank, icon, count, dispelType, duration, expires, caster, isStealable, shouldConsolidate, spellID, canApplyAura, isBossDebuff, value1, value2, value3 = UnitDebuff("arena1", spellName)
  877.         if(cat=="Stun") then
  878.             DRTracker:SetTexture(DRs["arena1"..1], spellID)
  879.             CooldownFrame_SetTimer(DRs["arena1"..1].sweep, GetTime(), 17+duration, 1)
  880.         elseif(cat=="Silence") then
  881.             DRTracker:SetTexture(DRs["arena1"..2], spellID)
  882.             CooldownFrame_SetTimer(DRs["arena1"..2].sweep, GetTime(), 17+duration, 1)
  883.         elseif(cat=="Disorient") then
  884.             DRTracker:SetTexture(DRs["arena1"..3], spellID)
  885.             CooldownFrame_SetTimer(DRs["arena1"..3].sweep, GetTime(), 17+duration, 1)
  886.         elseif(cat=="Incap") then
  887.             DRTracker:SetTexture(DRs["arena1"..4], spellID)
  888.             CooldownFrame_SetTimer(DRs["arena1"..4].sweep, GetTime(), 17+duration, 1)
  889.         else
  890.             DRTracker:SetTexture(DRs["arena1"..5], spellID)
  891.             CooldownFrame_SetTimer(DRs["arena1"..5].sweep, GetTime(), 17+duration, 1)
  892.         end
  893.     elseif(UnitGUID("arena2") == GUID) then
  894.     local name, rank, icon, count, dispelType, duration, expires, caster, isStealable, shouldConsolidate, spellID, canApplyAura, isBossDebuff, value1, value2, value3 = UnitDebuff("arena2", spellName)
  895.         if(cat=="Stun") then
  896.             DRTracker:SetTexture(DRs["arena2"..1], spellID)
  897.             CooldownFrame_SetTimer(DRs["arena2"..1].sweep, GetTime(), 17+duration, 1)
  898.         elseif(cat=="Silence") then
  899.             DRTracker:SetTexture(DRs["arena2"..2], spellID)
  900.             CooldownFrame_SetTimer(DRs["arena2"..2].sweep, GetTime(), 17+duration, 1)
  901.         elseif(cat=="Disorient") then
  902.             DRTracker:SetTexture(DRs["arena2"..3], spellID)
  903.             CooldownFrame_SetTimer(DRs["arena2"..3].sweep, GetTime(), 17+duration, 1)
  904.         elseif(cat=="Incap") then
  905.             DRTracker:SetTexture(DRs["arena2"..4], spellID)
  906.             CooldownFrame_SetTimer(DRs["arena2"..4].sweep, GetTime(), 17+duration, 1)
  907.         else
  908.             DRTracker:SetTexture(DRs["arena2"..5], spellID)
  909.             CooldownFrame_SetTimer(DRs["arena2"..5].sweep, GetTime(), 17+duration, 1)
  910.         end
  911.     elseif(UnitGUID("arena3") == GUID) then
  912.     local name, rank, icon, count, dispelType, duration, expires, caster, isStealable, shouldConsolidate, spellID, canApplyAura, isBossDebuff, value1, value2, value3 = UnitDebuff("arena3", spellName)
  913.         if(cat=="Stun") then
  914.             DRTracker:SetTexture(DRs["arena3"..1], spellID)
  915.             CooldownFrame_SetTimer(DRs["arena3"..1].sweep, GetTime(), 17+duration, 1)
  916.         elseif(cat=="Silence") then
  917.             DRTracker:SetTexture(DRs["arena3"..2], spellID)
  918.             CooldownFrame_SetTimer(DRs["arena3"..2].sweep, GetTime(), 17+duration, 1)
  919.         elseif(cat=="Disorient") then
  920.             DRTracker:SetTexture(DRs["arena3"..3], spellID)
  921.             CooldownFrame_SetTimer(DRs["arena3"..3].sweep, GetTime(), 17+duration, 1)
  922.         elseif(cat=="Incap") then
  923.             DRTracker:SetTexture(DRs["arena3"..4], spellID)
  924.             CooldownFrame_SetTimer(DRs["arena3"..4].sweep, GetTime(), 17+duration, 1)
  925.         else
  926.             DRTracker:SetTexture(DRs["arena3"..5], spellID)
  927.             CooldownFrame_SetTimer(DRs["arena3"..5].sweep, GetTime(), 17+duration, 1)
  928.         end
  929.     elseif(UnitGUID("arena4") == GUID) then
  930.     local name, rank, icon, count, dispelType, duration, expires, caster, isStealable, shouldConsolidate, spellID, canApplyAura, isBossDebuff, value1, value2, value3 = UnitDebuff("arena4", spellName)
  931.         if(cat=="Stun") then
  932.             DRTracker:SetTexture(DRs["arena4"..1], spellID)
  933.             CooldownFrame_SetTimer(DRs["arena4"..1].sweep, GetTime(), 17+duration, 1)
  934.         elseif(cat=="Silence") then
  935.             DRTracker:SetTexture(DRs["arena4"..2], spellID)
  936.             CooldownFrame_SetTimer(DRs["arena4"..2].sweep, GetTime(), 17+duration, 1)
  937.         elseif(cat=="Disorient") then
  938.             DRTracker:SetTexture(DRs["arena4"..3], spellID)
  939.             CooldownFrame_SetTimer(DRs["arena4"..3].sweep, GetTime(), 17+duration, 1)
  940.         elseif(cat=="Incap") then
  941.             DRTracker:SetTexture(DRs["arena4"..4], spellID)
  942.             CooldownFrame_SetTimer(DRs["arena4"..4].sweep, GetTime(), 17+duration, 1)
  943.         else
  944.             DRTracker:SetTexture(DRs["arena4"..5], spellID)
  945.             CooldownFrame_SetTimer(DRs["arena4"..5].sweep, GetTime(), 17+duration, 1)
  946.         end
  947.     elseif(UnitGUID("arena5") == GUID) then
  948.         local name, rank, icon, count, dispelType, duration, expires, caster, isStealable, shouldConsolidate, spellID, canApplyAura, isBossDebuff, value1, value2, value3 = UnitDebuff("arena5", spellName)
  949.         if(cat=="Stun") then
  950.             DRTracker:SetTexture(DRs["arena5"..1], spellID)
  951.             CooldownFrame_SetTimer(DRs["arena5"..1].sweep, GetTime(), 17+duration, 1)
  952.         elseif(cat=="Silence") then
  953.             DRTracker:SetTexture(DRs["arena5"..2], spellID)
  954.             CooldownFrame_SetTimer(DRs["arena5"..2].sweep, GetTime(), 17+duration, 1)
  955.         elseif(cat=="Disorient") then
  956.             DRTracker:SetTexture(DRs["arena5"..3], spellID)
  957.             CooldownFrame_SetTimer(DRs["arena5"..3].sweep, GetTime(), 17+duration, 1)
  958.         elseif(cat=="Incap") then
  959.             DRTracker:SetTexture(DRs["arena5"..4], spellID)
  960.             CooldownFrame_SetTimer(DRs["arena5"..4].sweep, GetTime(), 17+duration, 1)
  961.         else
  962.             DRTracker:SetTexture(DRs["arena5"..5], spellID)
  963.             CooldownFrame_SetTimer(DRs["arena5"..5].sweep, GetTime(), 17+duration, 1)
  964.         end
  965.     end
  966.     return
  967. end
  968.  
  969. function DRTracker:GetDRs()
  970.     return DRTracker and DRs
  971. end
  972.  
  973. function DRTracker:COMBAT_LOG_EVENT_UNFILTERED(timeStamp, eventType, hideCaster, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags, spellID, spellName, spellSchool, auraType)
  974.     if eventType == "SPELL_AURA_APPLIED" or eventType == "SPELL_AURA_REFRESH" then -- Crowd control landed, time to do stuff.
  975.         if auraType == "DEBUFF" and DRTracker:GetSpellCategory(spellID) then
  976.             DRTracker:TimerStart(destGUID, spellID, spellName)
  977.         end
  978.     end
  979. end
  980. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement