Guest User

Untitled

a guest
Nov 24th, 2012
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.98 KB | None | 0 0
  1. --Implement PQR_resumeAttack.. this is used to prevent
  2. --abilities lower in the rotation from being cast.
  3. if PQR_resumeAttack == nil then
  4. PQR_resumeAttack = 0
  5. elseif PQR_resumeAttack > GetTime() then
  6. return true
  7. else
  8. PQR_resumeAttack = 0
  9. end
  10.  
  11.  
  12. --IMPORTANT: Change this if you have any cleaves that would do damage to a secondary target
  13. --as part of your single target rotation. Better to be safe than sorry!
  14. --Used for : Spirit Kings
  15. local cleaveClass = false
  16. local isAOE = strmatch(strupper(PQR_RotationName), "AOE") --checks if we are in AOE mode.
  17.  
  18. for i=1,4 do
  19. local bossCheck = "boss"..i
  20. if UnitExists(bossCheck) then
  21. local npcID = tonumber(UnitGUID(bossCheck):sub(6,10), 16)
  22. local bossCasting,_,_,_,_,castEnd = UnitCastingInfo(bossCheck)
  23.  
  24. if npcID == 62511 or npcID == 62711 then --Amber-Shaper Un'sok or Amber Monstrosity
  25. local reshapeLife = UnitDebuffID("vehicle", 122370)
  26. local reshapeLife2 = UnitDebuffID("player", 122370)
  27. if reshapeLife or reshapeLife2 then
  28. local playerCasting = UnitCastingInfo("vehicle")
  29. local playerCasting2 = UnitCastingInfo("player")
  30. --grab spell names for abilities:
  31. local amberExplosion = GetSpellInfo(122402)
  32.  
  33. --interrupt the target if casting amber explosion
  34. if bossCasting == amberExplosion then
  35. TargetUnit(bossCheck)
  36. --Press the 1st button (Amber Strike)
  37. RunMacroText("/click OverrideActionBarButton1")
  38. end
  39.  
  40. --interrupt self if casting amber explosion
  41. if playerCasting == amberExplosion then
  42. --Press the 2nd button (Struggle for Control)
  43. RunMacroText("/click OverrideActionBarButton2")
  44. end
  45.  
  46. --interrupt self if casting amber explosion
  47. if playerCasting2 == amberExplosion then
  48. --Press the 2nd button (Struggle for Control)
  49. RunMacroText("/click OverrideActionBarButton2")
  50. end
  51.  
  52. return true --prevent the rotation from executing while reshaped
  53.  
  54. end
  55.  
  56. elseif npcID == 60709 then --Spirit Kings: Qiang. (Impervious Shield)
  57. --Stop all attacks until 0.2 seconds after cast time ends and until buff (Impervious Shield) is gone.
  58.  
  59. --only continue checking if we are targetting the boss or have no target.
  60. if (not UnitExists("target")) or (UnitIsUnit("target", bossCheck)) or (cleaveClass or isAOE) then
  61. local impName = GetSpellInfo(117961)
  62. local impShieldBuff = UnitBuffID(bossCheck, 117961)
  63.  
  64. if (bossCasting and bossCasting == impName) then
  65. StopAttack()
  66. SpellStopCasting()
  67. local delayAdd = (castEnd/1000) - GetTime() --the number of seconds remaining on the cast.
  68. PQR_resumeAttack = GetTime() + delayAdd + 0.2
  69. return true
  70. end
  71.  
  72. if impShieldBuff then
  73. StopAttack()
  74. SpellStopCasting()
  75. return true
  76. end
  77. end
  78.  
  79. elseif npcID == 60710 then --Spirit Kings: Subetai. (Sleight of Hand)
  80. --Stop all attacks when casting Sleight of Hand, and until 0.2 seconds after cast time ends.
  81. --Also stop attacks if not stunned.
  82.  
  83. --only continue checking if we are targetting the boss or have no target.
  84. if (not UnitExists("target")) or (UnitIsUnit("target", bossCheck)) or (cleaveClass or isAOE) then
  85. local sleightName = GetSpellInfo(118162)
  86. local sleightBuff = UnitBuffID(bossCheck, 118162)
  87. -- HoJ, FoJ, Kidney
  88. local stunList = { 853, 105593, 408 }
  89. local isStunned = nil
  90. for _,v in ipairs(stunList) do
  91. local debuffCheck = UnitDebuffID(bossCheck, v)
  92. if debuffCheck then
  93. isStunned = true
  94. end
  95. end
  96.  
  97. if (bossCasting and bossCasting == sleightName) then
  98. StopAttack()
  99. SpellStopCasting()
  100. local delayAdd = (castEnd/1000) - GetTime() --the number of seconds remaining on the cast.
  101. PQR_resumeAttack = GetTime() + delayAdd + 0.2
  102. return true
  103. end
  104.  
  105. if sleightBuff and not isStunned then
  106. StopAttack()
  107. SpellStopCasting()
  108. return true
  109. end
  110. end
  111.  
  112. elseif npcID == 60701 then --Spirit Kings: Zian. (Shield of Darkness)
  113. --Stop all attacks until 0.5 seconds after cast time ends and until buff (Shield of Darkness) is gone.
  114.  
  115. if (not UnitExists("target")) or (UnitIsUnit("target", bossCheck)) or (cleaveClass or isAOE) then
  116. local sodName = GetSpellInfo(117697)
  117. local sodBuff = UnitBuffID(bossCheck, 117697)
  118.  
  119. if (bossCasting and bossCasting == sodName) then
  120. StopAttack()
  121. SpellStopCasting()
  122. local delayAdd = (castEnd/1000) - GetTime() --the number of seconds remaining on the cast.
  123. PQR_resumeAttack = GetTime() + delayAdd + 0.5 --0.5 to account for lag... REALLY do not want to set this off.
  124. return true
  125. end
  126.  
  127. if sodBuff then
  128. StopAttack()
  129. SpellStopCasting()
  130. return true
  131. end
  132. end
  133. end
  134. end
  135. end
  136.  
  137. --click button to leave.
  138. --Gara'jal isn't a boss while in the Spirit Realm.
  139. local returnSoul = select(7,UnitDebuffID("player",116161))
  140. if returnSoul and returnSoul - GetTime() < 2 then
  141. RunMacroText("/click ExtraActionButton1")
  142. end
Advertisement
Add Comment
Please, Sign In to add comment