Advertisement
Guest User

SynCurse

a guest
Oct 19th, 2018
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.36 KB | None | 0 0
  1. function SynCurse()
  2. --Essences can be converted (between 3 lesser and 1 greater instantly while in combat without initiating the global cooldown.
  3. --These will be used to track the current state. There are 4 states: CoR, CoS, CoE, and default.
  4. --Essence type 1 to be used for CoR state, using slots 61 and 62 on my action bars.
  5. --Essence type 2 to be used for CoS state, using slots 65 and 66 on my action bars.
  6. --Essence type 3 to be used for CoE state, using slots 69 and 70 on my action bars.
  7.  
  8. if (IsUsableAction(61) == 1) then --Checking for CoR state
  9. SynCurse_Corbolt()
  10. elseif (IsUsableAction(65) == 1) then --Checking for CoS state
  11. SynCurse_Cosbolt()
  12. elseif (IsUsableAction(69) == 1) then --Checking for CoE state
  13. SynCurse_Coebolt()
  14. elseif (not buffed("Curse of Recklessness", "Target")) then --default state, start checking for missing curses. State change when a curse is found missing and cast.
  15. UseAction(62) --CoR state 'on'
  16. UseAction(65) --CoS state 'off'
  17. UseAction(69) --CoE state 'off'
  18. CastSpellByName("Curse of Recklessness")
  19. --print("Casting CoR")
  20. elseif (not buffed("Curse of Shadow", "Target")) then
  21. UseAction(61)
  22. UseAction(66)
  23. UseAction(69)
  24. CastSpellByName("Curse of Shadow")
  25. --print("Casting CoS")
  26. elseif (not buffed("Curse of the Elements", "Target")) then
  27. UseAction(61)
  28. UseAction(65)
  29. UseAction(70)
  30. CastSpellByName("Curse of the Elements")
  31. --print("Casting CoE")
  32. else
  33. CastSpellByName("Shadow Bolt") --cast shadow bolt if you are in default state after checking for all curses
  34. SynCurse_Reset() --reset to default state just in case
  35. end
  36. end
  37.  
  38.  
  39. function SynCurse_Corbolt()
  40. if (not buffed("Curse of Recklessness", "Target")) then
  41. SynCurse_Reset() --if the curse was resisted or failed to apply after casting then return to default state
  42. else
  43. CastSpellByName("Shadow Bolt")
  44. end
  45. end
  46.  
  47.  
  48. function SynCurse_Cosbolt()
  49. if (not buffed("Curse of Shadow", "Target")) then
  50. SynCurse_Reset()
  51. else
  52. CastSpellByName("Shadow Bolt")
  53. end
  54. end
  55.  
  56.  
  57. function SynCurse_Coebolt()
  58. if (not buffed("Curse of the Elements", "Target")) then
  59. SynCurse_Reset()
  60. else
  61. CastSpellByName("Shadow Bolt")
  62. end
  63. end
  64.  
  65.  
  66. function SynCurse_ResetCheck() --return to default state on dropping combat, dropping target, or changing target
  67. if ((not UnitAffectingCombat("player")) or (UnitName("target") == nil)) then
  68. SynCurse_Reset()
  69. end
  70.  
  71. TargetLastTarget() --target previous target
  72.  
  73. if (UnitIsUnit("Player", "Target") == 1) then --if current target is me then target previous target
  74. TargetLastTarget()
  75. else --otherwise set previous target as me and reset to default state
  76. TargetLastTarget()
  77. TargetByName("Synek", true)
  78. TargetLastTarget()
  79. SynCurse_Reset()
  80. end
  81. end
  82.  
  83.  
  84. function SynCurse_Reset() --resets essences to default state, setting all other states to 'off'
  85. UseAction(61)
  86. UseAction(65)
  87. UseAction(69)
  88. end
  89.  
  90.  
  91.  
  92.  
  93. --TO DO:
  94. --1) Resetting on target swap can still not working perfectly
  95. --2) Change cor state to coe state + cos state to reduce required number of action bar slots
  96. --3) Add intelligent use of lifetap, major mana pots, and dark/demonic runes
  97. --4) Add SynBuff functionality when out of combat
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement