Exemplo n.º 1
0
        private static async Task <bool> ComboSkill()
        {
            if (HasKaiten)
            {
                return(false);
            }

            if (CombatHelper.LastSpell == Spells.Hakaze || ActionManager.LastSpell == Spells.Hakaze)
            {
                if (Me.ClassLevel < 18)
                {
                    return(await Spells.Jinpu.Use(Target, true));
                }

                if (Sen.HasFlag(Getsu) && !Sen.HasFlag(Ka))
                {
                    return(await Spells.Shifu.Use(Target, true));
                }

                if (Sen.HasFlag(Ka) && !Sen.HasFlag(Getsu))
                {
                    return(await Spells.Jinpu.Use(Target, true));
                }

                if (Me.ClassLevel >= 50 && Sen.HasFlag(Ka) && Sen.HasFlag(Getsu) && !Sen.HasFlag(Setsu))
                {
                    return(await Spells.Yukikaze.Use(Target, true));
                }

                if (shifuAura == null || shifuAura.TimespanLeft == TimeSpan.Zero)
                {
                    return(await Spells.Shifu.Use(Target, true));
                }

                if (jinpuAura == null || jinpuAura.TimespanLeft == TimeSpan.Zero)
                {
                    return(await Spells.Jinpu.Use(Target, true));
                }

                if (Me.ClassLevel >= 50 && (!Target.HasAura(Auras.SlashingResistanceDown, false, 5000) || !Sen.HasFlag(Setsu)))
                {
                    return(await Spells.Yukikaze.Use(Target, true));
                }

                if (jinpuAura?.TimespanLeft < shifuAura?.TimespanLeft)
                {
                    return(await Spells.Jinpu.Use(Target, true));
                }

                return(await Spells.Shifu.Use(Target, true));
            }

            return(false);
        }
Exemplo n.º 2
0
        private static int SenCount()
        {
            var count = 0;

            if (Sen.HasFlag(Ka))
            {
                count++;
            }

            if (Sen.HasFlag(Setsu))
            {
                count++;
            }

            if (Sen.HasFlag(Getsu))
            {
                count++;
            }

            return(count);
        }
Exemplo n.º 3
0
        public static async Task <bool> PVPRotation()
        {
            if (Target == null || !Target.CanAttack)
            {
                return(false);
            }

            if (await PvPSpells.MidareSetsugekka.Use(Target, true))
            {
                return(true);
            }
            if (await PvPSpells.HissatsuShinten.Use(Target, true))
            {
                return(true);
            }
            Logger.KefkaLog(ActionManager.ComboTimeLeft.ToString());
            if (await PvPSpells.MeikyoShisui.Use(Me, SenCount() < 3 && !Me.HasAura(PvPAuras.MeikyoShisui) &&
                                                 ActionManager.GetPvPComboCurrentAction(PvPCombos.YukikazeCombo) == PvPSpells.Hakaze &&
                                                 ActionManager.GetPvPComboCurrentAction(PvPCombos.GekkoCombo) == PvPSpells.Jinpu &&
                                                 ActionManager.GetPvPComboCurrentAction(PvPCombos.KashaCombo) == PvPSpells.Shifu))
            {
                return(true);
            }

            if (DateTime.Now < _pvpComboTimer || DateTime.Now < _pvpLimiterTimer)
            {
                return(false);
            }
            _pvpLimiterTimer = DateTime.Now.AddMilliseconds(500);

            if (!Sen.HasFlag(Setsu))
            {
                var tempCombatHelperLastSpell = ActionManager.GetPvPComboCurrentAction(PvPCombos.YukikazeCombo);
                if (ActionManager.DoPvPCombo(PvPCombos.YukikazeCombo, Target))
                {
                    CombatHelper.LastSpell = tempCombatHelperLastSpell;
                    Logger.CastMessage(tempCombatHelperLastSpell.LocalizedName, Target.SafeName());
                    _pvpComboTimer = DateTime.Now.AddMilliseconds(2000);
                    return(true);
                }
            }

            if (!Sen.HasFlag(Getsu) && Sen.HasFlag(Setsu))
            {
                var tempCombatHelperLastSpell = ActionManager.GetPvPComboCurrentAction(PvPCombos.GekkoCombo);
                if (ActionManager.DoPvPCombo(PvPCombos.GekkoCombo, Target))
                {
                    CombatHelper.LastSpell = tempCombatHelperLastSpell;
                    Logger.CastMessage(tempCombatHelperLastSpell.LocalizedName, Target.SafeName());
                    _pvpComboTimer = DateTime.Now.AddMilliseconds(2000);
                    return(true);
                }
            }

            if (!Sen.HasFlag(Ka) && Sen.HasFlag(Getsu))
            {
                var tempCombatHelperLastSpell = ActionManager.GetPvPComboCurrentAction(PvPCombos.KashaCombo);
                if (ActionManager.DoPvPCombo(PvPCombos.KashaCombo, Target))
                {
                    CombatHelper.LastSpell = tempCombatHelperLastSpell;
                    Logger.CastMessage(tempCombatHelperLastSpell.LocalizedName, Target.SafeName());
                    _pvpComboTimer = DateTime.Now.AddMilliseconds(2000);
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 4
0
        private static void CyanPositionals()
        {
            var jinpuAura = Me.CharacterAuras.FirstOrDefault(aura => aura != null && aura.Name.Contains("Jinpu"));
            var shifuAura = Me.CharacterAuras.FirstOrDefault(aura => aura != null && aura.Name.Contains("Shifu"));

            if (Me.HasAura(Auras.MeikyoShisui))
            {
                if (!Sen.HasFlag(Ka))
                {
                    if (!Target.IsFlanking)
                    {
                        FlankingRed();
                    }
                    else
                    {
                        FlankingGreen();
                    }
                    return;
                }

                if (!Sen.HasFlag(Getsu))
                {
                    if (!Target.IsBehind)
                    {
                        BehindRed();
                    }
                    else
                    {
                        BehindGreen();
                    }
                    return;
                }
            }

            if (Me.HasTarget && Target.CanAttack)
            {
                // Kasha
                if ((shifuAura == null || shifuAura.TimespanLeft == TimeSpan.Zero || shifuAura?.TimespanLeft < jinpuAura?.TimespanLeft) && ActionManager.LastSpell != Spells.Jinpu && !Target.IsFlanking)
                {
                    FlankingRed();
                    return;
                }

                if ((shifuAura == null || shifuAura.TimespanLeft == TimeSpan.Zero || shifuAura?.TimespanLeft < jinpuAura?.TimespanLeft || ActionManager.LastSpell == Spells.Shifu) && Target.IsFlanking)
                {
                    FlankingGreen();
                    return;
                }
                // Gekko
                if ((jinpuAura == null || jinpuAura.TimespanLeft == TimeSpan.Zero || jinpuAura?.TimespanLeft < shifuAura?.TimespanLeft) && ActionManager.LastSpell != Spells.Shifu && !Target.IsBehind)
                {
                    BehindRed();
                    return;
                }

                if ((jinpuAura == null || jinpuAura.TimespanLeft == TimeSpan.Zero || jinpuAura?.TimespanLeft < shifuAura?.TimespanLeft || ActionManager.LastSpell == Spells.Jinpu) && Target.IsBehind)
                {
                    BehindGreen();
                    return;
                }
            }

            CurrentPositional = "Target";
            PositionalColor   = Brushes.Red;
        }
Exemplo n.º 5
0
        private static async Task <bool> MeikyoShisui()
        {
            if ((SenCount() == 3 && ActionManager.CanCast(Spells.Hagakure, Me) && Me.ClassLevel >= 68) || !CyanSettingsModel.Instance.UseIaijutsu || ActionManager.LastSpell == Spells.Hagakure || CombatHelper.LastSpell == Spells.Hagakure)
            {
                return(false);
            }

            if (Target == null || !Target.CanAttack || (CyanSettingsModel.Instance.UseAoE && Me.EnemiesInRange(6) >= CyanSettingsModel.Instance.MobCount && Me.CurrentTP > CyanSettingsModel.Instance.TpLimit))
            {
                return(false);
            }

            if (!CyanSettingsModel.Instance.UseBuffs ||
                !ActionManager.CanCast(Spells.MeikyoShisui, Me) ||
                SenCount() == 3 ||
                CombatHelper.LastSpell != Spells.Hakaze ||
                !Target.HealthCheck(false) ||
                !Target.TimeToDeathCheck())
            {
                return(false);
            }

            Logger.CyanLog(@"Entering Meikyo Shisui Method.");
            if (BotManager.Current.IsAutonomous && MovementManager.IsMoving)
            {
                Navigator.PlayerMover.MoveStop();
            }

            var timeOut = new Stopwatch();

            timeOut.Start();

            var queue = new Queue <SpellData>();

            queue.Enqueue(Spells.MeikyoShisui);

            if (!Sen.HasFlag(Setsu))
            {
                queue.Enqueue(Spells.Yukikaze);
            }

            if (!Sen.HasFlag(Ka))
            {
                queue.Enqueue(Spells.Kasha);
            }

            if (!Sen.HasFlag(Getsu))
            {
                queue.Enqueue(Spells.Gekko);
            }

            if (Spells.Hagakure.Cooldown.TotalSeconds > 5 || Me.ClassLevel < Spells.Hagakure.LevelAcquired || Kenki > 40)
            {
                if (CyanSettingsModel.Instance.UseBuffs && Me.ClassLevel >= Spells.HissatsuKaiten.LevelAcquired && (Kenki >= 20 || ((Kenki + (5 * (queue.Count - 1))) >= 20)))
                {
                    queue.Enqueue(Spells.HissatsuKaiten);
                }
            }
            else if (Me.ClassLevel >= Spells.Hagakure.LevelAcquired && (Kenki + (5 * (queue.Count - 1))) <= 40)
            {
                queue.Enqueue(Spells.Hagakure);
            }

            while (queue.Count > 0 && timeOut.ElapsedMilliseconds < 12000 && ((Me.HasAura(Auras.Kaiten) || CombatHelper.LastSpell != Spells.Iaijutsu)))
            {
                var action = queue.Peek();

                await Coroutine.Wait(3000, () => ActionManager.CanCast(action, Target) || ActionManager.CanCast(action, Me));

                if (await action.Use(Target, true) || await action.Use(Me, true))
                {
                    queue.Dequeue();
                    continue;
                }

                await Coroutine.Yield();
            }

            timeOut.Reset();
            await Coroutine.Wait(3000, () => ActionManager.CanCast(Spells.Hakaze, Target));

            queue.Clear();
            return(false);
        }
Exemplo n.º 6
0
 private static async Task <bool> Oka()
 {
     return(await Spells.Oka.Use(Me, (CombatHelper.LastSpell == Spells.Fuga || ActionManager.LastSpell == Spells.Fuga) &&
                                 Me.EnemiesInRange(6) >= 1 &&
                                 (!Sen.HasFlag(Ka) || Sen.HasFlag(Ka) && Sen.HasFlag(Getsu))));
 }
Exemplo n.º 7
0
        private static async Task <bool> ComboFinisher()
        {
            if (HasKaiten)
            {
                return(false);
            }

            if (CombatHelper.LastSpell == Spells.Jinpu || ActionManager.LastSpell == Spells.Jinpu || Me.HasAura(Auras.MeikyoShisui) && (jinpuAura?.TimespanLeft < shifuAura?.TimespanLeft || !Sen.HasFlag(Getsu) || Me.ClassLevel < 62))
            {
                return(await Spells.Gekko.Use(Target, true));
            }

            if (CombatHelper.LastSpell == Spells.Shifu || ActionManager.LastSpell == Spells.Shifu || Me.HasAura(Auras.MeikyoShisui) && (shifuAura?.TimespanLeft < jinpuAura?.TimespanLeft || !Sen.HasFlag(Ka) || Me.ClassLevel < 62))
            {
                return(await Spells.Kasha.Use(Target, true));
            }

            return(false);
        }