Skip to content

Instantly share code, notes, and snippets.

@akasfei
Last active April 27, 2016 04:25
Show Gist options
  • Save akasfei/0fe3a697af914a1ff4ae0625d02a3e4f to your computer and use it in GitHub Desktop.
Save akasfei/0fe3a697af914a1ff4ae0625d02a3e4f to your computer and use it in GitHub Desktop.
TDDPS-priest
-- Author : Kaminari
-- Create Date : 13:03 2015-04-20
local myclass = select(2, UnitClass("player"));
if myclass ~= 'PRIEST' then return; end
-- Spells
local _MindFlay = 15407;
local _MindBlast = 8092;
local _ShadowWordPain = 589;
local _ShadowWordDeath= 32379;
local _DevouringPlague= 2944;
local _MindSpike = 73510;
local _Mindbender = 123040;
local _Shadowfiend = 34433;
local _VampiricTouch = 34914;
-- Auras
local _SurgeOfDarkness = 87160;
local _Insanity = 132573;
local _MindFatigue = 185104;
-- Talents
local _isClarityOfPower = false;
local _isMindbender = false;
-- Trinkets
local _RepudiationOfWar = 124519;
----------------------------------------------
-- Pre enable, checking talents
----------------------------------------------
TDDps_Priest_CheckTalents = function()
_isClarityOfPower = TD_TalentEnabled('Clarity of Power');
_isMindbender = TD_TalentEnabled('Mindbender');
-- other checking functions
end
----------------------------------------------
-- Enabling Addon
----------------------------------------------
function TDDps_Priest_EnableAddon(mode)
mode = mode or 1;
_TD["DPS_Description"] = "TD Priest DPS supports: Shadow";
_TD["DPS_OnEnable"] = TDDps_Priest_CheckTalents;
if mode == 1 then
_TD["DPS_NextSpell"] = TDDps_Priest_Discipline;
end;
if mode == 2 then
_TD["DPS_NextSpell"] = TDDps_Priest_Holy;
end;
if mode == 3 then
_TD["DPS_NextSpell"] = TDDps_Priest_Shadow;
end;
TDDps_EnableAddon();
end
----------------------------------------------
-- Main rotation: Discipline
----------------------------------------------
TDDps_Priest_Discipline = function()
local lcd, currentSpell, gcd = TD_EndCast();
local timeShift = lcd;
if gcd > timeShift then
timeShift = gcd;
end
return _Spell;
end
----------------------------------------------
-- Main rotation: Holy
----------------------------------------------
TDDps_Priest_Holy = function()
local lcd, currentSpell, gcd = TD_EndCast();
local timeShift = lcd;
if gcd > timeShift then
timeShift = gcd;
end
return _Spell;
end
----------------------------------------------
-- Main rotation: Shadow
----------------------------------------------
TDDps_Priest_Shadow = function()
local lcd, currentSpell, gcd = TD_EndCast();
local timeShift = lcd;
if gcd > timeShift then
timeShift = gcd;
end
local gcdFull = TD_GlobalCooldown();
local orbs = UnitPower('player', SPELL_POWER_SHADOW_ORBS);
local mbCd = TD_SpellAvailable(_MindBlast, timeShift);
local targetPH = TD_TargetPercentHealth();
local death = TD_SpellAvailable(_ShadowWordDeath, timeShift);
local surge = TD_Aura(_SurgeOfDarkness, timeShift);
local insanity = TD_Aura(_Insanity, timeShift);
local swp = TD_TargetAura(_ShadowWordPain, timeShift + 5)
local vt = TD_TargetAura(_VampiricTouch, timeShift + 4)
local row = IsEquippedItem(_RepudiationOfWar);
local mf_1gcd = TD_TargetAura(_MindFatigue, timeShift + gcdFull + 1)
local mf_2gcd = TD_TargetAura(_MindFatigue, timeShift + gcdFull * 2 + 1)
local mf_3gcd = TD_TargetAura(_MindFatigue, timeShift + gcdFull * 3 + 1)
if _isMindbender then
if TD_SpellAvailable(_Mindbender, timeShift) then
TDButton_GlowIndependent(_Mindbender, _Mindbender, 0.75, 0.5, 1);
else
TDButton_ClearGlowIndependent(_Mindbender, _Mindbender);
end
else
if TD_SpellAvailable(_Shadowfiend, timeShift) then
TDButton_GlowIndependent(_Shadowfiend, _Mindbender, 0.75, 0.5, 1);
else
TDButton_ClearGlowIndependent(_Shadowfiend, _Mindbender);
end
end
--[[
if not mf_3gcd then
if not mf_1gcd then
return _MindFlay;
end
if not mf_2gcd and orbs >= 3 then
return _DevouringPlague;
end
if not mf_3gcd and orbs >=3 and TD_SpellAvailable(_MindBlast, gcd * 2) then
return _DevouringPlague;
end
end
--]]
if mbCd and orbs < 5 and currentSpell ~= 'Mind Blast' then
return _MindBlast;
end
if targetPH < 0.2 and death and orbs < 5 then
return _ShadowWordDeath;
end
if insanity then
return _MindFlay;
end
if orbs >= 3 then
if row then
if not mf_2gcd then
return _DevouringPlague;
end
if not mf_3gcd and TD_SpellAvailable(_MindBlast, timeShift + gcdFull) and not mbCd then
return _DevouringPlague;
end
if orbs == 5 and TD_SpellAvailable(_MindBlast, timeShift + gcdFull) then
return _DevouringPlague;
end
else
if swp and vt then
return _DevouringPlague;
elseif orbs == 5 then
if mbcd then
return _DevouringPlague;
elseif not swp then
return _ShadowWordPain;
elseif not vt then
return _VampiricTouch;
end
end
end
end
if row and not mf_1gcd then
return _MindFlay;
end
if surge and currentSpell ~= 'Mind Spike' then
return _MindSpike;
end
if not swp and not _isClarityOfPower then
return _ShadowWordPain;
end
if not vt and not _isClarityOfPower and currentSpell ~= 'Vampiric Touch' then
return _VampiricTouch;
end
if _isClarityOfPower then
return _MindSpike;
end
return _MindFlay;
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment