Пример #1
0
        public static async Task <bool> Haima()
        {
            if (!SageSettings.Instance.Haima)
            {
                return(false);
            }

            if (!Spells.Haima.IsKnownAndReady())
            {
                return(false);
            }

            if (Globals.InParty)
            {
                if (SageSettings.Instance.FightLogic_Haima && FightLogic.EnemyHasAnyTankbusterLogic())
                {
                    return(false);
                }

                var haimaCandidates = Group.CastableAlliesWithin30.Where(r => r.CurrentHealthPercent < SageSettings.Instance.HaimaHpPercent &&
                                                                         !r.HasAura(Auras.Weakness) &&
                                                                         !r.HasAura(Auras.Haimatinon) &&
                                                                         !r.HasAura(Auras.Panhaimatinon));

                if (SageSettings.Instance.HaimaTankForBuff)
                {
                    haimaCandidates = haimaCandidates.Where(r => r.IsTank(SageSettings.Instance.HaimaMainTankForBuff));
                }

                var haimaTarget = haimaCandidates.FirstOrDefault();

                if (haimaTarget == null)
                {
                    return(false);
                }

                return(await Spells.Haima.CastAura(haimaTarget, Auras.Haimatinon));
            }

            if (Core.Me.CurrentHealthPercent > SageSettings.Instance.HaimaHpPercent)
            {
                return(false);
            }

            return(await Spells.Haima.CastAura(Core.Me, Auras.Haimatinon));
        }