Advertisement
wit4er

Autoscript v6.0.2 beta

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