public static bool Huton() { if (!NinjaSettings.Instance.UseHuton) { return(false); } if (Core.Me.HasAura(Auras.Kassatsu)) { return(false); } if (!ActionManager.HasSpell(Spells.Huton.Id)) { return(false); } //if (Spells.TrickAttack.Cooldown.TotalMilliseconds < 22000) // return false; if (Core.Me.ClassLevel < 45) { return(false); } if (!SpellDataExtensions.CanCast(Spells.Jin, null)) { return(false); } if (ActionResourceManager.Ninja.HutonTimer.TotalMilliseconds > 1) { return(false); } if (ActionManager.HasSpell(Spells.ArmorCrush.Id)) { if (ActionManager.LastSpell == Spells.GustSlash) { return(false); } } SpellQueueLogic.SpellQueue.Clear(); SpellQueueLogic.Timeout.Start(); SpellQueueLogic.CancelSpellQueue = () => SpellQueueLogic.Timeout.ElapsedMilliseconds > 5000; SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.Jin, TargetSelf = true }); SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.Chi, TargetSelf = true }); SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.Ten, TargetSelf = true }); SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.Huton, TargetSelf = true }); return(true); }
private static async Task <bool> UseEukrasianPrognosisIfNeeded(int NeedShields, SpellData forSpell, Character target) { var needPrognosis = Group.CastableAlliesWithin15.Count(r => r.HasAura(Auras.EukrasianPrognosis, true) || r.HasAura(Auras.EukrasianDiagnosis, true)) < NeedShields; if (needPrognosis) { if (!await UseEukrasia(Spells.EukrasianPrognosis.Id)) { return(false); } if (!await Spells.EukrasianPrognosis.Cast(Core.Me)) { return(false); } if (!await Coroutine.Wait(1000, () => Core.Me.HasAura(Auras.EukrasianPrognosis, true))) { return(false); } if (!await Coroutine.Wait(1000, () => SpellDataExtensions.CanCast(forSpell, target))) { return(false); } } return(true); }
public static bool Suiton() { if (Core.Me.HasAura(Auras.Suiton)) { return(false); } if (!NinjaSettings.Instance.UseTrickAttack) { return(false); } if (!ActionManager.HasSpell(Spells.Suiton.Id)) { return(false); } if (Core.Me.ClassLevel > 76 && Core.Me.HasAura(Auras.Kassatsu)) { return(false); } if (Core.Me.ClassLevel < 45) { return(false); } if (!SpellDataExtensions.CanCast(Spells.Ten, null)) { return(false); } if (Spells.TrickAttack.Cooldown.TotalMilliseconds > 20000) { return(false); } SpellQueueLogic.SpellQueue.Clear(); SpellQueueLogic.Timeout.Start(); SpellQueueLogic.CancelSpellQueue = () => SpellQueueLogic.Timeout.ElapsedMilliseconds > 5000; SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.Ten, TargetSelf = true }); SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.Chi, TargetSelf = true }); SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.Jin, TargetSelf = true }); SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.Suiton }); return(true); }
public static bool GokaMekkyaku() { if (!NinjaSettings.Instance.UseGokaMekkyaku) { return(false); } if (Spells.TrickAttack.Cooldown.TotalMilliseconds < 22000) { return(false); } if (!ActionManager.HasSpell(Spells.GokaMekkyaku.Id)) { return(false); } if (Core.Me.ClassLevel < 76) { return(false); } if (!SpellDataExtensions.CanCast(Spells.Chi, null)) { return(false); } if (!Core.Me.HasAura(Auras.Kassatsu) && Casting.LastSpell != Spells.Kassatsu) { return(false); } if (Core.Me.EnemiesNearby(8).Count() < NinjaSettings.Instance.GokaMekkyakuMinEnemies) { return(false); } SpellQueueLogic.SpellQueue.Clear(); SpellQueueLogic.Timeout.Start(); SpellQueueLogic.CancelSpellQueue = () => SpellQueueLogic.Timeout.ElapsedMilliseconds > 5000; SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.Chi, TargetSelf = true }); SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.Ten, TargetSelf = true }); SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.GokaMekkyaku }); return(true); }
//Swiftcast the specified spell. Magitek nevers swiftcast as having been correctly cast, so this workaround is necessary. //This method first casts swiftcast, then the specified spell. It is compatible with SyncedCast. public static async Task <bool> Swiftcast(SpellData spell, GameObject target) { if (spell.LevelAcquired > SmUtil.SyncedLevel) { return(false); } if (await SmUtil.SyncedCast(Spells.Swiftcast, Core.Me)) { await Coroutine.Wait(2000, () => Core.Me.HasAura(Auras.Swiftcast)); await Coroutine.Wait(2000, () => SpellDataExtensions.CanCast(spell, target)); return(await spell.Cast(target)); } return(false); }
public static bool ForceRaiton() { if (!NinjaSettings.Instance.ForceRaiton) { return(false); } if (!ActionManager.HasSpell(Spells.Chi.Id)) { return(false); } if (Core.Me.ClassLevel < 35) { return(false); } if (Casting.SpellCastHistory.Take(5).All(s => s.Spell == Spells.Raiton) /*&& Spells.TenChiJin.Cooldown.TotalMilliseconds < 5000*/) { return(false); } if (!SpellDataExtensions.CanCast(Spells.Ten, null)) { return(false); } SpellQueueLogic.SpellQueue.Clear(); SpellQueueLogic.Timeout.Start(); SpellQueueLogic.CancelSpellQueue = () => SpellQueueLogic.Timeout.ElapsedMilliseconds > 5000; SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.Ten, TargetSelf = true }); SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.Chi, TargetSelf = true }); SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.Raiton }); NinjaSettings.Instance.ForceRaiton = false; TogglesManager.ResetToggles(); return(true); }
public static bool FumaShuriken() { if (!NinjaSettings.Instance.UseFumaShuriken) { return(false); } if (!ActionManager.HasSpell(Spells.FumaShuriken.Id)) { return(false); } if (Spells.TrickAttack.Cooldown.TotalMilliseconds < 22000) { return(false); } if (Core.Me.ClassLevel < 30) { return(false); } if (Core.Me.ClassLevel > 76 && Core.Me.HasAura(Auras.Kassatsu)) { return(false); } // First Mudra of the line if (!SpellDataExtensions.CanCast(Spells.Ten, null)) { return(false); } if (Spells.TrickAttack.Cooldown.Seconds < 22) { return(false); } // Basic checks if (!Core.Me.CurrentTarget.InLineOfSight()) { return(false); } if (!Core.Me.CurrentTarget.HasAura(Auras.VulnerabilityTrickAttack)) { return(false); } if (Core.Me.CurrentTarget.Distance(Core.Me) > 25) { return(false); } SpellQueueLogic.SpellQueue.Clear(); SpellQueueLogic.Timeout.Start(); SpellQueueLogic.CancelSpellQueue = () => SpellQueueLogic.Timeout.ElapsedMilliseconds > 5000; SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.Ten, TargetSelf = true }); SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.FumaShuriken }); return(true); }
public static async Task <bool> TenChiJin() { if (!NinjaSettings.Instance.UseTenChiJin) { return(false); } if (MovementManager.IsMoving) { return(false); } if (Core.Me.HasAura(Auras.Suiton)) { return(false); } if (Spells.TrickAttack.Cooldown.TotalMilliseconds < 45000 && !Core.Me.CurrentTarget.HasAura(Auras.VulnerabilityTrickAttack)) { return(false); } if (Spells.ShadowFang.Cooldown.TotalMilliseconds < 5000) { return(false); } if (Spells.SpinningEdge.Cooldown.TotalMilliseconds < 1200) { return(false); } if (Casting.LastSpell == Spells.Raiton) { return(false); } if (Casting.LastSpell == Spells.Assassinate) { return(false); } if (Casting.LastSpell == Spells.DreamWithinaDream || Spells.DreamWithinaDream.Cooldown.TotalMilliseconds < 2000) { return(false); } //return await Spells.TenChiJin.Cast(Core.Me); if (!await Spells.TenChiJin.Cast(Core.Me)) { return(false); } if (!await Coroutine.Wait(2000, () => Core.Me.HasAura(Auras.TenChiJin))) { return(false); } if (Utilities.Routines.Ninja.AoeEnemies5Yards > 1 && Utilities.Routines.Ninja.TCJState == 0 && !Core.Me.HasAura(Auras.Doton)) { Utilities.Routines.Ninja.TCJState = 1; } if (Utilities.Routines.Ninja.AoeEnemies5Yards < 2 && Utilities.Routines.Ninja.TCJState == 0) { Utilities.Routines.Ninja.TCJState = 1; } Logger.Error("State is: " + Utilities.Routines.Ninja.TCJState); if (Utilities.Routines.Ninja.TCJState == 1) { Logger.Error("Queuing TCJ"); SpellQueueLogic.SpellQueue.Clear(); SpellQueueLogic.Timeout.Start(); SpellQueueLogic.CancelSpellQueue = () => SpellQueueLogic.Timeout.ElapsedMilliseconds > 7000; SpellQueueLogic.CancelSpellQueue = () => MovementManager.IsMoving; SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.Ten, Wait = new QueueSpellWait() { Name = "Wait for Shuriken", Check = () => SpellDataExtensions.CanCast(Spells.Ten, null), WaitTime = 2000, EndQueueIfWaitFailed = true }, }); SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.Chi, Wait = new QueueSpellWait() { Name = "Wait for Raiton", Check = () => SpellDataExtensions.CanCast(Spells.Chi, null), WaitTime = 2000, EndQueueIfWaitFailed = true }, }); SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.Jin, Wait = new QueueSpellWait() { Name = "Wait for Suiton", Check = () => SpellDataExtensions.CanCast(Spells.Jin, null), WaitTime = 2000, EndQueueIfWaitFailed = true }, }); Utilities.Routines.Ninja.TCJState = 0; return(false); } if (Utilities.Routines.Ninja.TCJState == 2) { Logger.Error("Queuing TCJ"); SpellQueueLogic.SpellQueue.Clear(); SpellQueueLogic.Timeout.Start(); SpellQueueLogic.CancelSpellQueue = () => SpellQueueLogic.Timeout.ElapsedMilliseconds > 7000; SpellQueueLogic.CancelSpellQueue = () => MovementManager.IsMoving; SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.Ten, Wait = new QueueSpellWait() { Name = "Wait for Mudra1", Check = () => SpellDataExtensions.CanCast(Spells.Ten, null), WaitTime = 2000, EndQueueIfWaitFailed = true }, }); SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.Jin, Wait = new QueueSpellWait() { Name = "Wait for Mudra2", Check = () => SpellDataExtensions.CanCast(Spells.Jin, null), WaitTime = 2000, EndQueueIfWaitFailed = true }, }); SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.Chi, Wait = new QueueSpellWait() { Name = "Wait for Mudra3", Check = () => SpellDataExtensions.CanCast(Spells.Chi, null), WaitTime = 2000, EndQueueIfWaitFailed = true }, }); Utilities.Routines.Ninja.TCJState = 0; return(false); } return(false); }
public static bool Raiton() { if (!NinjaSettings.Instance.UseRaiton) { return(false); } if (Core.Me.ClassLevel > 76 && Core.Me.HasAura(Auras.Kassatsu)) { return(false); } if (Spells.TrickAttack.Cooldown.TotalMilliseconds < 22000 && !NinjaSettings.Instance.UseForceNinjutsu) { return(false); } if (Core.Me.CurrentTarget.HasAura(Auras.VulnerabilityTrickAttack) && !Core.Me.CurrentTarget.HasAura(Auras.VulnerabilityTrickAttack, true, 2500)) { return(false); } if (!ActionManager.HasSpell(Spells.Chi.Id)) { return(false); } if (Core.Me.ClassLevel < 35) { return(false); } //if we'd rather use katon, don't use raiton -Sage if (Core.Me.CurrentTarget.EnemiesNearby(5 + Core.Me.CurrentTarget.CombatReach).Count() > NinjaSettings.Instance.KatonMinEnemies && NinjaSettings.Instance.UseKaton) { return(false); } if (Casting.SpellCastHistory.Take(5).All(s => s.Spell == Spells.Raiton) /*&& Spells.TenChiJin.Cooldown.TotalMilliseconds < 5000*/) { return(false); } if (!SpellDataExtensions.CanCast(Spells.Ten, null)) { return(false); } SpellQueueLogic.SpellQueue.Clear(); SpellQueueLogic.Timeout.Start(); SpellQueueLogic.CancelSpellQueue = () => SpellQueueLogic.Timeout.ElapsedMilliseconds > 5000; SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.Ten, TargetSelf = true }); SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.Chi, TargetSelf = true }); SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.Raiton }); return(true); }
public static bool Katon() { if (!NinjaSettings.Instance.UseKaton) { return(false); } if (Spells.TrickAttack.Cooldown.TotalMilliseconds < 22000) { return(false); } if (!NinjaSettings.Instance.UseAoe) { return(false); } if (Core.Me.CurrentTarget.Distance(Core.Me) > 15) { return(false); } if (!ActionManager.HasSpell(Spells.Katon.Id)) { return(false); } if (Core.Me.ClassLevel < 35) { return(false); } if (Core.Me.CurrentTarget.HasAura(Auras.VulnerabilityTrickAttack) && !Core.Me.CurrentTarget.HasAura(Auras.VulnerabilityTrickAttack, true, 2500)) { return(false); } if (!SpellDataExtensions.CanCast(Spells.Chi, null)) { return(false); } if (Core.Me.CurrentTarget.EnemiesNearby(5 + Core.Me.CurrentTarget.CombatReach).Count() < NinjaSettings.Instance.KatonMinEnemies) { return(false); } SpellQueueLogic.SpellQueue.Clear(); SpellQueueLogic.Timeout.Start(); SpellQueueLogic.CancelSpellQueue = () => SpellQueueLogic.Timeout.ElapsedMilliseconds > 5000; SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.Chi, TargetSelf = true }); SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.Ten, TargetSelf = true }); SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.Katon }); return(true); }
public static bool Doton() { if (!NinjaSettings.Instance.UseDoton) { return(false); } if (Core.Me.HasAura(Auras.Kassatsu)) { return(false); } if (Core.Me.HasAura(Auras.Doton)) { return(false); } if (Spells.TrickAttack.Cooldown.TotalMilliseconds < 22000 && !NinjaSettings.Instance.UseForceNinjutsu) { return(false); } if (MovementManager.IsMoving) { return(false); } if (!ActionManager.HasSpell(Spells.Doton.Id)) { return(false); } if (Core.Me.ClassLevel < 45) { return(false); } if (!SpellDataExtensions.CanCast(Spells.Ten, null)) { return(false); } if (Core.Me.HasAura(Auras.Doton)) { return(false); } if (Core.Me.EnemiesNearby(8).Count() < NinjaSettings.Instance.DotonMinEnemies) { return(false); } SpellQueueLogic.SpellQueue.Clear(); SpellQueueLogic.Timeout.Start(); SpellQueueLogic.CancelSpellQueue = () => SpellQueueLogic.Timeout.ElapsedMilliseconds > 5000; SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.Ten, TargetSelf = true }); SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.Jin, TargetSelf = true }); SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.Chi, TargetSelf = true }); SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.Doton, TargetSelf = true }); return(true); }
public static async Task <bool> DragonSight() //Damage +10% { if (!DragoonSettings.Instance.UseBuffs) { return(false); } if (!DragoonSettings.Instance.UseDragonSight) { return(false); } if (!SpellDataExtensions.CanCast(Spells.DragonSight, Core.Me)) { return(false); } if (!Core.Me.HasTarget) { return(false); } if (!Core.Me.InCombat) { return(false); } IEnumerable <Character> allyList = null; if (Globals.InParty) { switch (DragoonSettings.Instance.SelectedStrategy) { case DragonSightStrategy.Self: return(await Spells.DragonSight.Cast(Core.Me)); case DragonSightStrategy.ClosestDps: allyList = Group.CastableAlliesWithin12.Where(a => a != null && a.IsAlive && a.IsVisible && !a.IsMe && a.IsDps()).OrderBy(DragoonRoutine.GetWeight); break; case DragonSightStrategy.MeleeDps: allyList = Group.CastableAlliesWithin12.Where(a => a != null && a.IsAlive && a.IsVisible && !a.IsMe && a.IsMeleeDps()).OrderBy(DragoonRoutine.GetWeight); break; case DragonSightStrategy.RangedDps: allyList = Group.CastableAlliesWithin12.Where(a => a != null && a.IsAlive && a.IsVisible && !a.IsMe && a.IsRangedDpsCard()).OrderBy(DragoonRoutine.GetWeight); break; case DragonSightStrategy.Tank: allyList = Group.CastableAlliesWithin12.Where(a => a != null && a.IsAlive && a.IsVisible && !a.IsMe && a.IsTank()).OrderBy(DragoonRoutine.GetWeight); break; case DragonSightStrategy.Healer: allyList = Group.CastableAlliesWithin12.Where(a => a != null && a.IsAlive && a.IsVisible && !a.IsMe && a.IsHealer()).OrderBy(DragoonRoutine.GetWeight); break; } if (allyList == null) { if (DragoonSettings.Instance.UseSmartDragonSight) { return(await Spells.DragonSight.Cast(Core.Me)); } else { return(false); } } return(await Spells.DragonSight.CastAura(allyList.FirstOrDefault(), Auras.LeftEye)); } return(await Spells.DragonSight.Cast(Core.Me)); }