blood dk! We need a good blood tank routine
Hi Sagewave, if you want one for RaidBot simply replace Singulars Blood.cs with this
using System;
using System.Collections.Generic;
using System.Linq;
using CommonBehaviors.Actions;
using Singular.Dynamics;
using Singular.Helpers;
using Singular.Managers;
using Singular.Settings;
using Styx;
using Styx.Common.Helpers;
using Styx.CommonBot;
using Styx.Pathing;
using Styx.TreeSharp;
using Styx.WoWInternals;
using Styx.WoWInternals.WoWObjects;
using Action = Styx.TreeSharp.Action;
using LocationRetriever = Singular.Helpers.LocationRetriever;
namespace Singular.ClassSpecific.DeathKnight
{
public class Blood
{
private static DeathKnightSettings Settings
{
get { return SingularSettings.Instance.DeathKnight; }
}
#region Heal
[Behavior(BehaviorType.Heal, WoWClass.DeathKnight, WoWSpec.DeathKnightBlood)]
public static Composite CreateDeathKnightBloodHeals()
{
return
new PrioritySelector(
Spell.BuffSelf("Death Pact",
ret =>
TalentManager.IsSelected((int) Common.DeathKnightTalents.DeathPact) &&
StyxWoW.Me.HealthPercent < SingularSettings.Instance.DeathKnight.DeathPactPercent &&
Common.GhoulMinionIsActive),
Spell.Cast("Death Siphon",
ret =>
TalentManager.IsSelected((int) Common.DeathKnightTalents.DeathSiphon) &&
StyxWoW.Me.GotTarget &&
StyxWoW.Me.HealthPercent < SingularSettings.Instance.DeathKnight.DeathSiphonPercent),
Spell.BuffSelf("Conversion",
ret =>
TalentManager.IsSelected((int) Common.DeathKnightTalents.Conversion) &&
StyxWoW.Me.HealthPercent < SingularSettings.Instance.DeathKnight.ConversionPercent &&
StyxWoW.Me.RunicPowerPercent >=
SingularSettings.Instance.DeathKnight.MinimumConversionRunicPowerPrecent),
Spell.BuffSelf("Rune Tap",
ret =>StyxWoW.Me.HealthPercent < SingularSettings.Instance.DeathKnight.RuneTapPercent ||
StyxWoW.Me.HealthPercent < 90 && StyxWoW.Me.HasAura("Will of the Necropolis")),
Spell.BuffSelf("Death Coil",
ret =>
StyxWoW.Me.HealthPercent < SingularSettings.Instance.DeathKnight.LichbornePercent &&
StyxWoW.Me.HasAura("Lichborne")),
Spell.BuffSelf("Lichborne",
ret =>
StyxWoW.Me.HealthPercent <
SingularSettings.Instance.DeathKnight.LichbornePercent
&& StyxWoW.Me.CurrentRunicPower >= 60
&& (!SingularSettings.Instance.DeathKnight.LichborneExclusive ||
(!StyxWoW.Me.HasAura("Bone Shield")
&& !StyxWoW.Me.HasAura("Vampiric Blood")
&& !StyxWoW.Me.HasAura("Dancing Rune Weapon")
&& !StyxWoW.Me.HasAura("Icebound Fortitude")))),
Spell.BuffSelf("Raise Dead",
ret =>
// I need to summon pet for Death Pact
StyxWoW.Me.HealthPercent < SingularSettings.Instance.DeathKnight.SummonGhoulPercentBlood &&
!Common.GhoulMinionIsActive &&
(!SingularSettings.Instance.DeathKnight.DeathPactExclusive ||
(!StyxWoW.Me.HasAura("Bone Shield")
&& !StyxWoW.Me.HasAura("Vampiric Blood")
&& !StyxWoW.Me.HasAura("Dancing Rune Weapon")
&& !StyxWoW.Me.HasAura("Lichborne")
&& !StyxWoW.Me.HasAura("Icebound Fortitude"))))
);
}
#endregion
#region CombatBuffs
[Behavior(BehaviorType.CombatBuffs, WoWClass.DeathKnight, WoWSpec.DeathKnightBlood)]
public static Composite CreateDeathKnightBloodCombatBuffs()
{
return
new PrioritySelector(
// *** Defensive Cooldowns ***
// Anti-magic shell - no cost and doesnt trigger GCD
Spell.BuffSelf("Anti-Magic Shell",
ret => Unit.NearbyUnfriendlyUnits.Any(u =>
(u.IsCasting || u.ChanneledCastingSpellId != 0) &&
u.CurrentTargetGuid == StyxWoW.Me.Guid)));
}
#endregion
public static Boolean ClusterCheck(int limit)
{
return Unit.UnfriendlyUnitsNearTarget(8f).Count() >= limit;
}
public static Boolean Outbreak()
{
return TargetDebuffDuration("Blood Plague") <= 2 && TargetDebuffDuration("Frost Fever") <= 2;
}
public static Boolean DeathStrike()
{
int fr = StyxWoW.Me.FrostRuneCount;
int de = StyxWoW.Me.DeathRuneCount;
int un = StyxWoW.Me.UnholyRuneCount;
if (fr > 0 && un > 0) return true;
if (fr > 0 && de > 0) return true;
if (un > 0 && de > 0) return true;
return (de > 1 && StyxWoW.Me.CurrentTarget.IsWithinMeleeRange);
}
public static double TargetDebuffDuration(String spellName)
{
if (!StyxWoW.Me.CurrentTarget.Debuffs.ContainsKey(spellName)) return 0;
return StyxWoW.Me.CurrentTarget.Debuffs[spellName].TimeLeft.TotalSeconds;
}
[Behavior(BehaviorType.InCombat, WoWClass.DeathKnight, WoWSpec.DeathKnightBlood)]
public static Composite CreateDeathKnightBloodNormalCombat()
{
return new Decorator(new PrioritySelector(
Spell.BuffSelf("Blood Presence"),
Spell.Cast("Vampiric Blood", ret => StyxWoW.Me.HealthPercent < 70),
Spell.Cast("Icebound Fortitude", ret => StyxWoW.Me.HealthPercent < 40),
Spell.Cast("Outbreak", ret => Outbreak()),
Spell.Cast("Bone Shield"),
Spell.Cast("Rune Tap", ret => StyxWoW.Me.HasAura("Rune Tap")),
new Decorator(
ret => ClusterCheck(3),
new PrioritySelector(
Spell.CastOnGround("Death and Decay",
ret => StyxWoW.Me.CurrentTarget.GetPosition()),
Spell.Cast("Dancing Rune Weapon", ret => StyxWoW.Me.CurrentRunicPower >= 100),
Spell.Cast("Rune Strike", ret => StyxWoW.Me.CurrentRunicPower >= 100),
Spell.Cast("Icy Touch",
ret =>
TargetDebuffDuration("Frost Fever") < 1 &&
StyxWoW.Me.FrostRuneCount > 0),
Spell.Cast("Plague Strike",
ret =>
TargetDebuffDuration("Blood Plague") < 1 &&
StyxWoW.Me.UnholyRuneCount > 0),
Spell.Cast("Death Strike", ret => DeathStrike()),
Spell.Cast("Blood Boil",
ret =>
(StyxWoW.Me.Buffs.ContainsKey("Crimson Scourge") ||
StyxWoW.Me.BloodRuneCount > 0)),
Spell.Cast("Dancing Rune Weapon", ret => StyxWoW.Me.CurrentRunicPower >= 60),
Spell.Cast("Rune Strike", ret => StyxWoW.Me.CurrentRunicPower >= 30),
Spell.Cast("Horn of Winter")
)
),
new PrioritySelector(
Spell.Cast("Dancing Rune Weapon", ret => StyxWoW.Me.CurrentRunicPower >= 100),
Spell.Cast("Rune Strike", ret => StyxWoW.Me.CurrentRunicPower >= 100),
Spell.Cast("Icy Touch", ret => TargetDebuffDuration("Frost Fever") < 1),
Spell.Cast("Plague Strike", ret => TargetDebuffDuration("Blood Plague") < 1),
Spell.Cast("Death Strike", ret => DeathStrike()),
Spell.Cast("Heart Strike", ret => StyxWoW.Me.BloodRuneCount > 0),
Spell.Cast("Dancing Rune Weapon", ret => StyxWoW.Me.CurrentRunicPower >= 60),
Spell.Cast("Rune Strike", ret => StyxWoW.Me.CurrentRunicPower >= 30),
Spell.Cast("Blood Boil", ret => StyxWoW.Me.Buffs.ContainsKey("Crimson Scourge")),
Spell.Cast("Horn of Winter")
)
), ret => StyxWoW.Me.Combat
);
}
[Behavior(BehaviorType.Pull, WoWClass.DeathKnight, WoWSpec.DeathKnightBlood)]
public static Composite CreateDeathKnightBloodPull()
{
return
new PrioritySelector(
Spell.CastOnGround("Death and Decay", ret => StyxWoW.Me.CurrentTarget.GetPosition(), ret => ClusterCheck(3)),
Spell.Cast("Icy Touch", ret => TargetDebuffDuration("Frost Fever") < 1),
Spell.Cast("Outbreak", ret => Outbreak()),
Spell.Cast("Death Grip")
);
}
}
}