Exemplo n.º 1
0
        private bool notKilleableWithOthersSpells(Obj_AI_Hero tar)
        {
            double totalDamage = 0;
            double qDamage = 0d, wDamage = 0d, eDamage = 0d;

            if (GetQ.IsReady())
            {
                qDamage = GetQ.GetDamage(tar);
            }
            if (GetW.IsReady())
            {
                wDamage = GetW.GetDamage(tar);
            }
            if (GetE.IsReady())
            {
                eDamage = GetE.GetDamage(tar);
            }
            totalDamage = qDamage + wDamage + eDamage;

            if (isKilleable(tar, totalDamage))
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 2
0
        public void CastQE(Obj_AI_Base target)
        {
            if (GetE.IsReady())
            {
                //    var prediction = Prediction.GetPrediction(target, 500);
                var predictionInput = new PredictionInput
                {
                    Aoe       = false,
                    Collision = EQ.Collision,
                    Speed     = EQ.Speed,
                    Delay     = EQ.Delay,
                    Range     = EQ.Range,
                    From      = HeroManager.Player.ServerPosition,
                    Radius    = EQ.Width,
                    Unit      = target,
                    Type      = SkillshotType.SkillshotLine
                };
                var prediction = Prediction.GetPrediction(predictionInput);


                Vector3 castQpos = prediction.CastPosition;

                if (HeroManager.Player.Distance(castQpos) > GetQ.Range)
                {
                    castQpos = HeroManager.Player.Position.Extend(castQpos, GetE.Range);
                }


                if (prediction.Hitchance >= HitChance.VeryHigh)
                {
                    EQcastNow = true;
                    GetQ.Cast(castQpos);
                }
            }
        }
Exemplo n.º 3
0
        public bool castE(Obj_AI_Hero t)
        {
            if (!GetE.IsReady())
            {
                return(false);
            }
            var ePred = Eany.GetPrediction(t);

            if (ePred.Hitchance >= HitChance.VeryHigh)
            {
                var playerToCP = HeroManager.Player.Distance(ePred.CastPosition);
                foreach (var pos in GetOrbs.GetOrbs())
                {
                    if (HeroManager.Player.Distance(pos) < GetE.Range)
                    {
                        var ballFinalPos = HeroManager.Player.ServerPosition.Extend(pos, playerToCP);
                        if (ballFinalPos.Distance(ePred.CastPosition) < 50)
                        {
                            GetE.Cast(pos);

                            return(true);
                        }
                    }
                }
            }
            return(false);
        }
Exemplo n.º 4
0
        public override bool castR(Core core)
        {
            if (GetR.IsReady())
            {
                var rTarget = TargetSelector.GetTarget(GetR.Range, TargetSelector.DamageType.Magical);
                if (rTarget == null || !GetE.IsInRange(rTarget))
                {
                    return(false);
                }
                var killeable = core.GetMenu.getMenuBoolOption("CR");
                if (getBlazedTargets(rTarget, core).Count() >= 2)
                {
                    GetR.Cast(rTarget);
                }

                if (killeable && isKilleable(rTarget, getRDamage(rTarget, getEnemiesBlazedInRange(rTarget)))) // contar pasiva contar daño rebotando con enemigos y minions. esto es solo para 1 rebote.
                {
                    if (notKilleableWithOthersSpells(rTarget))
                    {
                        if (core.GetMenu.getMenuBoolOption("R" + rTarget.ChampionName))
                        {
                            GetR.Cast(rTarget);
                        }
                    }
                }
                var min = core.GetMenu.GetMenu.Item("CRM").GetValue <Slider>().Value;
                if (getEnemiesBlazedInRange(rTarget) >= min)
                {
                    GetR.Cast(rTarget);
                }
            }
            return(base.castR(core));
        }
Exemplo n.º 5
0
    private void Start()
    {
        LuaEnv env = new LuaEnv();

        env.DoString(str);

        int    a = env.Global.Get <int>("a");
        string b = env.Global.Get <string>("b");
        bool   c = env.Global.Get <bool>("c");

        IGetD id = env.Global.Get <IGetD>("d");

        print("修改前: " + id.f1 + "--" + id.f2);
        id.f1 = 100;
        print("修改后 : " + id.f1);
        print("add : " + id.add(10, 20));

        System.Action e = env.Global.Get <System.Action>("e");
        e();

        GetF f    = env.Global.Get <GetF>("f");
        int  tmpB = 0;
        int  tmpA = f(100, 200, out tmpB);

        Debug.LogWarning("a= " + tmpA + ", b= " + tmpB);

        GetE tmpE = env.Global.Get <GetE>("get_E");

        // e = tmpE();
        //e();
        tmpE();

        // env.Dispose();
    }
Exemplo n.º 6
0
    private void Start()
    {
        luaEnv = new LuaEnv();
        luaEnv.DoString(script.text);
        print("_G.a = " + luaEnv.Global.Get <int>("a"));
        print("_G.b = " + luaEnv.Global.Get <string>("b"));
        print("_G.c = " + luaEnv.Global.Get <bool>("c"));

        DClass d = luaEnv.Global.Get <DClass>("d");

        print("_G.d = {f1 =" + d.f1 + " ,f2=" + d.f2 + "}");

        Dictionary <string, double> d1 = luaEnv.Global.Get <Dictionary <string, double> >("d");

        print("_G.d = {f1 =" + d1["f1"] + " ,f2=" + d1["f2"] + "  ,count " + d1.Count + " }");

        List <double> d2 = luaEnv.Global.Get <List <double> >("d");

        print("_G.d.len " + d2.Count);

        ItfD d3 = luaEnv.Global.Get <ItfD>("d");

        d3.f2 = 1000;
        print("_G.d = {f1 =" + d3.f1 + " ,f2=" + d3.f2 + "}");
        print("_G.d : add " + d3.add(d3.f1, d3.f2));

        LuaTable table = luaEnv.Global.Get <LuaTable>("d");

        Debug.Log("_G.d = {f1=" + table.Get <int>("f1") + ", f2=" + table.Get <int>("f2") + "}");

        Action e = luaEnv.Global.Get <Action>("e");//映射到一个delgate,要求delegate加到生成列表,否则返回null,建议用法

        e();

        FDelegate f = luaEnv.Global.Get <FDelegate>("f");
        DClass    d_ret;
        // 多值返回,可用out接收多余的参数
        // 输出 a 100 b John
        int f_ret = f(100, "John", out d_ret);//lua的多返回值映射:从左往右映射到c#的输出参数,输出参数包括返回值,out参数,ref参数

        // table只含有常量f1,所以f2赋值为0
        Debug.Log("ret.d = {f1=" + d_ret.f1 + ", f2=" + d_ret.f2 + "}, ret=" + f_ret);

        GetE ret_e = luaEnv.Global.Get <GetE>("ret_e");//delegate可以返回更复杂的类型,甚至是另外一个delegate

        e = ret_e();
        e();


        // 映射到 LuaFunction
        LuaFunction d_e = luaEnv.Global.Get <LuaFunction>("e");

        // Call 函数可以传任意类型,任意个数的参数
        d_e.Call();
    }
Exemplo n.º 7
0
    // Use this for initialization
    void Start()
    {
        luaenv = new LuaEnv();
        luaenv.DoString(script);

        Debug.Log("_G.a = " + luaenv.Global.Get <int>("a"));
        Debug.Log("_G.b = " + luaenv.Global.Get <string>("b"));
        Debug.Log("_G.c = " + luaenv.Global.Get <bool>("c"));


        DClass d = luaenv.Global.Get <DClass>("d");//映射到有对应字段的class,by value

        Debug.Log("_G.d = {f1=" + d.f1 + ", f2=" + d.f2 + "}");

        Dictionary <string, double> d1 = luaenv.Global.Get <Dictionary <string, double> >("d");//映射到Dictionary<string, double>,by value

        Debug.Log("_G.d = {f1=" + d1["f1"] + ", f2=" + d1["f2"] + "}, d.Count=" + d1.Count);

        List <double> d2 = luaenv.Global.Get <List <double> >("d"); //映射到List<double>,by value

        Debug.Log("_G.d.len = " + d2.Count);

        ItfD d3 = luaenv.Global.Get <ItfD>("d"); //映射到interface实例,by ref,这个要求interface加到生成列表,否则会返回null,建议用法

        d3.f2 = 1000;
        Debug.Log("_G.d = {f1=" + d3.f1 + ", f2=" + d3.f2 + "}");
        Debug.Log("_G.d:add(1, 2)=" + d3.add(1, 2));

        LuaTable d4 = luaenv.Global.Get <LuaTable>("d");//映射到LuaTable,by ref

        Debug.Log("_G.d = {f1=" + d4.Get <int>("f1") + ", f2=" + d4.Get <int>("f2") + "}");


        Action e = luaenv.Global.Get <Action>("e");//映射到一个delgate,要求delegate加到生成列表,否则返回null,建议用法

        e();

        FDelegate f = luaenv.Global.Get <FDelegate>("f");
        DClass    d_ret;
        DClass    d_ret1;
        int       f_ret = f(100, "John", out d_ret, out d_ret1);//lua的多返回值映射:从左往右映射到c#的输出参数,输出参数包括返回值,out参数,ref参数

        Debug.Log("ret.d = {f1=" + d_ret.f1 + ", f2=" + d_ret.f2 + "},"
                  + "ret1.d = {f1=" + d_ret1.f1 + ", f2=" + d_ret1.f2 + "},"
                  + "ret=" + f_ret);

        GetE ret_e = luaenv.Global.Get <GetE>("ret_e");//delegate可以返回更复杂的类型,甚至是另外一个delegate

        e = ret_e();
        e();

        LuaFunction d_e = luaenv.Global.Get <LuaFunction>("e");

        d_e.Call();
    }
Exemplo n.º 8
0
 public override bool castE(Core core)
 {
     if (GetE.IsReady())
     {
         var eTarget = TargetSelector.GetTarget(GetE.Range, TargetSelector.DamageType.Magical);
         if (eTarget == null || !GetE.IsInRange(eTarget))
         {
             return(false);
         }
         GetE.Cast(eTarget);
     }
     return(base.castE(core));
 }
Exemplo n.º 9
0
 private bool NotKilleableWithOtherSpells(Obj_AI_Hero target, SyndraCore core)
 {
     if (GetQ.IsReady() && GetQ.IsKillable(target))
     {
         CastQ();
         return(false);
     }
     if (GetW.IsReady() && GetW.IsKillable(target))
     {
         CastW();
         return(false);
     }
     if (GetE.IsReady() && GetE.IsKillable(target))
     {
         CastE(core);
         return(false);
     }
     return(true);
 }
Exemplo n.º 10
0
        public bool CastE(SyndraCore core)
        {
            if (!GetE.IsReady())
            {
                return(false);
            }
            if (GetW.IsReady())
            {
                return(false);
            }
            if (GetOrbs.WObject(false) != null)
            {
                return(false);
            }
            for (var index = 0; index < core.GetOrbs.Count; index++)
            {
                foreach (Obj_AI_Hero tar in HeroManager.Enemies)
                {
                    if (!(tar.Distance(core.Hero) <= GetE.Range))
                    {
                        continue;
                    }
                    var orb = core.GetOrbs[index];
                    if (orb.IsValid())
                    {
                        if (!GetE.IsInRange(orb))
                        {
                            continue;
                        }
                    }
                    //500 extended range.
                    var finalBallPos = HeroManager.Player.Position.Extend(orb, 500);

                    if (CalcE(orb, finalBallPos, tar))
                    {
                        GetE.Cast(orb);
                    }
                }
            }
            return(false);
        }
Exemplo n.º 11
0
        public bool CalcE(Vector3 initialPoint, Vector3 finalPoint, Obj_AI_Hero hero)
        {
            /*  for (var i = 25; i <= 500; i += 10)
             * {
             *    var result = initialPoint.Extend(finalPoint, i);
             *
             *    if (hero.Distance(result)<=50) return true;
             * }*/
            var ePred = GetE.GetPrediction(hero);

            if (ePred.Hitchance < HitChance.High)
            {
                return(false);
            }
            var pt = HeroManager.Player.Distance(ePred.CastPosition);

            var ballFinalPos = HeroManager.Player.ServerPosition.Extend(initialPoint, pt);

            if (ballFinalPos.Distance(ePred.CastPosition) < 50)
            {
                return(true);
            }
            return(false);
        }
Exemplo n.º 12
0
    // Use this for initialization
    void Start()
    {
        luaenv = new LuaEnv();
        luaenv.DoString(script);

        Debug.Log("_G.a = " + luaenv.Global.Get <int>("a"));
        Debug.Log("_G.b = " + luaenv.Global.Get <string>("b"));
        Debug.Log("_G.c = " + luaenv.Global.Get <bool>("c"));


        DClass d = luaenv.Global.Get <DClass>("d");//映射到有对应字段的class,by value

        Debug.Log("_G.d = {f1=" + d.f1 + ", f2=" + d.f2 + "}");

        //映射到Dictionary<string, double>,by value
        Dictionary <string, double> d1 = luaenv.Global.Get <Dictionary <string, double> >("d");

        Debug.Log("_G.d = {f1=" + d1["f1"] + ", f2=" + d1["f2"] + "}, d.Count=" + d1.Count);
        //只能映射出table中键值对<string, double>的属性,即上述的f1=12,f2=34

        //映射到List<double>,by value
        List <double> d2 = luaenv.Global.Get <List <double> >("d");

        Debug.Log("_G.d.len = " + d2.Count);
        //只能映射出table中类型为number的属性,即上述的1,2,3

        //映射到interface实例,by ref,这个要求interface加到生成列表即添加[CSharpCallLua]标签,否则会返回null,建议用法
        ItfD d3 = luaenv.Global.Get <ItfD>("d");

        d3.f2 = 1000;
        Debug.Log("_G.d = {f1=" + d3.f1 + ", f2=" + d3.f2 + "}");
        Debug.Log("_G.d:add(1, 2)=" + d3.add(1, 2));

        LuaTable d4 = luaenv.Global.Get <LuaTable>("d");//映射到LuaTable,by ref

        Debug.Log("_G.d = {f1=" + d4.Get <int>("f1") + ", f2=" + d4.Get <int>("f2") + "}");


        //映射到一个delgate,要求delegate加到生成列表,否则返回null,建议用法
        Action e = luaenv.Global.Get <Action>("e");

        e();

        //带参数的f函数映射到Action中,可以映射成功,但是函数体内参数值传递进来为nil
        Action fA = luaenv.Global.Get <Action>("f");

        fA();

        FDelegate f = luaenv.Global.Get <FDelegate>("f");
        DClass    d_ret;
        int       f_ret = f(100, "John", out d_ret);//lua的多返回值映射:从左往右映射到c#的输出参数,输出参数包括返回值,out参数,ref参数

        Debug.Log("ret.d = {f1=" + d_ret.f1 + ", f2=" + d_ret.f2 + "}, ret=" + f_ret);

        GetE   ret_e = luaenv.Global.Get <GetE>("ret_e");//delegate可以返回更复杂的类型,甚至是另外一个delegate
        Action e2    = ret_e();

        e2();

        LuaFunction d_e = luaenv.Global.Get <LuaFunction>("e");

        d_e.Call();
    }
Exemplo n.º 13
0
        public static void Execute()
        {
            var orbMode = Orbwalker.ActiveModesFlags;

            if (orbMode.HasFlag(Orbwalker.ActiveModes.Combo))
            {
                if (GetE != null && GetE.CountEnemiesInRange(350) >= 1 && Player.GetSpell(SpellSlot.E).ToggleState >= 1)
                {
                    var enemy =
                        EntityManager.Heroes.Enemies.FirstOrDefault(
                            e => e.IsInRange(GetE, 320) && e.IsInAutoAttackRange(Player.Instance) && e.HasPassive());
                    if (enemy == null)
                    {
                        E.Cast(Player.Instance);
                    }
                }
            }

            if (orbMode.HasFlag(Orbwalker.ActiveModes.Harass))
            {
                if (GetE != null && GetE.CountEnemiesInRange(350) >= 1 && Player.GetSpell(SpellSlot.E).ToggleState >= 1)
                {
                    E.Cast(Player.Instance);
                }
            }

            if (orbMode.HasFlag(Orbwalker.ActiveModes.LaneClear))
            {
                LaneClear.Execute();
            }

            if (orbMode.HasFlag(Orbwalker.ActiveModes.LastHit))
            {
                LastHit.Execute();
            }

            if (KillStealMenu.GetCheckBoxValue("rUse"))
            {
                var target = TargetSelector.GetTarget(R.Range, DamageType.Magical);

                if (target == null)
                {
                    return;
                }

                if (R.IsReady())
                {
                    var passiveDamage = target.HasPassive() ? target.GetPassiveDamage() : 0f;
                    var rDamage       = target.GetDamage(SpellSlot.R) + passiveDamage;

                    var predictedHealth = Prediction.Health.GetPrediction(target, R.CastDelay + Game.Ping);

                    if (predictedHealth <= rDamage)
                    {
                        var pred = R.GetPrediction(target);
                        if (pred.HitChancePercent >= 90)
                        {
                            R.Cast(target);
                        }
                    }
                }
            }
        }