Advertisement
wit4er

6.0.3 final

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