Advertisement
Guest User

Untitled

a guest
Aug 24th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.03 KB | None | 0 0
  1. function TMW.CNDT.Env.GetInterruptSpell(rangeCheck)
  2.  
  3. local lclass,eclass,index=UnitClass("player")
  4. if index==1 then
  5. return "Pummel"
  6. elseif index==2 then
  7. return "Rebuke"
  8. elseif index==3 then
  9. if GetSpecialization()==3 then --Survival
  10. return "Muzzle"
  11. else
  12. return "Counter Shot"
  13. end
  14. elseif index==4 then
  15. return "Kick"
  16. elseif index==5 then
  17. if GetSpecialization()==1 then --Discipline
  18. if rangeCheck then
  19. return nil
  20. else
  21. return "Psychic Scream"
  22. end
  23. else
  24. return "Silence"
  25. end
  26. elseif index==6 then
  27. return "Mind Freeze"
  28. elseif index==7 then
  29. return "Wind Shear"
  30. elseif index==8 then
  31. return "Counterspell"
  32. elseif index==9 then
  33. if rangeCheck then
  34. local pet=UnitCreatureFamily("pet")
  35. if pet=="Doomguard" or pet=="Felhunter" then
  36. local spec=GetSpecialization()
  37. if spec==1 then --Affliction
  38. return "Agony"
  39. elseif spec==2 then --Demonology
  40. return "Shadow Bolt"
  41. else
  42. return "Chaos Bolt"
  43. end
  44. end
  45. else
  46. local pet=UnitCreatureFamily("pet")
  47. if pet=="Doomguard" then
  48. return 171138 --Shadow Lock
  49. elseif pet=="Felhunter" then
  50. return 19647 --Spell Lock
  51. end
  52. end
  53. elseif index==10 then
  54. return "Spear Hand Strike"
  55. elseif index==11 then
  56. if GetSpecialization()==1 then --Balance
  57. return "Solar Beam"
  58. else
  59. local form=GetShapeshiftForm()
  60. if form==1 or form==2 then
  61. return "Skull Bash"
  62. end
  63. end
  64. elseif index==12 then
  65. return "Consume Magic"
  66. end
  67.  
  68. return nil
  69. end
  70.  
  71. function TMW.CNDT.Env.InterruptReady()
  72.  
  73. local spell=TMW.CNDT.Env.GetInterruptSpell(false)
  74. if spell==nil then
  75. return false
  76. else
  77. local start,dur=GetSpellCooldown(spell)
  78. return dur~=nil and dur<0.5
  79. end
  80.  
  81. end
  82.  
  83. function TMW.CNDT.Env.InterruptInRange(unit)
  84.  
  85. local spell=TMW.CNDT.Env.GetInterruptSpell(true)
  86. if spell==nil then
  87. return true
  88. else
  89. local range=IsSpellInRange(spell,unit)
  90. return range~=nil and range==1
  91. end
  92.  
  93. end
  94.  
  95. function TMW.CNDT.Env.InterruptOutOfRange(unit)
  96.  
  97. local spell=TMW.CNDT.Env.GetInterruptSpell(true)
  98. if spell==nil then
  99. return false
  100. else
  101. local range=IsSpellInRange(spell,unit)
  102. return range~=nil and range==0
  103. end
  104.  
  105. end
  106.  
  107. function TMW.CNDT.Env.EnoughTimeLeft(unit)
  108.  
  109. local name, _, _, _, _, endTime, _, _, _ = UnitCastingInfo(unit)
  110. if not name then
  111. name, _, _, _, _, endTime, _, _ = UnitChannelInfo(unit)
  112. end
  113.  
  114. return endTime ~= nil and GetTime() * 1000 < endTime - 500
  115.  
  116. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement