Skip to content

Instantly share code, notes, and snippets.

@gig3m
Created October 30, 2011 20:58
Show Gist options
  • Save gig3m/1326434 to your computer and use it in GitHub Desktop.
Save gig3m/1326434 to your computer and use it in GitHub Desktop.
function paladin_ret(self)
-- Rewrite for CDO by Kyletxag, altered from GoCargo's write.
local myHealthPercent = UnitHealth("player")/UnitHealthMax("player") * 100
local targetHealthPercent = UnitHealth("target")/UnitHealthMax("target") * 100
local myManaPercent = UnitMana("player")/UnitManaMax("player") * 100
local hPower = UnitPower("player","9")
local race = UnitRace("player")
local inqDuration = cdo.buff_duration("player","Inquisition")
local cdProgression
local cdProgressionZeal
-- Interrupt, works equally well with "focus" instead of "target"
if cdo.interrupts and cdo.should_interrupt("target") and cd("Rebuke") == 0 and myManaPercent >= 25 then
return "Rebuke"
end
-- Blood Elf Arcane Torrent
if cdo.interrupts and cdo.should_interrupt("target") and cd("Arcane Torrent") == 0 and race == "Blood Elf" then
return "Arcane Torrent"
end
-- Check for any Seal, if none, Seal of Truth
if not ub("player","Seal of Truth") and not ub("player", "Seal of Righteousness") and not ub("player", "Seal of Insight") and not ub("player", "Seal of Justice") then
return "Seal of Truth"
end
if myManaPercent < 35 and cd("Divine Plea") == 0 then
return "Divine Plea"
end
-- About to Die ?
if myHealthPercent < 10 and hPower == 3 then
return "Word of Glory"
end
-- Defensive Cooldowns (dying is bad)
if cdo.use_defensive_cd and cd("Divine Protection") == 0 then
return "Divine Protection"
elseif cdo.use_defensive_cd and myHealthPercent < 10 and cd("Lay on Hands") == 0 then
return "Lay on Hands"
-- Inquisition logic (Cannot get timers working right, commented out for now)
elseif not ub("player", "Inquisition") and ub("player", "Divine Purpose") then
return "Inquisition"
elseif ub("player", "Divine Purpose") and inqDuration < 3 and cdProgressionZeal ~= 1 then
return "Inquisition"
elseif not ub("player", "Inquisition") and hPower == 3 and cdProgressionZeal ~= 1 then
return "Inquisition"
-- Cooldown Logic Pre-T12 4pc
elseif cdo.use_offensive_cd and cdProgression ~= 1 and cd("Guardian of Ancient Kings") == 0 and cd("Zealotry") == 0 and cd("Avenging Wrath") == 0 then
-- Start the line up
cdProgression = 1
cdProgressionZeal = 1
print("Lining up cooldowns")
print(cdProgression)
return nil
elseif cdo.use_offensive_cd and cdProgression == 1 and cd("player", "Guardian of Ancient Kings") == 0 then
return "Guardian of Ancient Kings"
elseif cdo.use_offensive_cd and cdProgression == 1 and cdo.buff_duration("player", "Guardian of Ancient Kings") < 30 and hpower == 3 then
cdProgressionZeal = nil
return "Zealotry"
elseif cdo.use_offensive_cd and cdProgression == 1 and ub("player", "Divine Purpose") and cdo.buff_duration("Guardian of Ancient Kings") < 30 then
cdProgressionZeal = nil
return "Zealotry"
elseif cdo.use_offensive_cd and cdProgression == 1 and cdo.buff_duration("player", "Guardian of Ancient Kings") < 21 then
print(cdo.buff_duration("player", "Guardian of Ancient Kings"))
print("Casting AW, line up over.")
cdProgression = nil
cdProgressionZeal = nil
return "Avenging Wrath"
-- Zealotry logic for CD usage
elseif cdo.use_offensive_cd and cdProgression ~= 1 and ub("player", "Divine Purpose") and cd("Zealotry") == 0 then
return "Zealotry"
elseif cdo.use_offensive_cd and cdProgression ~= 1 and hPower == 3 and cd("Zealotry") == 0 then
return "Zealotry"
-- Other Offensive CDs
elseif cdo.use_offensive_cd and cdProgression ~= 1 and cd("Avenging Wrath") == 0 then
return "Avenging Wrath"
elseif cdo.use_offensive_cd and cdProgression ~= 1 and cd("Guardian of Ancient Kings") == 0 then
return "Guardian of Ancient Kings"
--TEMPLAR'S VERDICT LOGIC--
elseif ub("player", "Divine Purpose") then
return "Templar's Verdict"
elseif hPower == 3 then
return "Templar's Verdict"
-- Crusader Strike / Divine Storm based on MultiTarget
elseif cd("Crusader Strike") == 0 and not cdo.multi_target then
return "Crusader Strike"
elseif cd("Divine Storm") == 0 and cdo.multi_target then
return "Divine Storm"
-- Hammer during execute mode or Avenging wrath
elseif targetHealthPercent < 20 and cd("Hammer of Wrath") == 0 then
return "Hammer of Wrath"
elseif ub("player", "Avenging Wrath") and cd("Hammer of Wrath") == 0 then
return "Hammer of Wrath"
--EXORCISM LOGIC--
elseif ub("player", "The Art of War") and cd("Exorcism")==0 then
return "Exorcism"
--JUDGEMENT LOGIC--
elseif cd("Judgement") == 0 then
return "Judgement"
--HOLY WRATH--
elseif cd("Holy Wrath") == 0 then
return "Holy Wrath"
--TIME TO GO OOM--
elseif cd("Consecration") == 0 then
return "Consecration"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment