Master Frost Death Knight
Introduction
This custom class is built around the Raid Bot, this can be found here: http://www.thebuddyforum.com/honorb...45436-botbase-raidbot-30fps-cc-execution.html. I have used Noxxic.com, Elitist Jerks, MMO Champion to get the best rotation and priority order.
For more information on Master Frost please see here: Frost DPS | Winter of Discontent [4.3] - Elitist Jerks
This custom class does not pop any cooldowns so they are for you to do manually.
Media
No media yet, I have modified this from an old Singular class of mine.
Source - Last Update: 9th May 2012 @ 3:00PM
GitHub - https://github.com/MichaelRob92/masterfrost-death-knight
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Styx.Combat.CombatRoutine;
using TreeSharp;
using CommonBehaviors.Actions;
using Styx;
using Styx.Logic.Combat;
using Styx.WoWInternals.WoWObjects;
using Styx.Logic.Pathing;
using Styx.Helpers;
using System.Drawing;
using Styx.WoWInternals;
namespace RaidBot
{
public class DeathKnightMasterFrostRoutine : CombatRoutine
{
public delegate WoWUnit UnitSelectionDelegate(object context);
public delegate bool SimpleBooleanDelegate(object context);
public delegate WoWPoint LocationRetriverDelegate(object context);
public override WoWClass Class
{
get { return WoWClass.DeathKnight; }
}
public override string Name
{
get { return "MasterFrost DeathKnight"; }
}
private Composite _root;
public override Composite CombatBehavior
{
get
{
return _root ?? (_root = GetCombatBehavior());
}
}
private Composite GetCombatBehavior()
{
return new PrioritySelector(
EnsureTarget(),
Cast("Blood Tap", ret => GetAllRuneCooldowns(1, 2) > 2),
Cast("Outbreak", ret => !HasMyAuraTimeLeft(StyxWoW.Me.CurrentTarget, "Frost Fever", 2) || !HasMyAuraTimeLeft(StyxWoW.Me.CurrentTarget, "Blood Plague", 2)),
Cast("Howling Blast", ret => !HasMyAuraTimeLeft(StyxWoW.Me.CurrentTarget, "Frost Fever", 2)),
Cast("Plague Strike", ret => !HasMyAuraTimeLeft(StyxWoW.Me.CurrentTarget, "Blood Plague", 2) && StyxWoW.Me.UnholyRuneCount == 2),
Cast("Obliterate", ret => (StyxWoW.Me.DeathRuneCount == 2 && StyxWoW.Me.FrostRuneCount == 2) ||
(StyxWoW.Me.DeathRuneCount == 2 && StyxWoW.Me.UnholyRuneCount == 2) ||
(StyxWoW.Me.UnholyRuneCount == 2 && StyxWoW.Me.FrostRuneCount == 2)),
Cast("Obliterate", ret => StyxWoW.Me.DeathRuneCount == 2 || StyxWoW.Me.UnholyRuneCount == 2 || StyxWoW.Me.FrostRuneCount == 2),
Cast("Frost Strike", ret => StyxWoW.Me.CurrentRunicPower >= 110),
Cast("Howling Blast", ret => StyxWoW.Me.ActiveAuras.ContainsKey("Freezing Fog")),
Cast("Obliterate", ret => StyxWoW.Me.UnholyRuneCount == 2 || GetAllRuneCooldowns(5, 6) < 2),
Cast("Howling Blast", ret => StyxWoW.Me.CurrentRunicPower < 90),
Cast("Frost Strike", ret => StyxWoW.Me.CurrentRunicPower > 90),
Cast("Howling Blast", ret => StyxWoW.Me.CurrentRunicPower < 60),
Cast("Frost Strike"),
Cast("Empower Rune Weapon", ret => GetAllRuneCooldowns(1, 2) + GetAllRuneCooldowns(3, 4) + GetAllRuneCooldowns(5, 6) > 8),
Cast("Horn of Winter")
);
}
public Composite Cast(string spellName)
{
return Cast(spellName, ret => StyxWoW.Me.CurrentTarget);
}
public Composite Cast(string spellName, UnitSelectionDelegate unit)
{
return Cast(spellName, unit, ret => true);
}
public Composite Cast(string spellName, SimpleBooleanDelegate requirement)
{
return Cast(spellName, ret => StyxWoW.Me.CurrentTarget, requirement);
}
public Composite Cast(string spellName, UnitSelectionDelegate unit, SimpleBooleanDelegate requirement)
{
return new Decorator(
ctx => SpellManager.CanCast(SpellManager.Spells[spellName], unit(ctx), false, false, true) && requirement(ctx),
new TreeSharp.Action(
ret =>
{
Logging.Write(Color.Crimson, "Spell Cast[{0}]", spellName);
SpellManager.Cast(spellName, unit(ret));
}
)
);
}
public Composite CastOnGround(string spellName, LocationRetriverDelegate onLocation, SimpleBooleanDelegate requirement)
{
return new Decorator(
ret =>
requirement(ret) && onLocation != null && SpellManager.CanCast(spellName)
&& (StyxWoW.Me.Location.Distance(onLocation(ret)) <= SpellManager.Spells[spellName].MaxRange || SpellManager.Spells[spellName].MaxRange == 0),
new Sequence(
new TreeSharp.Action(ret => SpellManager.Cast(spellName)),
new WaitContinue(1, ret => StyxWoW.Me.CurrentPendingCursorSpell != null && StyxWoW.Me.CurrentPendingCursorSpell.Name == spellName, new ActionAlwaysSucceed()),
new TreeSharp.Action(ret => LegacySpellManager.ClickRemoteLocation(onLocation(ret)))
)
);
}
public Composite EnsureTarget()
{
return new Decorator(ctx => StyxWoW.Me.CurrentTarget == null, new ActionAlwaysSucceed());
}
public bool HasMyAuraTimeLeft(WoWUnit unit, string aura, int timeLeft)
{
return unit.GetAllAuras().Any(a => a.Name == aura && a.CreatorGuid == StyxWoW.Me.Guid && a.TimeLeft.TotalSeconds > timeLeft);
}
public int GetAllRuneCooldowns(params int[] runes)
{
int cooldown = 0;
foreach (int rune in runes)
{
cooldown += GetRuneCooldown(rune);
}
return cooldown;
}
public int GetRuneCooldown(int rune)
{
float finish = Lua.GetReturnVal<float>(string.Format("local start, dur, ready = GetRuneCooldown({0}); local finish = start + dur; return finish", rune), 0);
float time_now = Lua.GetReturnVal<float>("return GetTime()", 0);
return (int)Math.Round(finish - time_now);
}
}
}
Credits
- Singular Developers
- Apoc
Last edited: