Exemple #1
0
        private static void OnDraw(EventArgs args)
        {
            if (_menu.SubMenu("Draw").Item("drawQ").GetValue <Circle>().Active)
            {
                Render.Circle.DrawCircle(Player.Position, _Q.Range,
                                         _menu.SubMenu("Draw").Item("drawQ").GetValue <Circle>().Color);
            }

            if (_menu.SubMenu("Draw").Item("drawW").GetValue <Circle>().Active)
            {
                Render.Circle.DrawCircle(Player.Position, _W.Range,
                                         _menu.SubMenu("Draw").Item("drawW").GetValue <Circle>().Color);
            }

            if (_menu.SubMenu("Draw").Item("drawE").GetValue <Circle>().Active)
            {
                Render.Circle.DrawCircle(Player.Position, _E.Range,
                                         _menu.SubMenu("Draw").Item("drawE").GetValue <Circle>().Color);
            }

            if (_menu.SubMenu("Draw").Item("drawR").GetValue <Circle>().Active)
            {
                Render.Circle.DrawCircle(Player.Position, _R.Range,
                                         _menu.SubMenu("Draw").Item("drawR").GetValue <Circle>().Color);
            }

            if (_menu.SubMenu("Draw").Item("drawTarget").GetValue <bool>() && _target != null && !_target.IsDead)
            {
                Render.Circle.DrawCircle(_target.Position, _target.BoundingRadius, Color.Red);
                Render.Circle.DrawCircle(_target.Position, _target.BoundingRadius + 10, Color.Red);
                Render.Circle.DrawCircle(_target.Position, _target.BoundingRadius + 25, Color.Red);
            }

            if (_menu.SubMenu("Draw").Item("drawInsec").GetValue <bool>() && _target != null && !_target.IsDead &&
                Hud.SelectedUnit != null && _target.NetworkId == Hud.SelectedUnit.NetworkId && _R.IsReady())
            {
                var insecPos = GetInsecPosition(_target);
                Render.Circle.DrawCircle(insecPos.To3D(), 40f, Color.Cyan);
                var dirPos = (_target.ServerPosition.To2D() - insecPos).Normalized();
                var endPos = _target.ServerPosition.To2D() + (dirPos * 1200);

                var wts1 = Drawing.WorldToScreen(insecPos.To3D());
                var wts2 = Drawing.WorldToScreen(endPos.To3D());

                Drawing.DrawLine(wts1, wts2, 2, Color.Cyan);
            }

            if (_menu.SubMenu("Draw").Item("drawCombo").GetValue <bool>())
            {
                foreach (var enemy in HeroManager.Enemies.Where(hero => hero.IsVisible && !hero.IsDead))
                {
                    var pos = enemy.HPBarPosition;
                    pos.Y += 35;
                    pos.X += 5;
                    var combo = ComboGenerator.GetKillCombo(enemy);
                    Drawing.DrawText(pos.X, pos.Y, combo != null ? Color.Green : Color.Red,
                                     combo != null ? ComboGenerator.ComboString(combo) : "Not Killable");
                }
            }
        }
Exemple #2
0
        private static bool KillCombo(AIHeroClient target)
        {
            var tmpCombo = ComboGenerator.GetKillCombo(target);

            if (tmpCombo != null && _killCombo == null)
            {
                _killCombo  = tmpCombo;
                _comboStep  = 0;
                _lastSpell  = null;
                _nextSpell  = _killCombo[_comboStep];
                inKillCombo = true;
                ComboGenerator.PrintCombo(_killCombo);
                return(true);
            }
            if (tmpCombo == null && inKillCombo && _killCombo != null && _comboStep == _killCombo.Count)
            {
                _killCombo  = null;
                _comboStep  = 0;
                _lastSpell  = null;
                _nextSpell  = null;
                inKillCombo = false;
                return(false);
            }

            if (_killCombo == null)
            {
                return(false);
            }

            if (_lastSpellCast + 250 > Utils.GameTimeTickCount)
            {
                return(true);
            }


            if (!_nextSpell.IsReady(1) && _nextSpell != _Q2)
            {
                return(false);
            }

            if (Player.Distance(target.ServerPosition) > _nextSpell.Range)
            {
                return(false);
            }

            if (target.IsDead)
            {
                return(false);
            }

            if (_nextSpell == _Q)
            {
                _lastSpellCast = Utils.GameTimeTickCount;
                CastQCombo(target);
            }
            else if (_nextSpell == _Q2)
            {
                _lastSpellCast = Utils.GameTimeTickCount;
                _Q2.CastOnUnit(target);
            }
            else if (_nextSpell == _E)
            {
                _lastSpellCast = Utils.GameTimeTickCount;
                _E.Cast();
            }
            else if (_nextSpell == _I)
            {
                _lastSpellCast = Utils.GameTimeTickCount;
                _I.CastOnUnit(target);
            }
            else if (_nextSpell == _R)
            {
                _lastSpellCast = Utils.GameTimeTickCount;
                _R.CastOnUnit(target);
            }

            return(true);
        }