diff --git a/DiscPriest.lua b/DiscPriest.lua index f2e2f8f..ea3b57d 100644 --- a/DiscPriest.lua +++ b/DiscPriest.lua @@ -9,7 +9,6 @@ local SpellBook = Bastion.SpellBook:New() -- Spells local PowerWordShield = SpellBook:GetSpell(17) -local PurgeTheWicked = SpellBook:GetSpell(204197) local Penance = SpellBook:GetSpell(47540) local PowerWordRadiance = SpellBook:GetSpell(194509) local Shadowfiend = SpellBook:GetSpell(34433) @@ -31,7 +30,6 @@ local Voidwraith = SpellBook:GetSpell(406786) -- Buffs and Debuffs local Atonement = SpellBook:GetSpell(194384) -local PurgeTheWickedDebuff = SpellBook:GetSpell(204213) local PowerOfTheDarkSide = SpellBook:GetSpell(198068) local ShadowCovenantBuff = SpellBook:GetSpell(322105) local WeakenedSoul = SpellBook:GetSpell(6788) @@ -95,15 +93,17 @@ local AtoneTarget = Bastion.UnitManager:CreateCustomUnit('atonetarget', function return target or Player end) -local PurgeTheWickedTarget = Bastion.UnitManager:CreateCustomUnit('purgethewickedtarget', function(unit) +-- Target the highest HP enemy for DPS APL +local HighestHPTarget = Bastion.UnitManager:CreateCustomUnit('highesthptarget', function(unit) local target = nil + local highestHP = 0 Bastion.UnitManager:EnumEnemies(function(unit) if unit:IsAffectingCombat() and Player:IsWithinCombatDistance(unit, 40) and Player:CanSee(unit) then - local aura = unit:GetAuras():FindMy(PurgeTheWickedDebuff) - if not aura:IsUp() then + local hp = unit:GetHP() + if hp > highestHP then target = unit - return true + highestHP = hp end end end) @@ -144,6 +144,13 @@ DefaultAPL:AddSpell( end):SetTarget(Player) ) +DefaultAPL:AddSpell( + Penance:CastableIf(function(self) + return AtoneTarget:Exists() and self:IsKnownAndUsable() and not Player:IsCastingOrChanneling() + and not AtoneTarget:GetAuras():FindMy(Atonement):IsUp() + end):SetTarget(AtoneTarget) +) + DefaultAPL:AddSpell( Renew:CastableIf(function(self) return Lowest:Exists() and self:IsKnownAndUsable() and not Player:IsCastingOrChanneling() @@ -184,13 +191,13 @@ CooldownAPL:AddSpell( Shadowfiend:CastableIf(function(self) return self:IsKnownAndUsable() and not Player:IsCastingOrChanneling() and not VoidwraithTalent:IsKnownAndUsable() - end):SetTarget(Target) + end):SetTarget(HighestHPTarget) ) CooldownAPL:AddSpell( Voidwraith:CastableIf(function(self) return self:IsKnownAndUsable() and not Player:IsCastingOrChanneling() - end):SetTarget(Target) + end):SetTarget(HighestHPTarget) ) -- Defensive APL @@ -216,47 +223,39 @@ DefensiveAPL:AddSpell( ) -- DPS APL -DpsAPL:AddSpell( - PurgeTheWicked:CastableIf(function(self) - return PurgeTheWickedTarget:Exists() and self:IsKnownAndUsable() and not Player:IsCastingOrChanneling() - and not PurgeTheWickedTarget:GetAuras():FindMy(PurgeTheWickedDebuff):IsUp() - and Player:IsWithinCombatDistance(PurgeTheWickedTarget, 40) - end):SetTarget(PurgeTheWickedTarget) -) - DpsAPL:AddSpell( Schism:CastableIf(function(self) - return Target:Exists() and self:IsKnownAndUsable() and not Player:IsCastingOrChanneling() - and Player:IsWithinCombatDistance(Target, 40) - end):SetTarget(Target) + return HighestHPTarget:Exists() and self:IsKnownAndUsable() and not Player:IsCastingOrChanneling() + and Player:IsWithinCombatDistance(HighestHPTarget, 40) + end):SetTarget(HighestHPTarget) ) DpsAPL:AddSpell( Penance:CastableIf(function(self) - return Target:Exists() and self:IsKnownAndUsable() and not Player:IsCastingOrChanneling() - and Player:IsWithinCombatDistance(Target, 40) - end):SetTarget(Target) + return HighestHPTarget:Exists() and self:IsKnownAndUsable() and not Player:IsCastingOrChanneling() + and Player:IsWithinCombatDistance(HighestHPTarget, 40) + end):SetTarget(HighestHPTarget) ) DpsAPL:AddSpell( MindBlast:CastableIf(function(self) - return Target:Exists() and self:IsKnownAndUsable() and not Player:IsCastingOrChanneling() - and Player:IsWithinCombatDistance(Target, 40) - end):SetTarget(Target) + return HighestHPTarget:Exists() and self:IsKnownAndUsable() and not Player:IsCastingOrChanneling() + and Player:IsWithinCombatDistance(HighestHPTarget, 40) + end):SetTarget(HighestHPTarget) ) DpsAPL:AddSpell( ShadowWordDeath:CastableIf(function(self) - return Target:Exists() and self:IsKnownAndUsable() and not Player:IsCastingOrChanneling() - and Target:GetHP() < 20 and Player:IsWithinCombatDistance(Target, 40) - end):SetTarget(Target) + return HighestHPTarget:Exists() and self:IsKnownAndUsable() and not Player:IsCastingOrChanneling() + and HighestHPTarget:GetHP() < 20 and Player:IsWithinCombatDistance(HighestHPTarget, 40) + end):SetTarget(HighestHPTarget) ) DpsAPL:AddSpell( Smite:CastableIf(function(self) - return Target:Exists() and self:IsKnownAndUsable() and not Player:IsCastingOrChanneling() - and Player:IsWithinCombatDistance(Target, 40) - end):SetTarget(Target) + return HighestHPTarget:Exists() and self:IsKnownAndUsable() and not Player:IsCastingOrChanneling() + and Player:IsWithinCombatDistance(HighestHPTarget, 40) + end):SetTarget(HighestHPTarget) ) -- Module Sync @@ -280,6 +279,8 @@ DiscPriestModule:Sync(function() 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 @@ -292,4 +293,4 @@ DiscPriestModule:Sync(function() end end) -Bastion:Register(DiscPriestModule) \ No newline at end of file +Bastion:Register(DiscPriestModule)