Skip to content

Instantly share code, notes, and snippets.

@gig3m
Created October 30, 2011 22:56

Revisions

  1. gig3m created this gist Oct 30, 2011.
    125 changes: 125 additions & 0 deletions paladin_ret.lua
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,125 @@
    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")

    -- 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 cdo.use_defensive_cd and myManaPercent < 35 and cd("Divine Plea") == 0 then
    return "Divine Plea"
    end

    -- About to Die ?
    if cdo.use_defensive_cd and myHealthPercent < 10 and hPower == 3 then
    return "Word of Glory"
    end

    -- Cooldowns (Must remain in a seperate "if" block in case nothing returns)
    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"

    -- Cooldown Logic Pre-T12 4pc
    elseif cdo.use_offensive_cd and cdo.cdProgression ~= 1 and cd("Guardian of Ancient Kings") == 0 and cd("Zealotry") == 0 and cd("Avenging Wrath") == 0 then
    -- Start the line up
    cdo.cdProgression = 1
    cdo.cdProgressionZeal = 1
    print("Lining up cooldowns")
    return nil

    elseif cdo.use_offensive_cd and cdo.cdProgression == 1 then

    if cd("Guardian of Ancient Kings") == 0 then
    return "Guardian of Ancient Kings"
    end
    if cd("Zealotry") == 0 and cdo.buff_duration("player", "Guardian of Ancient Kings") < 30 and hPower == 3 then
    cdo.cdProgressionZeal = nil
    return "Zealotry"
    end
    if cd("Zealotry") == 0 and ub("player", "Divine Purpose") and cdo.buff_duration("player", "Guardian of Ancient Kings") < 30 then
    cdo.cdProgressionZeal = nil
    return "Zealotry"
    end
    if cdo.buff_duration("player", "Guardian of Ancient Kings") < 22 then
    cdo.cdProgression = nil
    cdo.cdProgressionZeal = nil
    return "Avenging Wrath"
    end


    --Zealotry logic for CD usage
    elseif cdo.use_offensive_cd and cdo.cdProgression ~= 1 and ub("player", "Divine Purpose") and cd("Zealotry") == 0 then
    return "Zealotry"
    elseif cdo.use_offensive_cd and cdo.cdProgression ~= 1 and hPower == 3 and cd("Zealotry") == 0 then
    return "Zealotry"

    --Other Offensive CDs
    elseif cdo.use_offensive_cd and cdo.cdProgression ~= 1 and cd("Avenging Wrath") == 0 then
    return "Avenging Wrath"
    elseif cdo.use_offensive_cd and cdo.cdProgression ~= 1 and cd("Guardian of Ancient Kings") == 0 then
    return "Guardian of Ancient Kings"
    end

    -- Crusader Strike / Divine Storm based on MultiTarget
    if (GetTime()+0.4) >= ( select(1, cd("Crusader Strike")) + select(2, cd("Crusader Strike")) ) and not cdo.multi_target then
    return "Crusader Strike"
    elseif cd("Divine Storm") == 0 and cdo.multi_target then
    return "Divine Storm"

    -- 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 then
    return "Inquisition"
    elseif not ub("player", "Inquisition") and hPower == 3 then
    return "Inquisition"

    --TEMPLAR'S VERDICT LOGIC--
    elseif ub("player", "Divine Purpose") then
    return "Templar's Verdict"
    elseif hPower == 3 then
    return "Templar's Verdict"

    -- 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 and myManaPercent > 60 then
    return "Consecration"

    end

    end