Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Implement PQR_resumeAttack.. this is used to prevent
- --abilities lower in the rotation from being cast.
- if PQR_resumeAttack == nil then
- PQR_resumeAttack = 0
- elseif PQR_resumeAttack > GetTime() then
- return true
- else
- PQR_resumeAttack = 0
- end
- --IMPORTANT: Change this if you have any cleaves that would do damage to a secondary target
- --as part of your single target rotation. Better to be safe than sorry!
- --Used for : Spirit Kings
- local cleaveClass = false
- local isAOE = strmatch(strupper(PQR_RotationName), "AOE") --checks if we are in AOE mode.
- for i=1,4 do
- local bossCheck = "boss"..i
- if UnitExists(bossCheck) then
- local npcID = tonumber(UnitGUID(bossCheck):sub(6,10), 16)
- local bossCasting,_,_,_,_,castEnd = UnitCastingInfo(bossCheck)
- if npcID == 62511 or npcID == 62711 then --Amber-Shaper Un'sok or Amber Monstrosity
- local reshapeLife = UnitDebuffID("vehicle", 122370)
- local reshapeLife2 = UnitDebuffID("player", 122370)
- if reshapeLife or reshapeLife2 then
- local playerCasting = UnitCastingInfo("vehicle")
- local playerCasting2 = UnitCastingInfo("player")
- --grab spell names for abilities:
- local amberExplosion = GetSpellInfo(122402)
- --interrupt the target if casting amber explosion
- if bossCasting == amberExplosion then
- TargetUnit(bossCheck)
- --Press the 1st button (Amber Strike)
- RunMacroText("/click OverrideActionBarButton1")
- end
- --interrupt self if casting amber explosion
- if playerCasting == amberExplosion then
- --Press the 2nd button (Struggle for Control)
- RunMacroText("/click OverrideActionBarButton2")
- end
- --interrupt self if casting amber explosion
- if playerCasting2 == amberExplosion then
- --Press the 2nd button (Struggle for Control)
- RunMacroText("/click OverrideActionBarButton2")
- end
- return true --prevent the rotation from executing while reshaped
- end
- elseif npcID == 60709 then --Spirit Kings: Qiang. (Impervious Shield)
- --Stop all attacks until 0.2 seconds after cast time ends and until buff (Impervious Shield) is gone.
- --only continue checking if we are targetting the boss or have no target.
- if (not UnitExists("target")) or (UnitIsUnit("target", bossCheck)) or (cleaveClass or isAOE) then
- local impName = GetSpellInfo(117961)
- local impShieldBuff = UnitBuffID(bossCheck, 117961)
- if (bossCasting and bossCasting == impName) then
- StopAttack()
- SpellStopCasting()
- local delayAdd = (castEnd/1000) - GetTime() --the number of seconds remaining on the cast.
- PQR_resumeAttack = GetTime() + delayAdd + 0.2
- return true
- end
- if impShieldBuff then
- StopAttack()
- SpellStopCasting()
- return true
- end
- end
- elseif npcID == 60710 then --Spirit Kings: Subetai. (Sleight of Hand)
- --Stop all attacks when casting Sleight of Hand, and until 0.2 seconds after cast time ends.
- --Also stop attacks if not stunned.
- --only continue checking if we are targetting the boss or have no target.
- if (not UnitExists("target")) or (UnitIsUnit("target", bossCheck)) or (cleaveClass or isAOE) then
- local sleightName = GetSpellInfo(118162)
- local sleightBuff = UnitBuffID(bossCheck, 118162)
- -- HoJ, FoJ, Kidney
- local stunList = { 853, 105593, 408 }
- local isStunned = nil
- for _,v in ipairs(stunList) do
- local debuffCheck = UnitDebuffID(bossCheck, v)
- if debuffCheck then
- isStunned = true
- end
- end
- if (bossCasting and bossCasting == sleightName) then
- StopAttack()
- SpellStopCasting()
- local delayAdd = (castEnd/1000) - GetTime() --the number of seconds remaining on the cast.
- PQR_resumeAttack = GetTime() + delayAdd + 0.2
- return true
- end
- if sleightBuff and not isStunned then
- StopAttack()
- SpellStopCasting()
- return true
- end
- end
- elseif npcID == 60701 then --Spirit Kings: Zian. (Shield of Darkness)
- --Stop all attacks until 0.5 seconds after cast time ends and until buff (Shield of Darkness) is gone.
- if (not UnitExists("target")) or (UnitIsUnit("target", bossCheck)) or (cleaveClass or isAOE) then
- local sodName = GetSpellInfo(117697)
- local sodBuff = UnitBuffID(bossCheck, 117697)
- if (bossCasting and bossCasting == sodName) then
- StopAttack()
- SpellStopCasting()
- local delayAdd = (castEnd/1000) - GetTime() --the number of seconds remaining on the cast.
- PQR_resumeAttack = GetTime() + delayAdd + 0.5 --0.5 to account for lag... REALLY do not want to set this off.
- return true
- end
- if sodBuff then
- StopAttack()
- SpellStopCasting()
- return true
- end
- end
- end
- end
- end
- --click button to leave.
- --Gara'jal isn't a boss while in the Spirit Realm.
- local returnSoul = select(7,UnitDebuffID("player",116161))
- if returnSoul and returnSoul - GetTime() < 2 then
- RunMacroText("/click ExtraActionButton1")
- end
Advertisement
Add Comment
Please, Sign In to add comment