Vachiusa, might be worth to add this Xelper code to -- Events? (for MW and others)
PHP Code:
--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 reshapeName = GetSpellInfo(122370)
local reshapeLife = UnitDebuff("player", reshapeName)
if reshapeLife ~= nil then
local playerCasting = UnitCastingInfo("vehicle")
local playerCasting2 = UnitCastingInfo("player")
--grab spell names for abilities:
local amberExplosion = GetSpellInfo(122402)
--interrupt self if casting amber explosion
if playerCasting == amberExplosion then
--Press the 2nd button (Struggle for Control)
RunMacroText("/click OverrideActionBarButton2")
return true
end
--interrupt self if casting amber explosion
if playerCasting2 == amberExplosion then
--Press the 2nd button (Struggle for Control)
RunMacroText("/click OverrideActionBarButton2")
return true
end
--interrupt the target if casting amber explosion
if bossCasting and bossCasting == amberExplosion then
TargetUnit(bossCheck)
--Press the 1st button (Amber Strike)
RunMacroText("/click OverrideActionBarButton1")
return true
end
if UnitExists("boss2") then
if bossCheck == "boss2" then
return true --prevent the rotation from executing while reshaped
end
else
return true
end
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