Guest User

Untitled

a guest
Jan 23rd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.50 KB | None | 0 0
  1. function warlock_affliction(self)
  2. local mana = UnitMana("player")/UnitManaMax("player")
  3. local shards = UnitPower("player",7)
  4. local spell = nil
  5.  
  6. local bod_duration = cdo.debuff_duration("target","bane of doom")
  7. local cpn_duration = cdo.debuff_duration("target","corruption")
  8. local ua_duration = cdo.debuff_duration("target","unstable affliction")
  9.  
  10. -- focus dotting
  11. local focus_dotting, focus_corruption, focus_ua, focus_bane
  12. if UnitExists("focus") then
  13. focus_dotting = true
  14. focus_corruption = cdo.debuff_duration("focus","corruption")
  15. focus_ua = cdo.debuff_duration("focus","unstable affliction")
  16. focus_bane = cdo.debuff_duration("focus","bane of agony")
  17. end
  18.  
  19. if not ud("target","curse of the elements") then
  20. spell = "curse of the elements"
  21. -- Opening
  22. elseif cdo.opening and not cdo.Casting then
  23. if not ud("target","shadow and flame") and cdo.LastCast ~= "shadow bolt" then
  24. spell = "shadow bolt"
  25. elseif cd("haunt") == 0 then
  26. spell = "haunt"
  27. elseif cd("demon soul") == 0 then
  28. spell = "demon soul"
  29. elseif not ud("target","bane of doom") then
  30. spell = "bane of doom"
  31. elseif not ud("target","corruption") then
  32. spell = "corruption"
  33. elseif not ud("target","unstable affliction") and cdo.LastCast ~= "unstable affliction" then
  34. spell = "unstable affliction"
  35. else
  36. spell = "drain life"
  37. cdo.opening = false
  38. end
  39. elseif not cdo.Casting then
  40. -- Standard
  41. if cd("haunt") == 0 and not cdo.Moving then
  42. spell = "haunt"
  43. elseif cd("demon soul") == 0 then
  44. spell = "demon soul"
  45. elseif bod_duration < 15 then
  46. spell = "bane of doom"
  47. elseif not ud("target","shadow and flame") and cdo.LastCast ~= "shadow bolt" then
  48. spell = "shadow bolt"
  49. elseif ub("player","shadow trance") then
  50. spell = "shadow bolt"
  51. elseif cpn_duration < 1.5 then
  52. spell = "corruption"
  53. elseif cdo.Moving then
  54. spell = "fel flame"
  55. elseif ua_duration < 1.5 and cdo.LastCast ~= "unstable affliction" then
  56. spell = "unstable affliction"
  57. elseif UnitHealth("target")/UnitHealthMax("target") < 0.25 then
  58. spell = "drain soul"
  59. elseif focus_dotting and focus_corruption < 1.5 then
  60. spell = "corruption"
  61. cdo.Target = "focus"
  62. elseif focus_dotting and focus_bane < 1.5 then
  63. spell = "bane of agony"
  64. cdo.Target = "focus"
  65. elseif focus_dotting and focus_ua < 1.5 then
  66. spell = "unstable affliction"
  67. cdo.Target = "focus"
  68. elseif cd("Shadowflame") == 0 and IsShiftKeyDown() then
  69. spell = "shadowflame"
  70. elseif mana < 0.5 then
  71. spell = "life tap"
  72. else
  73. spell = "drain life"
  74. end
  75. end
  76. return spell
  77. end
Add Comment
Please, Sign In to add comment