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
{
public class ControlWizard
{
[Class(ClassCategory.ControlWizard)]
[Behavior(BehaviorType.Buff)]
public static Composite ControlWizardBuffs()
{
return new PrioritySelector(
);
}
private static bool HasFullPower
{
get
{
var attribs = NyxNW.Me.Character.Attributes;
return attribs.Power >= attribs.PowerMax;
}
}
[Class(ClassCategory.ControlWizard)]
[Behavior(BehaviorType.Combat)]
public static Composite ControlWizardCombat()
{
return
new PrioritySelector(ctx => CombatTargeting.Instance.FirstUnit, new Decorator(ctx => ctx != null, new PrioritySelector(
CommonBehaviors.CreateUseHealthPotionBehavior(ent => 0.3f),
// Make sure we are in los of the unit.
CommonBehaviors.MoveToLos(ctx => ctx as NWUnit),
CommonBehaviors.CreateUseHealthPotionBehavior(ent => 0.4f),
// Make sure we are in range.
CommonBehaviors.MoveAndStop(ctx => (ctx as NWUnit).Position, 50f, true, "Moving to unit"),
// finish PvP bot, PowerName="Player_Kill_Neardeath"
// finish PVP bot, PowerName="Player_Revive_Friend"
// Dailies. (these are mixed on) PowerName="Controller_Shift_Teleport"
new Sequence(
Spell.Cast("Controller_Encounter_Conduitofice", ent => ent as NWUnit, ret => true),
Spell.Cast("Controller_Encounter_Shardoftheendlessavalanche_Combo", ent => ent as NWUnit, ret => true),
Spell.Cast("Controller_Encounter_Chillstrike", ent => ent as NWUnit, ret => true),
CommonBehaviors.MoveAndStop(ctx => (ctx as NWUnit).Position, 10f, true, "Moving to melee range"),
Spell.Cast("Controller_Encounter_Stealtime", null, ext => (ext as NWUnit).Distance <= 15f, ent => (ent as NWUnit).Position),
new Sleep(1000)
),
Spell.Cast("Player_Kill_Neardeath", ent => ent as NWUnit, ret => true),
Spell.Cast("Controller_Shift_Teleport"),
Spell.Cast("Controller_Encounter_Conduitofice", ent => ent as NWUnit, ret => true),
Spell.Cast("Controller_Encounter_Chillstrike", ent => ent as NWUnit, ret => true),
Spell.Cast("Controller_Encounter_Shardoftheendlessavalanche_Combo", ent => ent as NWUnit, ret => true),
Spell.Cast("Controller_Daily_Arcanesingularity", null, ext => HasFullPower && (ext as NWUnit).Distance >= 15f,ent => NyxNW.Me.Position),// null, ext => HasFullPower, ent => (ent as NWUnit).Position),
Spell.Cast("Controller_Daily_Iceknife", null, ext => HasFullPower, ent => (ent as NWUnit).Position),
Spell.Cast("Controller_Daily_Oppressiveforce", null, ext => HasFullPower && (ext as NWUnit).Distance <= 15f,ent => NyxNW.Me.Position), // && Clusters.GetClusterCount(ext as NWUnit, ClusterType.Radius, 15.0f) >= 4
Spell.Cast("Controller_Daily_Icestorm", null, ext => HasFullPower && Clusters.GetClusterCount(ext as NWUnit, ClusterType.Radius, 15.0f) >= 4, ent => (ent as NWUnit).Position),
// Try cast some spells before they hit you, Start
Spell.Cast("Controller_Encounter_Conduitofice", ent => ent as NWUnit, ret => true),
Spell.Cast("Controller_Encounter_Chillstrike", ent => ent as NWUnit, ret => true),
Spell.Cast("Controller_Atwill_Magicmissile_Combo", null, ext => (ext as NWUnit).Distance >= 20f, ent => (ent as NWUnit).Position), //ent => ent as NWUnit, ret => true ),
Spell.Cast("Controller_Atwill_Rayoffrost", null, ext => (ext as NWUnit).Distance >= 15f, ent => (ent as NWUnit).Position), //ent => ent as NWUnit, ret => true ),
Spell.Cast("Controller_Atwill_Chillingcloud_Combo", null, ext => (ext as NWUnit).Distance >= 15f, ent => (ent as NWUnit).Position), //ent => ent as NWUnit, ret => true ),
Spell.Cast("Controller_Atwill_Magicmissile_Combo", null, ext => (ext as NWUnit).Distance >= 17f, ent => (ent as NWUnit).Position), //ent => ent as NWUnit, ret => true ),
Spell.Cast("Controller_Daily_Oppressiveforce", null, ext => HasFullPower && (ext as NWUnit).Distance <= 15f, ent => NyxNW.Me.Position), //testing position
// Try cast some spells before they hit you, End
// most powerfull combo Start, need check spell names per level R0, R1, R2, R3 or how they go.
Spell.Cast("Controller_Encounter_Conduitofice", ent => ent as NWUnit, ret => true),
Spell.Cast("Controller_Encounter_Chillstrike", ent => ent as NWUnit, ret => true),
Spell.Cast("Controller_Encounter_Stealtime", null, ext => (ext as NWUnit).Distance <= 15f, ent => (ent as NWUnit).Position),
Spell.Cast("Controller_Encounter_Icyterrain_R3", null, ext => (ext as NWUnit).Distance <= 15f, ent => (ent as NWUnit).Position),
Spell.Cast("Spellstormmage_Encounter_Suddenstorm", null, ext => (ext as NWUnit).Distance <= 17f, ent => (ent as NWUnit).Position),
Spell.Cast("Controller_Encounter_Shardoftheendlessavalanche_Combo", ent => ent as NWUnit, ret => true),
// most powerfull combo end
Spell.Cast("Controller_Encounter_Repel", null, ext => (ext as NWUnit).Distance <= 10f, ent => (ent as NWUnit).Position),
Spell.Cast("Controller_Encounter_Entanglingforce", ent => ent as NWUnit, ret => true),
Spell.Cast("Controller_Encounter_Entanglingforce_R2", ent => ent as NWUnit, ret => true),
Spell.Cast("Controller_Encounter_Conduitofice", ent => ent as NWUnit, ret => true),
Spell.Cast("Controller_Encounter_Entanglingforce_R3", ent => ent as NWUnit, ret => true),
Spell.Cast("Controller_Encounter_Chillstrike", ent => ent as NWUnit, ret => true),
Spell.Cast("Controller_Encounter_Repel", ent => ent as NWUnit, ret => true),
Spell.Cast("Controller_Atwill_Chillingcloud_Combo", ent => ent as NWUnit, ret => true),
Spell.Cast("Controller_Atwill_Magicmissile_Combo", ent => ent as NWUnit, ret => true )
)
)
);
}