Beispiel #1
0
        public void CheckKs()
        {
            foreach (Obj_AI_Hero target in ObjectManager.Get <Obj_AI_Hero>().Where(x => Player.Distance(x) < 1300 && x.IsValidTarget() && x.IsEnemy && !x.IsDead))
            {
                if (target != null)
                {
                    if (DFG.IsReady() && Player.GetItemDamage(target, Damage.DamageItems.Dfg) > target.Health &&
                        Player.Distance(target.ServerPosition) <= 750)
                    {
                        Use_DFG(target);
                        return;
                    }

                    if (DFG.IsReady() && Player.Distance(target.ServerPosition) <= 750 && Q.IsReady() &&
                        (Player.GetItemDamage(target, Damage.DamageItems.Dfg) +
                         (Player.GetSpellDamage(target, SpellSlot.Q) + Player.GetSpellDamage(target, SpellSlot.Q, 1)) *
                         1.2) > target.Health)
                    {
                        Use_DFG(target);
                        Q.Cast(target, packets());
                        return;
                    }

                    if (DFG.IsReady() && Player.Distance(target.ServerPosition) <= 750 && W.IsReady() &&
                        (Player.GetItemDamage(target, Damage.DamageItems.Dfg) +
                         Player.GetSpellDamage(target, SpellSlot.W) * 1.2) > target.Health)
                    {
                        Use_DFG(target);
                        W.Cast();
                        return;
                    }

                    if (Player.Distance(target.ServerPosition) <= W.Range &&
                        (Player.GetSpellDamage(target, SpellSlot.Q) + Player.GetSpellDamage(target, SpellSlot.Q, 1) +
                         Player.GetSpellDamage(target, SpellSlot.W)) > target.Health && Q.IsReady() && Q.IsReady())
                    {
                        Q.Cast(target, packets());
                        return;
                    }

                    if (Player.Distance(target.ServerPosition) <= Q.Range &&
                        (Player.GetSpellDamage(target, SpellSlot.Q) + Player.GetSpellDamage(target, SpellSlot.Q, 1)) >
                        target.Health && Q.IsReady())
                    {
                        Q.Cast(target, packets());
                        return;
                    }

                    if (Player.Distance(target.ServerPosition) <= E.Range &&
                        (Player.GetSpellDamage(target, SpellSlot.E)) > target.Health & E.IsReady())
                    {
                        E.Cast(target, packets());
                        return;
                    }

                    if (Player.Distance(target.ServerPosition) <= W.Range &&
                        (Player.GetSpellDamage(target, SpellSlot.W)) > target.Health && W.IsReady())
                    {
                        W.Cast();
                        return;
                    }

                    Vector3 dashVector = Player.Position +
                                         Vector3.Normalize(target.ServerPosition - Player.Position) * 425;
                    if (Player.Distance(target.ServerPosition) <= R.Range &&
                        (Player.GetSpellDamage(target, SpellSlot.R)) > target.Health && R.IsReady() && _rOn &&
                        target.Distance(dashVector) < 425 && R.IsReady())
                    {
                        R.Cast(dashVector, packets());
                    }

                    //ignite
                    if (menu.Item("ignite").GetValue <bool>() && IgniteSlot != SpellSlot.Unknown &&
                        Player.SummonerSpellbook.CanUseSpell(IgniteSlot) == SpellState.Ready &&
                        Player.Distance(target.ServerPosition) <= 600)
                    {
                        if (Player.GetSummonerSpellDamage(target, Damage.SummonerSpell.Ignite) > target.Health + 20)
                        {
                            Use_Ignite(target);
                        }
                    }
                }
            }
        }
Beispiel #2
0
        private void UseSpells(bool useQ, bool useW, bool useE, bool useR, string source)
        {
            var         range   = Q.Range;
            Obj_AI_Hero eTarget = SimpleTs.GetTarget(range, SimpleTs.DamageType.Magical);


            if (GetTargetFocus(range) != null)
            {
                eTarget = GetTargetFocus(range);
            }

            Obj_AI_Hero rETarget = SimpleTs.GetTarget(E.Range, SimpleTs.DamageType.Magical);

            int igniteMode;

            igniteMode = menu.Item("igniteMode").GetValue <StringList>().SelectedIndex;

            var hitC    = GetHitchance(source);
            var dmg     = GetComboDamage(eTarget);
            var predOff = menu.Item("Prediction_Check_Off").GetValue <bool>();

            //DFG
            if (eTarget != null && dmg > eTarget.Health - 300 && DFG.IsReady() && source == "Combo" && Player.Distance(eTarget) <= 750 &&
                (eTarget.HasBuffOfType(BuffType.Charm) || !menu.Item("dfgCharm").GetValue <bool>()))
            {
                Use_DFG(eTarget);
            }

            //E
            if (useE && eTarget != null && E.IsReady() && Player.Distance(eTarget) < E.Range)
            {
                if (E.GetPrediction(eTarget).Hitchance >= hitC || predOff)
                {
                    E.Cast(eTarget, packets());
                    if (menu.Item("EQ").GetValue <bool>() && Q.IsReady())
                    {
                        Q.Cast(eTarget, packets());
                    }
                    return;
                }
            }

            //Ignite
            if (eTarget != null && Ignite_Ready() && !E.IsReady() && source == "Combo")
            {
                if (igniteMode == 0 && dmg > eTarget.Health)
                {
                    Use_Ignite(eTarget);
                }
            }

            //W
            if (useW && eTarget != null && W.IsReady() && Player.Distance(eTarget) <= W.Range - 100 &&
                ShouldW(eTarget, source))
            {
                W.Cast();
            }

            if (source == "Harass" && menu.Item("longQ").GetValue <bool>())
            {
                if (useQ && Q.IsReady() && Player.Distance(eTarget) <= Q.Range && eTarget != null &&
                    ShouldQ(eTarget, source) && Player.Distance(eTarget) > 600)
                {
                    if (Q.GetPrediction(eTarget).Hitchance >= hitC || predOff)
                    {
                        Q.Cast(eTarget, packets(), true);
                        return;
                    }
                }
            }
            else if (useQ && Q.IsReady() && Player.Distance(eTarget) <= Q.Range && eTarget != null &&
                     ShouldQ(eTarget, source))
            {
                if (Q.GetPrediction(eTarget).Hitchance >= hitC || predOff)
                {
                    Q.Cast(eTarget, packets(), true);
                    return;
                }
            }

            //R
            if (useR && eTarget != null && R.IsReady() && Player.Distance(eTarget) < R.Range)
            {
                if (E.IsReady())
                {
                    if (CheckReq(rETarget))
                    {
                        E.Cast(rETarget, packets());
                    }
                }
                if (ShouldR(eTarget) && R.IsReady())
                {
                    R.Cast(Game.CursorPos, packets());
                    _rTimer = Environment.TickCount - 250;
                }
                if (_rTimeLeft > 9500 && _rOn && R.IsReady())
                {
                    R.Cast(Game.CursorPos, packets());
                    _rTimer = Environment.TickCount - 250;
                }
            }
        }
Beispiel #3
0
        public static Block ParseBlock(XmlNode node, DFG <Block> dfg, ParserInfo parserInfo, bool allowDeclarationBlocks = false, bool canBeScheduled = true)
        {
            string id        = node.GetAttributeValue(Block.ID_FIELD_NAME);
            string blockType = node.GetAttributeValue(Block.TYPE_FIELD_NAME);

            switch (blockType)
            {
            case ArithOP.XML_TYPE_NAME:
                return(ArithOP.Parse(node, dfg, parserInfo, canBeScheduled));

            case Constant.XML_TYPE_NAME:
                return(Constant.Parse(node, parserInfo, canBeScheduled));

            case FluidArray.XML_TYPE_NAME:
                return(FluidArray.Parse(node, dfg, parserInfo));

            case SetArrayFluid.XML_TYPE_NAME:
                return(SetArrayFluid.Parse(node, dfg, parserInfo));

            case Fluid.XML_TYPE_NAME:
                return(Fluid.Parse(node, dfg, parserInfo));

            case InputDeclaration.XML_TYPE_NAME:
                if (!allowDeclarationBlocks)
                {
                    parserInfo.ParseExceptions.Add(new ParseException(id, "Declaration blocks has to be at the top of the program."));
                }
                return(InputDeclaration.Parse(node, parserInfo));

            case OutputDeclaration.XML_TYPE_NAME:
                if (!allowDeclarationBlocks)
                {
                    parserInfo.ParseExceptions.Add(new ParseException(id, "Declaration blocks has to be at the top of the program."));
                }
                return(OutputDeclaration.Parse(node, parserInfo));

            case WasteDeclaration.XML_TYPE_NAME:
                if (!allowDeclarationBlocks)
                {
                    parserInfo.ParseExceptions.Add(new ParseException(id, "Declaration blocks has to be at the top of the program."));
                }
                return(WasteDeclaration.Parse(node, parserInfo));

            case HeaterDeclaration.XML_TYPE_NAME:
                if (!allowDeclarationBlocks)
                {
                    parserInfo.ParseExceptions.Add(new ParseException(id, "Declaration blocks has to be at the top of the program."));
                }
                return(HeaterDeclaration.Parse(node, parserInfo));

            case OutputUsage.XML_TYPE_NAME:
                return(OutputUsage.Parse(node, dfg, parserInfo));

            case WasteUsage.XML_TYPE_NAME:
                return(WasteUsage.Parse(node, dfg, parserInfo));

            case DropletDeclaration.XML_TYPE_NAME:
                return(DropletDeclaration.Parse(node, parserInfo));

            case BoolOP.XML_TYPE_NAME:
                return(BoolOP.Parse(node, dfg, parserInfo, canBeScheduled));

            //case Sensor.XmlTypeName:
            //    return Sensor.Parse(node);
            case GetNumberVariable.XML_TYPE_NAME:
                return(GetNumberVariable.Parse(node, parserInfo, canBeScheduled));

            case SetNumberVariable.XML_TYPE_NAME:
                return(SetNumberVariable.Parse(node, dfg, parserInfo));

            case GetDropletCount.XML_TYPE_NAME:
                return(GetDropletCount.Parser(node, parserInfo, canBeScheduled));

            case GetArrayLength.XML_TYPE_NAME:
                return(GetArrayLength.Parse(node, parserInfo, canBeScheduled));

            case ImportVariable.XML_TYPE_NAME:
                return(ImportVariable.Parse(node, parserInfo, canBeScheduled));

            case NumberArray.XML_TYPE_NAME:
                return(NumberArray.Parse(node, dfg, parserInfo));

            case GetArrayNumber.XML_TYPE_NAME:
                return(GetArrayNumber.Parse(node, dfg, parserInfo, canBeScheduled));

            case SetArrayNumber.XML_TYPE_NAME:
                return(SetArrayNumber.Parse(node, dfg, parserInfo, canBeScheduled));

            case RoundOP.XML_TYPE_NAME:
                return(RoundOP.Parse(node, dfg, parserInfo, canBeScheduled));

            default:
                throw new UnknownBlockException(id);
            }
        }
Beispiel #4
0
        private float GetComboDamage(Obj_AI_Base enemy)
        {
            double damage = 0d;

            if (Q.IsReady())
            {
                damage += Player.GetSpellDamage(enemy, SpellSlot.Q);
                damage += Player.GetSpellDamage(enemy, SpellSlot.Q, 1);
            }

            if (DFG.IsReady())
            {
                damage += Player.GetItemDamage(enemy, Damage.DamageItems.Dfg) / 1.2;
            }

            if (W.IsReady())
            {
                damage += Player.GetSpellDamage(enemy, SpellSlot.W);
            }

            if (_rOn)
            {
                damage += Player.GetSpellDamage(enemy, SpellSlot.R) * RCount();
            }
            else if (R.IsReady())
            {
                damage += Player.GetSpellDamage(enemy, SpellSlot.R) * 3;
            }

            if (DFG.IsReady() && E.IsReady())
            {
                damage = damage * 1.44;
            }
            else if (DFG.IsReady() && enemy.HasBuffOfType(BuffType.Charm))
            {
                damage = damage * 1.44;
            }
            else if (E.IsReady())
            {
                damage = damage * 1.2;
            }
            else if (DFG.IsReady())
            {
                damage = damage * 1.2;
            }
            else if (enemy.HasBuffOfType(BuffType.Charm))
            {
                damage = damage * 1.2;
            }

            if (Ignite_Ready())
            {
                damage += Player.GetSummonerSpellDamage(enemy, Damage.SummonerSpell.Ignite);
            }

            if (E.IsReady())
            {
                damage += Player.GetSpellDamage(enemy, SpellSlot.E);
            }

            return((float)damage);
        }
Beispiel #5
0
        private static void Combo()
        {
            var target = SimpleTs.GetTarget(Q.Range, SimpleTs.DamageType.Magical);

            Orbwalker.SetAttack((!Q.IsReady() || W.IsReady()));

            if (target != null)
            {
                if (IsHuman && Player.Distance(target) <= Q.Range && Config.Item("UseQCombo").GetValue <bool>() && Q.IsReady())
                {
                    Q.Cast(target, false);
                }
                if (IsHuman && Player.Distance(target) <= W.Range && Config.Item("UseWCombo").GetValue <bool>() && W.IsReady())
                {
                    W.Cast(target);
                }

                if (IsHuman && Config.Item("UseRCombo").GetValue <bool>() && Player.Distance(target) <= 625 && R.IsReady())
                {
                    if (IsHuman)
                    {
                        R.Cast();
                    }

                    if (IsCougar)
                    {
                        if (Config.Item("UseWComboCougar").GetValue <bool>() && Player.Distance(target) <= WC.Range)
                        {
                            WC.Cast(target);
                        }
                        if (Config.Item("UseEComboCougar").GetValue <bool>() && Player.Distance(target) <= EC.Range)
                        {
                            EC.Cast(target);
                        }
                        if (Config.Item("UseQComboCougar").GetValue <bool>() && Player.Distance(target) <= Q.Range)
                        {
                            Orbwalker.SetAttack(true);
                            QC.Cast(target);
                        }
                    }
                }

                if (IsCougar && Player.Distance(target) < 625)
                {
                    if (IsHuman)
                    {
                        R.Cast();
                    }

                    if (IsCougar)
                    {
                        if (Config.Item("UseWComboCougar").GetValue <bool>() && Player.Distance(target) <= WC.Range)
                        {
                            WC.Cast(target);
                        }
                        if (Config.Item("UseEComboCougar").GetValue <bool>() && Player.Distance(target) <= EC.Range)
                        {
                            EC.Cast(target);
                        }
                        if (Config.Item("UseQComboCougar").GetValue <bool>() && Player.Distance(target) <= Q.Range)
                        {
                            Orbwalker.SetAttack(true);
                            QC.Cast(target);
                        }
                    }
                }

                if (IsCougar && Config.Item("UseRCombo").GetValue <bool>() && Player.Distance(target) > WC.Range)
                {
                    R.Cast();
                }
                if (IsCougar && Player.Distance(target) > EC.Range && Config.Item("UseRCombo").GetValue <bool>())
                {
                    R.Cast();
                }

                if (Config.Item("UseItems").GetValue <bool>())
                {
                    BKR.Cast(target);
                    YOU.Cast();
                    BWC.Cast(target);
                    DFG.Cast(target);
                    SOD.Cast();
                    FQM.Cast(target);
                }
            }
        }