Exemple #1
0
        private static void RLogic()
        {
            if (!IsCastingR && Config.GetBool("自动R"))
            {
                var target = TargetSelector.GetTarget(R.Range - 400, TargetSelector.DamageType.Physical);
                if (target != null && target.IsValid && !target.IsDead &&
                    GetRDmg(target) > target.Health &&
                    OktwCommon.ValidUlt(target) && !OktwCommon.IsSpellHeroCollision(target, R) &&
                    target.CountAlliesInRange(600) == 0 &&
                    LastPosition.GetLastPositionsInRange(Player, 1000, 4000).Count == 0 &&
                    !Player.UnderTurret(true) &&
                    !target.InFountain())
                {
                    if (R.CastSpell(target))
                    {
                        RCharge.Target = target;
                    }
                }
            }

            #region 自动R逻辑

            if (IsCastingR)
            {
                if (Config.Item("R放眼").GetValue <bool>() && ScryingOrb.IsReady())
                {
                    var pistionList = VectorHelper.GetLastPositionInRCone().Where(m => !m.Hero.IsVisible && !m.Hero.IsDead && Game.ClockTime - m.LastSeen < 7 * 1000).OrderByDescending(m => m.LastSeen);

                    if (RCharge.Target == null && pistionList.Count() > 0)
                    {
                        var MissPosition = pistionList.First();
                        var MostNearBush = VectorHelper.GetBushNearPosotion(MissPosition.LastPosition);
                        if (MostNearBush != Vector3.Zero && MostNearBush.Distance(MissPosition.LastPosition) < 500)
                        {
                            ScryingOrb.Cast(MostNearBush);
                        }
                        else
                        {
                            ScryingOrb.Cast(MissPosition.LastPosition);
                        }
                    }
                    else if (RCharge.Target != null && !RCharge.Target.IsVisible && !RCharge.Target.IsDead)
                    {
                        var RTargetLastPosition = pistionList?.Find(m => m.Hero == RCharge.Target && Game.ClockTime - m.LastSeen < 3 * 1000);
                        if (RTargetLastPosition != null)
                        {
                            var MostNearBush = VectorHelper.GetBushNearPosotion(RTargetLastPosition.LastPosition);
                            if (MostNearBush.Distance(RTargetLastPosition.LastPosition) < 500)
                            {
                                ScryingOrb.Cast(MostNearBush);
                            }
                            else
                            {
                                ScryingOrb.Cast(RTargetLastPosition.LastPosition);
                            }
                        }
                    }
                }

                var target = GetTargetInR();
                if (target != null)
                {
                    #region 使用R,并记录R目标和施放时间
                    if (RCharge.Index == 0)
                    {
                        if (R.CastSpell(target))
                        {
                            RCharge.Target = target;
                        }
                    }
                    else
                    {
                        Utility.DelayAction.Add(delay[RCharge.Index - 1], () =>
                        {
                            if (R.CastSpell(target))
                            {
                                RCharge.Target = target;
                            }
                        });
                    }
                    #endregion
                }
            }

            #endregion
        }
Exemple #2
0
        private static void Obj_AI_Base_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (sender.IsMe)
            {
                if (args.SData.Name == "JhinRShotMis")
                {
                    RCharge.Index++;
                    RCharge.CastT = Game.ClockTime;

                    if (Config.GetBool("调试"))
                    {
                        DeBug.Debug("[OnProcessSpellCast]", $"使用技能R。是否正在放R{IsCastingR}");
                    }
                }
                if (args.SData.Name == "JhinRShotMis4")
                {
                    RCharge.Index  = 0;
                    RCharge.CastT  = Game.ClockTime;
                    RCharge.Target = null;

                    if (Config.GetBool("调试"))
                    {
                        DeBug.Debug("[OnProcessSpellCast]", $"使用技能R。是否正在放R{IsCastingR}");
                    }
                }
            }

            if (sender.IsMe && args.SData.Name == "JhinR")
            {
                REndPos = args.End;
                if (Config.Item("R放眼").GetValue <bool>() &&
                    (ScryingOrb.IsReady()) &&
                    HeroManager.Enemies.All(e => !e.InRCone() || !e.IsValid || e.IsDead))
                {
                    var bushList = VectorHelper.GetBushInRCone();
                    var lpl      = VectorHelper.GetLastPositionInRCone();
                    if (bushList?.Count > 0)
                    {
                        if (lpl?.Count > 0)
                        {
                            var lp = lpl.First(p => Game.Time - p.LastSeen > 2 * 1000);
                            if (lp != null)
                            {
                                var bush = VectorHelper.GetBushNearPosotion(lp.LastPosition, bushList);
                                ScryingOrb.Cast(bush);
                            }
                        }
                        else
                        {
                            var bush = VectorHelper.GetBushNearPosotion(REndPos, bushList);
                            ScryingOrb.Cast(bush);
                        }
                    }
                    else if (lpl?.Count > 0)
                    {
                        ScryingOrb.Cast(lpl.First().LastPosition);
                    }
                }
            }

            if (sender.IsMe && args.Slot == SpellSlot.W && Config.GetBool("调试"))
            {
                DeBug.Debug("[OnProcessSpellCast]", $"使用技能W。是否正在放R{IsCastingR}");
            }
        }