using System.Linq; using Anemoi.Dynamics; using Anemoi.Utilities; using Nyx.Bot; using Nyx.Game; using Nyx.Game.Internals; using Nyx.Game.Internals.Entities; using Nyx.TreeSharp; using Nyx.Utilities; namespace Anemoi.Routines { /// Trickster rogue. /// Pandragon, 31.01.2014. public class TricksterRogue { [Class(ClassCategory.TricksterRogue)] [Behavior(BehaviorType.Buff)] public static Composite TricksterRogueBuffs() { return new PrioritySelector(); } private static bool HasFullPower { get { var attribs = NyxNW.Me.Character.Attributes; return attribs.Power >= attribs.PowerMax; } } [Class(ClassCategory.TricksterRogue)] [Behavior(BehaviorType.Combat)] public static Composite TricksterRogueCombat() { return new PrioritySelector(ctx => CombatTargeting.Instance.FirstUnit, new Decorator(ctx => ctx != null, new PrioritySelector(CommonBehaviors.CreateUseHealthPotionBehavior(ent => 0.4f), // Get in Stealth. Spell.Cast("Trickster_Stealth_Slottable", ent => ent as NWUnit, ent => !(ent as NWUnit).Character.HasBuff("Trickster_Stealth_Slottable"), Spell.Cast("Trickster_Encounter_Deftstrike", null, ext => (ext as NWUnit).Distance <= 59f, ent => (ent as NWUnit).Position), // Make sure we are in range. CommonBehaviors.MoveAndStop(ctx => (ctx as NWUnit).Position, 9f, true, "Moving to unit"), // DPS Skills. // Daily: Spell.Cast("Trickster_Daily_Lurkersassault", null, ext => HasFullPower && Clusters.GetClusterCount(ext as NWUnit, ClusterType.Radius, 30.0f) >= 3, ent => (ent as NWUnit).Position), Spell.Cast("Trickster_Daily_Easytarget", null, ext => HasFullPower && Clusters.GetClusterCount(ext as NWUnit, ClusterType.Radius, 30.0f) >= 3, ent => (ent as NWUnit).Position), Spell.Cast("Trickster_Daily_Whirlwindofblades", null, ext => HasFullPower && Clusters.GetClusterCount(ext as NWUnit, ClusterType.Radius, 30.0f) >= 3, ent => (ent as NWUnit).Position), // Encounter: Spell.Cast("Trickster_Encounter_Lashingblade", ent => ent as NWUnit, ent => (ent as NWUnit).Character.HasBuff("Trickster_Stealth_Slottable"), Spell.Cast("Trickster_Encounter_Shadowstrike", ent => ent as NWUnit, ret => true), Spell.Cast("Trickster_Encounter_Dazingstrike", ent => ent as NWUnit, ret => true), Spell.Cast("Trickster_Encounter_Blitz", ent => ent as NWUnit, ret => true), // At-will: Spell.Cast("Trickster_Atwill_Slyflourish_Combo", ent => ent as NWUnit, ret => true), Spell.Cast("Trickster_Atwill_Cloudofsteel", null, ext => (ext as NWUnit).Distance >= 10f, ent => (ent as NWUnit).Position) ))); } } }