Skip to content

Instantly share code, notes, and snippets.

@ineersa
Created May 11, 2017 13:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ineersa/2edc74300bf87934b567f518a870183b to your computer and use it in GitHub Desktop.
Save ineersa/2edc74300bf87934b567f518a870183b to your computer and use it in GitHub Desktop.
<?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 = &amp;quot;target&amp;quot;
local fTarget = &amp;quot;focus&amp;quot;
local a1 = &amp;quot;arena1&amp;quot;
local a2 = &amp;quot;arena2&amp;quot;
local a3 = &amp;quot;arena3&amp;quot;
local a1p = &amp;quot;arenapet1&amp;quot;
local a2p = &amp;quot;arenapet2&amp;quot;
local a3p = &amp;quot;arenapet3&amp;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,&amp;quot;Polymorph&amp;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()) &amp;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(&amp;quot;player&amp;quot;) == nil
and UnitChannelInfo(&amp;quot;player&amp;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(&amp;quot;player&amp;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 &amp;gt; 1 then
cdkeydown = GetTime()
if Enabled then
Enabled = false
PQR_WriteToChat(&amp;quot;Rotation: |cFFFF0000Disabled&amp;quot;)
else
Enabled = true
PQR_WriteToChat(&amp;quot;Rotation: |cFF00FF00Enabled&amp;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()) &amp;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()) &amp;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 == (&amp;quot;Arcane Blast&amp;quot;) or Spell == (&amp;quot;Cyclone&amp;quot;) or Spell == (&amp;quot;Mind Control&amp;quot;) or Spell == (&amp;quot;Polymorph&amp;quot;) or Spell == (&amp;quot;Lava Burst&amp;quot;) or Spell == (&amp;quot;Entangling Roots&amp;quot;) or Spell == (&amp;quot;Hex&amp;quot;) or Spell == (&amp;quot;Chaos Bolt&amp;quot;) or Spell == (&amp;quot;Death Coil&amp;quot;) or Spell == (&amp;quot;Vampiric touch&amp;quot;) or Spell == (&amp;quot;Repentance&amp;quot;) or Spell == (&amp;quot;Hammer of Justice&amp;quot;) or Spell == (&amp;quot;Fear&amp;quot;) or PQR_CustomTargetHP &amp;lt; 20
then
if cdRemains(WindShear) ~= 0
and ((endCast/1000) - GetTime()) &amp;lt; 0.4
then
_castSpell(GroundingTotem)
end
return true
end
--Focus target
local spellName, _, _, _, _, endCast, _, _, canInterrupt = UnitCastingInfo(fTarget)
if Spell == (&amp;quot;Arcane Blast&amp;quot;) or Spell == (&amp;quot;Cyclone&amp;quot;) or Spell == (&amp;quot;Mind Control&amp;quot;) or Spell == (&amp;quot;Polymorph&amp;quot;) or Spell == (&amp;quot;Lava Burst&amp;quot;) or Spell == (&amp;quot;Entangling Roots&amp;quot;) or Spell == (&amp;quot;Hex&amp;quot;) or Spell == (&amp;quot;Chaos Bolt&amp;quot;) or Spell == (&amp;quot;Death Coil&amp;quot;) or Spell == (&amp;quot;Vampiric touch&amp;quot;) or Spell == (&amp;quot;Repentance&amp;quot;) or Spell == (&amp;quot;Hammer of Justice&amp;quot;) or Spell == (&amp;quot;Fear&amp;quot;) or PQR_CustomTargetHP &amp;lt; 20
then
if cdRemains(WindShear) ~= 0
and ((endCast/1000) - GetTime()) &amp;lt; 0.4
then
_castSpell(GroundingTotem)
end
return true
end
-- Flame shock
if rangeCheck(FlameShock, tTarget) == 1
and UnitDebuffID(tTarget, FlameShock, &amp;quot;player&amp;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 &amp;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