diff --git a/BloodDK.lua b/BloodDK.lua index 1827a25..c23b216 100644 --- a/BloodDK.lua +++ b/BloodDK.lua @@ -29,6 +29,7 @@ local VampiricBlood = SpellBook:GetSpell(55233) -- Buffs local BoneShield = SpellBook:GetSpell(195181) local DancingRuneWeaponBuff = SpellBook:GetSpell(81256) +local DeathAndDecayBuff = SpellBook:GetSpell(188290) -- Helper Functions local function GetEnemiesInRange(range) @@ -45,6 +46,13 @@ local function HasEnoughRunicPower(cost) return Player:GetPower() >= cost end +local function ShouldUseDeathStrike() + local hp = Player:GetHP() + local runicPower = Player:GetPower() + + return hp <= 70 or runicPower > 110 or (hp <= 85 and HasEnoughRunicPower(45)) +end + -- Create APLs local DefaultAPL = Bastion.APL:New('default') local CooldownAPL = Bastion.APL:New('cooldown') @@ -115,6 +123,12 @@ DefensiveAPL:AddSpell( ) -- Default APL +DefaultAPL:AddSpell( + DeathStrike:CastableIf(function(self) + return self:IsKnownAndUsable() and ShouldUseDeathStrike() + end):SetTarget(Target) +) + DefaultAPL:AddSpell( Marrowrend:CastableIf(function(self) local boneShieldCount = Player:GetAuras():FindMy(BoneShield):GetCount() @@ -124,17 +138,11 @@ DefaultAPL:AddSpell( end):SetTarget(Target) ) -DefaultAPL:AddSpell( - DeathStrike:CastableIf(function(self) - return self:IsKnownAndUsable() and HasEnoughRunicPower(45) and Player:GetHP() <= 80 - end):SetTarget(Target) -) - DefaultAPL:AddSpell( Tombstone:CastableIf(function(self) return self:IsKnownAndUsable() and Player:GetAuras():FindMy(BoneShield):GetCount() > 6 and not Player:GetAuras():FindMy(DancingRuneWeaponBuff):IsUp() - and Player:GetAuras():FindMy(DeathAndDecay):IsUp() + and Player:GetAuras():FindMy(DeathAndDecayBuff):IsUp() and DancingRuneWeapon:GetCooldownRemaining() > 0 end):SetTarget(Player) ) @@ -143,7 +151,7 @@ DefaultAPL:AddSpell( Bonestorm:CastableIf(function(self) return self:IsKnownAndUsable() and Player:GetAuras():FindMy(BoneShield):GetCount() > 11 and not Player:GetAuras():FindMy(DancingRuneWeaponBuff):IsUp() - and Player:GetAuras():FindMy(DeathAndDecay):IsUp() + and Player:GetAuras():FindMy(DeathAndDecayBuff):IsUp() and HasEnoughRunicPower(100) and DancingRuneWeapon:GetCooldownRemaining() > 0 end):SetTarget(Player) @@ -151,8 +159,13 @@ DefaultAPL:AddSpell( DefaultAPL:AddSpell( DeathAndDecay:CastableIf(function(self) - return self:IsKnownAndUsable() and not Player:GetAuras():FindMy(DeathAndDecay):IsUp() - end):SetTarget(Player) + return self:IsKnownAndUsable() and not Player:GetAuras():FindMy(DeathAndDecayBuff):IsUp() + end):SetTarget(Player):OnCast(function(self) + local loc = Bastion.UnitManager:FindEnemiesCentroid(10, 30) + if loc then + self:Click(loc) + end + end) ) DefaultAPL:AddSpell( @@ -171,7 +184,12 @@ DefaultAPL:AddSpell( local OpenerSequence = Bastion.Sequencer:New({ function(self) if DeathAndDecay:IsKnownAndUsable() then - DeathAndDecay:Cast(Player) + DeathAndDecay:Cast(Player):OnCast(function(self) + local loc = Bastion.UnitManager:FindEnemiesCentroid(10, 30) + if loc then + self:Click(loc) + end + end) return true end return false @@ -219,7 +237,7 @@ local OpenerSequence = Bastion.Sequencer:New({ return false end, function(self) - if DeathStrike:IsKnownAndUsable() then + if DeathStrike:IsKnownAndUsable() and ShouldUseDeathStrike() then DeathStrike:Cast(Target) return true end @@ -240,7 +258,7 @@ local OpenerSequence = Bastion.Sequencer:New({ return false end, function(self) - if DeathStrike:IsKnownAndUsable() then + if DeathStrike:IsKnownAndUsable() and ShouldUseDeathStrike() then DeathStrike:Cast(Target) return true end