Example #1
0
        public static bool CastMark(Obj_AI_Hero target)
        {
            if (Config.GetBool("调试"))
            {
                DeBug.Debug("[释放技能]", $"目标 {target.Name.ToUTF8()}", DebugLevel.Warning, Output.ChatBox);
                DeBug.Debug("[释放技能]", $"模式 {Config.GetStringList("预判模式").SelectedValue}", DebugLevel.Warning, Output.ChatBox);
                DeBug.Debug("[释放技能]", $"命中率 {Config.GetStringList("命中率").SelectedValue}", DebugLevel.Warning, Output.ChatBox);
            }



            var hitChangceIndex = Config.GetStringIndex("命中率");
            var PredictMode     = Config.GetStringIndex("预判模式");


            if (PredictMode == 0)
            {
                var hitChangceList = new[] { HitChance.VeryHigh, HitChance.High, HitChance.Medium };
                return(SnowBall.CastIfHitchanceEquals(target, hitChangceList[hitChangceIndex]));
            }
            else if (PredictMode == 1)
            {
                var hitChangceList = new[] { SebbyPredict.HitChance.VeryHigh, SebbyPredict.HitChance.High, SebbyPredict.HitChance.Medium };
                return(CastSpell(SnowBall, target, hitChangceList[hitChangceIndex]));
            }
            return(false);
        }
Example #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}");
            }
        }