-
-
Save ineersa/2edc74300bf87934b567f518a870183b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?><SHAMAN><Ability><Name>scripts</Name><Default>false</Default><SpellID>0</SpellID><Actions></Actions><Lua> | |
local Enabled = false | |
-- Use chain or nope | |
local Cleave = true | |
-- INIT VARIABLES | |
local tTarget = &quot;target&quot; | |
local fTarget = &quot;focus&quot; | |
local a1 = &quot;arena1&quot; | |
local a2 = &quot;arena2&quot; | |
local a3 = &quot;arena3&quot; | |
local a1p = &quot;arenapet1&quot; | |
local a2p = &quot;arenapet2&quot; | |
local a3p = &quot;arenapet3&quot; | |
-- SPELLS INIT | |
local ElementalMastery = 16166 | |
local LightningBolt = 49238 | |
local FlameShock = 49233 | |
local FrostShock = 49236 | |
local LavaBurst = 60043 | |
local WindShear = 57994 | |
local WaterShield = 57960 | |
local ChainLightning = 49271 | |
local GroundingTotem = 8177 | |
local Purge = 8012 | |
local StoneclawTotem = 58582 | |
local EarthbindTotem = 38304 | |
local FrostShock = 49236 | |
local InterruptHeals = { 48785,48782,48071,48063,50464,48443,48378,48120,49273,49276 } | |
local InterruptCC = { 51514,6215,10955,48160,33786,12826,712,697,691,18647,53308.47843,118,6358,61305,61721,28272,28271,61025,61780,47811,712,697,691,32375,&quot;Polymorph&quot; } | |
--INIT OF FUNCTIONS | |
function DebugPrint(s) | |
if debug then | |
PQR_WriteToChat(s) | |
end | |
end | |
--Amount of Cooldown that remains-- | |
function cdRemains(spellid) | |
if select(2,GetSpellCooldown(spellid)) + (select(1,GetSpellCooldown(spellid)) - GetTime()) &gt; 0 | |
then return select(2,GetSpellCooldown(spellid)) + (select(1,GetSpellCooldown(spellid)) - GetTime()) | |
else return 0 | |
end | |
end | |
--CastSpell-- | |
function _castSpell(spellid,tar) | |
if UnitCastingInfo(&quot;player&quot;) == nil | |
and UnitChannelInfo(&quot;player&quot;) == nil | |
and cdRemains(spellid) == 0 | |
then | |
if tar ~= nil | |
and rangeCheck(spellid,tar) == nil | |
then | |
return false | |
elseif tar ~= nil | |
and rangeCheck(spellid,tar) == true | |
then | |
CastSpellByID(spellid, tar) | |
return true | |
elseif tar == nil | |
then | |
CastSpellByID(spellid) | |
return true | |
else | |
return false | |
end | |
end | |
end | |
--Combat Check-- | |
function inCombat() | |
if UnitAffectingCombat(&quot;player&quot;) ~= nil | |
then | |
return true | |
end | |
end | |
--Range Check Simple-- | |
function rangeCheck(spellid,unit) | |
if IsSpellInRange(GetSpellInfo(spellid),unit) == 1 | |
then | |
return true | |
end | |
end | |
-- Disabling rotation on right control | |
if not cdkeydown then cdkeydown = 0 end | |
if not GetCurrentKeyBoardFocus() and IsRightControlKeyDown() and GetTime() - cdkeydown &gt; 1 then | |
cdkeydown = GetTime() | |
if Enabled then | |
Enabled = false | |
PQR_WriteToChat(&quot;Rotation: |cFFFF0000Disabled&quot;) | |
else | |
Enabled = true | |
PQR_WriteToChat(&quot;Rotation: |cFF00FF00Enabled&quot;) | |
end | |
end | |
-- Try to kick cast for target | |
function kickCast(unit) | |
if UnitExists(unit) then | |
local spellName, _, _, _, _, endCast, _, _, canInterrupt = UnitCastingInfo(unit) | |
for _, v in ipairs(InterruptCC) do | |
if GetSpellInfo(v) == spellName and canInterrupt == false then | |
if ((endCast/1000) - GetTime()) &lt; 0.3 | |
and not PQR_IsOutOfSight(unit) | |
and rangeCheck(WindShear, unit) == 1 | |
and cdRemains(WindShear) == 0 | |
then | |
_castSpell(WindShear, unit) | |
return true | |
end | |
end | |
end | |
for _, v in ipairs(InterruptHeals) do | |
if GetSpellInfo(v) == spellName and canInterrupt == false then | |
if ((endCast/1000) - GetTime()) &lt; 0.3 | |
and not PQR_IsOutOfSight(unit) | |
and rangeCheck(WindShear, unit) == 1 | |
and cdRemains(WindShear) == 0 | |
then | |
_castSpell(WindShear, unit) | |
return true | |
end | |
end | |
end | |
end | |
return false | |
end | |
-- Auto rotation implementation | |
kickCast(tTarget); | |
kickCast(fTarget); | |
-- Grounding totem | |
--Target | |
local spellName, _, _, _, _, endCast, _, _, canInterrupt = UnitCastingInfo(tTarget) | |
if Spell == (&quot;Arcane Blast&quot;) or Spell == (&quot;Cyclone&quot;) or Spell == (&quot;Mind Control&quot;) or Spell == (&quot;Polymorph&quot;) or Spell == (&quot;Lava Burst&quot;) or Spell == (&quot;Entangling Roots&quot;) or Spell == (&quot;Hex&quot;) or Spell == (&quot;Chaos Bolt&quot;) or Spell == (&quot;Death Coil&quot;) or Spell == (&quot;Vampiric touch&quot;) or Spell == (&quot;Repentance&quot;) or Spell == (&quot;Hammer of Justice&quot;) or Spell == (&quot;Fear&quot;) or PQR_CustomTargetHP &lt; 20 | |
then | |
if cdRemains(WindShear) ~= 0 | |
and ((endCast/1000) - GetTime()) &lt; 0.4 | |
then | |
_castSpell(GroundingTotem) | |
end | |
return true | |
end | |
--Focus target | |
local spellName, _, _, _, _, endCast, _, _, canInterrupt = UnitCastingInfo(fTarget) | |
if Spell == (&quot;Arcane Blast&quot;) or Spell == (&quot;Cyclone&quot;) or Spell == (&quot;Mind Control&quot;) or Spell == (&quot;Polymorph&quot;) or Spell == (&quot;Lava Burst&quot;) or Spell == (&quot;Entangling Roots&quot;) or Spell == (&quot;Hex&quot;) or Spell == (&quot;Chaos Bolt&quot;) or Spell == (&quot;Death Coil&quot;) or Spell == (&quot;Vampiric touch&quot;) or Spell == (&quot;Repentance&quot;) or Spell == (&quot;Hammer of Justice&quot;) or Spell == (&quot;Fear&quot;) or PQR_CustomTargetHP &lt; 20 | |
then | |
if cdRemains(WindShear) ~= 0 | |
and ((endCast/1000) - GetTime()) &lt; 0.4 | |
then | |
_castSpell(GroundingTotem) | |
end | |
return true | |
end | |
-- Flame shock | |
if rangeCheck(FlameShock, tTarget) == 1 | |
and UnitDebuffID(tTarget, FlameShock, &quot;player&quot;) == nil | |
then | |
_castSpell(FlameShock, tTarget) | |
return true | |
end | |
-- Lava Burst | |
if rangeCheck(LavaBurst, tTarget) == 1 | |
and PQR_IsCastingSpell(LavaBurst) == false | |
then | |
_castSpell(LavaBurst, tTarget) | |
return true | |
end | |
-- Chain lightning | |
if Cleave == true | |
and rangeCheck(ChainLightning, tTarget) == 1 | |
and PQR_IsCastingSpell(ChainLightning) == false | |
then | |
_castSpell(ChainLightning, tTarget) | |
return true | |
end | |
-- Linghtning bolt | |
if rangeCheck(LightningBolt, tTarget) == 1 | |
and PQR_IsCastingSpell(LightningBolt) == false | |
then | |
_castSpell(LightningBolt, tTarget) | |
return true | |
end | |
-- Purge | |
if not EnemyBuff | |
then | |
function EnemyBuff(t) | |
local buff = { 43242, 31884, 2825, 32182, 1719, 17, 6940, 11426, 29166, 54428, 17116, 63411, 63410, 48441, 53251, 48443, 48470, 48469, 42995, 43002, 43008, 43012, 43046, 53601, 48932, 48934, 48936, 48938, 25898, 25899, 10278, 1044, 53563, 20911, 20216, 31842, 53530, 53488, 31821, 48073, 48074, 48161, 48162, 48113, 48170, 55198, 16166, 16188, 49284 } | |
for i=1, #buff do if UnitBuffID(t,buff[i]) then return true end end | |
end | |
end | |
if EnemyBuff(tTarget) | |
then | |
_castSpell(Purge, tTarget) | |
return true | |
end | |
--Stoneclaw Totem | |
if UnitHealth("player") / UnitHealthMax("player") * 100 &lt; 75 | |
then | |
_castSpell(StoneclawTotem) | |
return true | |
end | |
-- Slowing engine | |
--Function Check Snares-- | |
local PvPslows = { | |
45524, -- Chains of Ice | |
50435, -- Chilblains | |
50259, -- Dazed | |
58180, -- Infected Wounds | |
5116, -- Concussive Shot | |
120, -- Cone of Cold | |
116, -- Frostbolt | |
44614, -- Frostfire Bolt | |
3409, -- Crippling Poison | |
8056, -- Frost Shock | |
51490, -- Thunderstorm | |
1715, -- Hamstring | |
1604, -- Dazed | |
12323, -- Piercing Howl | |
} | |
function isSlowed(unit) | |
for i=1,#PvPslows do | |
if UnitDebuffID(unit,PvPslows[i]) ~= nil | |
then | |
return true | |
end | |
end | |
end | |
-- If not slowed - cast frost shock | |
if not isSlowed(tTarget) | |
and rangeCheck(FrostShock, tTarget) == 1 | |
then | |
_castSpell(FrostShock, tTarget) | |
return true | |
end | |
-- Burst from elemental mastery | |
if IsLeftAltKeyDown() | |
then | |
_castSpell(ElementalMastery) | |
_castSpell(LavaBurst, tTarget) | |
return true | |
end | |
--TODO | |
--IMPLEMENT TOTEMS | |
--TREMOR | |
--EARTHBIND | |
--STONECLAW | |
--IMPLEMENT FROST SHOCK | |
--IMPLEMENT BURST FROM ELEMENTAL MASTERY | |
--IMPLEMENT WOLF USAGE IN PVP SLOWS? | |
</Lua><RecastDelay>0</RecastDelay><Target>Target</Target><CancelChannel>False</CancelChannel><LuaBefore></LuaBefore><LuaAfter></LuaAfter></Ability></SHAMAN> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment