diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/.DS_Store differ diff --git a/DiscPriest.lua b/DiscPriest.lua index ea3b57d..dab95f6 100644 --- a/DiscPriest.lua +++ b/DiscPriest.lua @@ -82,8 +82,10 @@ local AtoneTarget = Bastion.UnitManager:CreateCustomUnit('atonetarget', function local atonementBuff = unit:GetAuras():FindMy(Atonement) if not atonementBuff:IsUp() then - target = unit - return true + if unit:GetHP() >= 70 and unit:GetHP() <= 90 then + target = unit + return true + end elseif atonementBuff:GetRemainingTime() < lowestAtonementTime then target = unit lowestAtonementTime = atonementBuff:GetRemainingTime() @@ -264,27 +266,58 @@ DiscPriestModule:Sync(function() return end + -- Prioritize Defensive APL DefensiveAPL:Execute() if Player:IsAffectingCombat() then + -- Prioritize cooldowns if necessary CooldownAPL:Execute() + + -- Apply Atonement to targets before proceeding with DPS + if AtoneTarget:Exists() and not AtoneTarget:GetAuras():FindMy(Atonement):IsUp() then + if not AtoneTarget:GetAuras():FindMy(PowerWordShield):IsUp() and not AtoneTarget:GetAuras():FindMy(WeakenedSoul):IsUp() then + PowerWordShield:Cast(AtoneTarget) + elseif AtoneTarget:GetHP() <= 90 and not AtoneTarget:GetAuras():FindMy(Renew):IsUp() then + Renew:Cast(AtoneTarget) + elseif AtoneTarget:GetHP() <= 80 then + FlashHeal:Cast(AtoneTarget) + elseif AtoneTarget:GetAuras():FindMy(Atonement):IsUp() and Penance:IsKnownAndUsable() then + Penance:Cast(AtoneTarget) + end + end + + -- Execute Default and DPS APLs DefaultAPL:Execute() DpsAPL:Execute() + else -- Out of combat healing and preparation if AtoneTarget:Exists() and not AtoneTarget:GetAuras():FindMy(Atonement):IsUp() then if not AtoneTarget:GetAuras():FindMy(PowerWordShield):IsUp() and not AtoneTarget:GetAuras():FindMy(WeakenedSoul):IsUp() then PowerWordShield:Cast(AtoneTarget) - elseif AtoneTarget:GetHP() < 90 and not AtoneTarget:GetAuras():FindMy(Renew):IsUp() then + elseif AtoneTarget:GetHP() <= 90 and not AtoneTarget:GetAuras():FindMy(Renew):IsUp() then Renew:Cast(AtoneTarget) - elseif AtoneTarget:GetHP() < 80 then + elseif AtoneTarget:GetHP() <= 80 then FlashHeal:Cast(AtoneTarget) elseif AtoneTarget:GetAuras():FindMy(Atonement):IsUp() and Penance:IsKnownAndUsable() then Penance:Cast(AtoneTarget) end end - -- Apply Purge the Wicked to main target if not in combat and about to pull + -- Top off teammates' health to 100% + Bastion.UnitManager:EnumFriends(function(unit) + if unit:GetHP() < 100 and Player:CanSee(unit) and Player:GetDistance(unit) <= 40 then + if not unit:GetAuras():FindMy(WeakenedSoul):IsUp() and PowerWordShield:IsKnownAndUsable() then + PowerWordShield:Cast(unit) + elseif FlashHeal:IsKnownAndUsable() then + FlashHeal:Cast(unit) + elseif Renew:IsKnownAndUsable() and not unit:GetAuras():FindMy(Renew):IsUp() then + Renew:Cast(unit) + end + end + end) + + -- Prepare for combat by applying buffs and debuffs if Target:Exists() and Target:IsEnemy() and PurgeTheWicked:IsKnownAndUsable() and not Player:IsCastingOrChanneling() then if not Target:GetAuras():FindMy(PurgeTheWickedDebuff):IsUp() and Player:IsWithinCombatDistance(Target, 40) then PurgeTheWicked:Cast(Target) @@ -293,4 +326,5 @@ DiscPriestModule:Sync(function() end end) +-- Register the DiscPriest module with Bastion Bastion:Register(DiscPriestModule)