public override async Task <bool> PvP() { if (Me.IsCasting) { return(await DodgeManager.DodgeThis(Me.SpellCastInfo.SpellData, CurrentTarget, CastedAura, IsDot, IsBuff, IsHealingSpell)); } switch (MainSettingsModel.Instance.CurrentRoutine) { case "Barret": return(await BarretRotation.PVPRotation()); case "Beatrix": return(await BeatrixRotation.PVPRotation()); case "Cecil": return(await CecilRotation.PVPRotation()); case "Cyan": return(await CyanRotation.PVPRotation()); case "Edward": return(await EdwardRotation.PVPRotation()); case "Eiko": return(await EikoRotation.PVPRotation()); case "Elayne": return(await ElayneRotation.PVPRotation()); case "Freya": return(await FreyaRotation.PVPRotation()); case "Mikoto": return(await MikotoRotation.PVPRotation()); case "Paine": return(await PaineRotation.PVPRotation()); case "Remiel": return(await RemielRotation.PVPRotation()); case "Sabin": return(await SabinRotation.PVPRotation()); case "Shadow": return(await ShadowRotation.PVPRotation()); case "Surito": return(await SuritoRotation.PVPRotation()); case "Vivi": return(await ViviRotation.PVPRotation()); } return(false); }
internal static async Task <bool> Opener() { if (Target == null || !Target.CanAttack) { return(false); } #region RoutineSwitch ThreadSafeObservableCollection <OpenerSpellInfo> openerList = null; switch (MainSettingsModel.Instance.CurrentRoutine) { case "Barret": openerList = Barret_OpenerViewModel.Instance.GuiOpenerList; break; case "Beatrix": openerList = Beatrix_OpenerViewModel.Instance.GuiOpenerList; break; case "Cecil": openerList = Cecil_OpenerViewModel.Instance.GuiOpenerList; break; case "Cyan": openerList = Cyan_OpenerViewModel.Instance.GuiOpenerList; break; case "Edward": openerList = Edward_OpenerViewModel.Instance.GuiOpenerList; break; case "Eiko": openerList = Eiko_OpenerViewModel.Instance.GuiOpenerList; break; case "Elayne": openerList = Elayne_OpenerViewModel.Instance.GuiOpenerList; break; case "Freya": openerList = Freya_OpenerViewModel.Instance.GuiOpenerList; break; case "Paine": openerList = Paine_OpenerViewModel.Instance.GuiOpenerList; break; case "Sabin": openerList = Sabin_OpenerViewModel.Instance.GuiOpenerList; break; case "Shadow": openerList = Shadow_OpenerViewModel.Instance.GuiOpenerList; break; case "Vivi": openerList = Vivi_OpenerViewModel.Instance.GuiOpenerList; break; } #endregion RoutineSwitch if (openerList != null) { var openerQueue = new Queue <OpenerSpellInfo>(openerList); if (openerQueue.Count == 0) { Logger.KefkaLog(@"Opener queue is empty, please use the Reset Opener button to reset!"); openerQueue.Clear(); OpenerManager.ResetOpeners(); return(false); } while (Target != null && openerQueue.Count > 0) { var nextOpener = openerQueue.Peek(); Logger.KefkaLog(@"Next Opener Skill: {0}", nextOpener.SpellName); if (nextOpener.SpellName.Contains("Delay")) { var waitTime = TimeSpan.FromSeconds(nextOpener.SpellId).Duration(); await Coroutine.Wait(waitTime, () => false); openerQueue.Dequeue(); continue; } if (nextOpener.IsItem) { var openerItem = InventoryManager.FilledSlots.FirstOrDefault(r => r.RawItemId == nextOpener.SpellId); if (await Items.UsePotion(openerItem.Item, true)) { openerQueue.Dequeue(); continue; } } if (nextOpener.IsPet) { var petOpenerSpell = DataManager.GetPetSpellData(nextOpener.SpellName); if (petOpenerSpell == null) { openerQueue.Dequeue(); continue; } if (PetManager.DoAction(petOpenerSpell.Name, Target)) { Logger.KefkaLog("We're inside of the PetSpell Section."); openerQueue.Dequeue(); continue; } } var openerSpell = DataManager.GetSpellData(nextOpener.SpellId); await Coroutine.Wait(3000, () => ActionManager.CanCast(openerSpell, Target) || ActionManager.CanCast(openerSpell, Me)); if (openerSpell == null) { openerQueue.Dequeue(); } #region Routine Nuance Catches switch (MainSettingsModel.Instance.CurrentRoutine) { case "Barret": break; case "Beatrix": break; case "Cecil": break; case "Cyan": break; case "Edward": if (openerSpell == Spells.PitchPerfect) { await Coroutine.Wait((int)CombatHelper.GcdTimeRemaining, () => ActionResourceManager.Bard.Repertoire == 3); if (ActionResourceManager.Bard.Repertoire != 3) { openerQueue.Dequeue(); continue; } if (await Spells.PitchPerfect.Use(Target, true)) { openerQueue.Dequeue(); continue; } } break; case "Eiko": break; case "Elayne": if (openerSpell == Spells.Verfire || openerSpell == Spells.Verstone) { await Coroutine.Wait((int)CombatHelper.GcdTimeRemaining, () => Me.HasAura(Auras.VerfireReady) || Me.HasAura(Auras.VerstoneReady)); if (!Me.HasAura(Auras.VerfireReady) && !Me.HasAura(Auras.VerstoneReady)) { openerQueue.Dequeue(); continue; } if (Me.HasAura(Auras.VerfireReady)) { if (await Spells.Verfire.Use(Target, true)) { openerQueue.Dequeue(); continue; } } if (Me.HasAura(Auras.VerstoneReady)) { if (await Spells.Verstone.Use(Target, true)) { openerQueue.Dequeue(); continue; } } } break; case "Freya": if (openerSpell == Spells.DragonSight) { if (await FreyaRotation.DragonSightOpener()) { openerQueue.Dequeue(); continue; } } break; case "Paine": break; case "Sabin": break; case "Shadow": break; case "Vivi": break; } #endregion Routine Nuance Catches if (openerSpell?.Range == 0 && openerSpell.SpellType != SpellType.Weaponskill) { if (await openerSpell.UseOpenerSpell(Me, true)) { Logger.KefkaLog("We're inside of the Regular Spell (ME) Section."); openerQueue.Dequeue(); continue; } } if (await openerSpell.UseOpenerSpell(Target, true)) { Logger.KefkaLog("We're inside of the Regular Spell (TARGET) Section."); openerQueue.Dequeue(); } await Coroutine.Yield(); } Logger.KefkaLog(@"Opener has completed, or was interrupted!"); Core.OverlayManager.AddToast(() => "Opener Complete!", TimeSpan.FromMilliseconds(750), MainSettingsModel.Instance.ToastColor(true), Colors.White, new FontFamily("High Tower Text Italic"), new FontWeight(), 52); openerQueue.Clear(); } OpenerManager.ResetOpeners(); return(false); }
public override async Task <bool> Combat() { if (!Common_Utils.InActiveInstance() || Target == null) { return(false); } if (BotManager.Current.IsAutonomous && !ff14bot.Managers.RoutineManager.IsAnyDisallowed(CapabilityFlags.Movement)) { if (await Movement.MovementComposite().ExecuteCoroutine()) { return(false); } } if (Me.IsCasting) { return(await DodgeManager.DodgeThis(Me.SpellCastInfo.SpellData, CurrentTarget, CastedAura, IsDot, IsBuff, IsHealingSpell)); } Logger.DebugLog("Pulsing Combat"); switch (MainSettingsModel.Instance.CurrentRoutine) { case "Barret": return(await BarretRotation.Combat()); case "Beatrix": return(await BeatrixRotation.Combat()); case "Cecil": return(await CecilRotation.Combat()); case "Cyan": return(await CyanRotation.Combat()); case "Edward": return(await EdwardRotation.Combat()); case "Eiko": return(await EikoRotation.Combat()); case "Elayne": return(await ElayneRotation.Combat()); case "Freya": return(await FreyaRotation.Combat()); case "Mikoto": if (HealTarget() != null) { return(await MikotoRotation.Heal()); } return(await MikotoRotation.Combat()); case "Paine": return(await PaineRotation.Combat()); case "Remiel": if (HealTarget() != null) { return(await MikotoRotation.Heal()); } return(await RemielRotation.Combat()); case "Sabin": return(await SabinRotation.Combat()); case "Shadow": return(await ShadowRotation.Combat()); case "Surito": if (HealTarget() != null) { return(await MikotoRotation.Heal()); } return(await SuritoRotation.Combat()); case "Vivi": return(await ViviRotation.Combat()); } return(false); }
public override async Task <bool> CombatBuff() { if (!Common_Utils.InActiveInstance() || Target == null) { return(false); } if (Me.IsCasting) { return(await DodgeManager.DodgeThis(Me.SpellCastInfo.SpellData, CurrentTarget, CastedAura, IsDot, IsBuff, IsHealingSpell)); } Logger.DebugLog("Pulsing CombatBuff"); switch (MainSettingsModel.Instance.CurrentRoutine) { case "Barret": return(await BarretRotation.CombatBuff()); case "Beatrix": return(await BeatrixRotation.CombatBuff()); case "Cecil": return(await CecilRotation.CombatBuff()); case "Cyan": return(await CyanRotation.CombatBuff()); case "Edward": return(await EdwardRotation.CombatBuff()); case "Eiko": return(await EikoRotation.CombatBuff()); case "Elayne": return(await ElayneRotation.CombatBuff()); case "Freya": return(await FreyaRotation.CombatBuff()); case "Mikoto": if (HealTarget() != null) { return(await MikotoRotation.Heal()); } return(await MikotoRotation.CombatBuff()); case "Paine": return(await PaineRotation.CombatBuff()); case "Remiel": if (HealTarget() != null) { return(await RemielRotation.Heal()); } return(await RemielRotation.CombatBuff()); case "Sabin": return(await SabinRotation.CombatBuff()); case "Shadow": return(await ShadowRotation.CombatBuff()); case "Surito": if (HealTarget() != null) { return(await SuritoRotation.Heal()); } return(await SuritoRotation.CombatBuff()); case "Vivi": return(await ViviRotation.CombatBuff()); } return(false); }
public override async Task <bool> Pull() { if (!Common_Utils.InActiveInstance() || Target == null) { return(false); } if (BotManager.Current.IsAutonomous && !ff14bot.Managers.RoutineManager.IsAnyDisallowed(CapabilityFlags.Movement)) { if (await Movement.MovementComposite().ExecuteCoroutine()) { return(false); } } if (!OpenerEnabled) { if (Me.IsCasting) { var waitUntilCombatTime = TimeSpan.FromMilliseconds(Math.Min(Me.SpellCastInfo.SpellData.AdjustedCastTime.TotalMilliseconds, 2500)); if (await DodgeManager.DodgeThis(Me.SpellCastInfo.SpellData, CurrentTarget, CastedAura, IsDot, IsBuff, IsHealingSpell)) { await Coroutine.Wait(waitUntilCombatTime, () => Me.InCombat); } return(true); } if (CombatHelper.LastSpell != null && CombatHelper.LastTarget != Me) { await Heal(); await CombatBuff(); await Combat(); var waitUntilCombatTime = TimeSpan.FromMilliseconds(Math.Min(CombatHelper.LastSpell.AdjustedCastTime.TotalMilliseconds, 2500)); await Coroutine.Wait(waitUntilCombatTime, () => Me.InCombat); return(true); } } Logger.DebugLog("Pulsing Pull"); switch (MainSettingsModel.Instance.CurrentRoutine) { case "Barret": return(await BarretRotation.Pull()); case "Beatrix": return(await BeatrixRotation.Pull()); case "Cecil": return(await CecilRotation.Pull()); case "Cyan": return(await CyanRotation.Pull()); case "Edward": return(await EdwardRotation.Pull()); case "Eiko": return(await EikoRotation.Pull()); case "Elayne": return(await ElayneRotation.Pull()); case "Freya": return(await FreyaRotation.Pull()); case "Mikoto": return(await MikotoRotation.Pull()); case "Paine": return(await PaineRotation.Pull()); case "Remiel": return(await RemielRotation.Pull()); case "Sabin": return(await SabinRotation.Pull()); case "Shadow": return(await ShadowRotation.Pull()); case "Surito": return(await SuritoRotation.Pull()); case "Vivi": return(await ViviRotation.Pull()); } return(false); }
public override async Task <bool> PreCombat() { if (!Common_Utils.InActiveInstance()) { return(false); } if (OpenerEnabled) { return(await Pull()); } if (MainSettingsModel.Instance.UseAutoSprint && Target == null && Me.EnemiesInRange(20) == 0 && MovementManager.IsMoving) { await Spells.Sprint.Use(Me, true); } if (Me.IsCasting) { return(await DodgeManager.DodgeThis(Me.SpellCastInfo.SpellData, CurrentTarget, CastedAura, IsDot, IsBuff, IsHealingSpell)); } Logger.DebugLog("Pulsing Pre-combat"); switch (MainSettingsModel.Instance.CurrentRoutine) { case "Barret": return(await BarretRotation.PreCombat()); case "Beatrix": return(await BeatrixRotation.PreCombat()); case "Cecil": return(await CecilRotation.PreCombat()); case "Cyan": return(await CyanRotation.PreCombat()); case "Edward": return(await EdwardRotation.PreCombat()); case "Eiko": return(await EikoRotation.PreCombat()); case "Elayne": return(await ElayneRotation.PreCombat()); case "Freya": return(await FreyaRotation.PreCombat()); case "Mikoto": return(await MikotoRotation.PreCombat()); case "Paine": return(await PaineRotation.PreCombat()); case "Remiel": return(await RemielRotation.PreCombat()); case "Sabin": return(await SabinRotation.PreCombat()); case "Shadow": return(await ShadowRotation.PreCombat()); case "Surito": return(await SuritoRotation.PreCombat()); case "Vivi": return(await ViviRotation.PreCombat()); } return(false); }