示例#1
0
        public static async Task <bool> BasicSkillCondition(Skill skill, SkillInfo skillInfo, Actor target)
        {
            var castResult       = skill.ActorCanCastResult(GameManager.LocalPlayer);
            var castResultSummon = SkillUseError.Unknown;

            if (GameManager.SummonedMinion.IsValid && GameManager.SummonedMinion.HealthPercent > 0)
            {
                castResultSummon = skill.ActorCanCastResult(GameManager.SummonedMinion);
            }


            // Log.Info("Cast Duration " + skill.CastDuration);

            if (!skillInfo.ignoreSkillError)
            {
                Log.Info(skillInfo.skillName + " CanCast result: " + castResult + " Range min:" + skill.MinRange + " Max:" + skill.MaxRange);
                if ((castResult > SkillUseError.None) && (castResultSummon > SkillUseError.None))
                {
                    if (castResult != SkillUseError.StillOnGlobalRecycling)
                    {
                        return(false);
                    }
                    await WaitGcd(skillInfo.skillName);

                    return(true);
                }
                else
                {
                    //Log.Info("Skill Valid " + skillName);
                }
            }
            else
            {
                Log.Warn("Ignoring Skill state");
            }

            //Log.Info("Verifying Range");

            if (target != null && target.IsValid && target.HealthPercent > 0 && skill.MaxRange < (target.Distance / 50))
            {
                Log.Info("Outside of range");
                return(false);
            }

            return(true);
        }