Beispiel #1
0
        private void OnUpdateFunctions()
        {
            if (MenuHelper.getKeybindValue("dzaio.caitlyn.dashtomouse"))
            {
                if (_spells[SpellSlot.E].IsReady())
                {
                    _spells[SpellSlot.E].Cast(WhereToEForPosition(Game.CursorPos));
                }
            }

            if (MenuHelper.getKeybindValue("dzaio.caitlyn.manualr"))
            {
                var rTarget = TargetSelector.GetTarget(_spells[SpellSlot.R].Range, TargetSelector.DamageType.Physical);
                if (_spells[SpellSlot.R].IsEnabledAndReady(Mode.Combo))
                {
                    if (HeroHelper.IsSafePosition(ObjectManager.Player.ServerPosition) && _spells[SpellSlot.R].GetDamage(rTarget) >= rTarget.Health + 25 &&
                        rTarget.CountEnemiesInRange(800f) <= 2 && rTarget.CountAlliesInRange(600f) < 3 && rTarget.Distance(ObjectManager.Player) >= ObjectManager.Player.AttackRange)
                    {
                        _spells[SpellSlot.R].CastOnUnit(rTarget);
                    }
                }
            }

            if (MenuHelper.getKeybindValue("dzaio.caitlyn.eq"))
            {
                var eqTarget = TargetSelector.GetTarget(_spells[SpellSlot.Q].Range + 505f, TargetSelector.DamageType.Physical);

                if (_spells[SpellSlot.E].IsReady() && _spells[SpellSlot.Q].IsReady() && eqTarget.IsValidTarget() && eqTarget.Distance(ObjectManager.Player) >= Orbwalking.GetRealAutoAttackRange(null))
                {
                    var afterEPosition = GetPositionAfterE(WhereToEForPosition(eqTarget.ServerPosition));
                    if (!CaitlynIsSafePosition(afterEPosition))
                    {
                        return;
                    }
                    var delay = (int)Math.Ceiling(ObjectManager.Player.Distance(afterEPosition) / _spells[SpellSlot.E].Speed * 1000 + 100);
                    //var delayPrediction = Prediction.GetPrediction(eqTarget, delay);
                    //E Q
                    PredictionOutput customPrediction = PredictionHelper.GetP(afterEPosition, _spells[SpellSlot.Q], eqTarget, false);
                    if (_spells[SpellSlot.Q].IsKillable(eqTarget) && _spells[SpellSlot.Q].IsReady() &&
                        afterEPosition.Distance(eqTarget.ServerPosition) <= _spells[SpellSlot.Q].Range &&
                        !(afterEPosition.Distance(eqTarget.ServerPosition) <= Orbwalking.GetRealAutoAttackRange(null) &&
                          ObjectManager.Player.GetAutoAttackDamage(eqTarget) >= eqTarget.Health + 20))
                    {
                        _spells[SpellSlot.E].Cast(WhereToEForPosition(eqTarget.ServerPosition));
                        LeagueSharp.Common.Utility.DelayAction.Add(delay, () => _spells[SpellSlot.Q].Cast(customPrediction.CastPosition));
                    }
                }
            }
        }
Beispiel #2
0
        private void Combo()
        {
            var comboTarget = TargetSelector.GetTarget(_spells[SpellSlot.Q].Range, TargetSelector.DamageType.Physical);
            var eqTarget    = TargetSelector.GetTarget(_spells[SpellSlot.Q].Range + 505f, TargetSelector.DamageType.Physical);
            var rTarget     = TargetSelector.GetTarget(_spells[SpellSlot.R].Range, TargetSelector.DamageType.Physical);

            if (_spells[SpellSlot.Q].IsEnabledAndReady(Mode.Combo) && comboTarget.IsValidTarget(_spells[SpellSlot.Q].Range))
            {
                if (MenuHelper.isMenuEnabled("dzaio.caitlyin.combo.skilloptions.impq"))
                {
                    if (HeroHelper.IsEmpaired(comboTarget))
                    {
                        _spells[SpellSlot.Q].CastIfHitchanceEquals(comboTarget, MenuHelper.GetHitchance());
                    }
                }
                else
                {
                    _spells[SpellSlot.Q].CastIfHitchanceEquals(comboTarget, MenuHelper.GetHitchance());
                }
            }

            if (_spells[SpellSlot.W].IsEnabledAndReady(Mode.Combo) && comboTarget.IsValidTarget(_spells[SpellSlot.W].Range) &&
                (HeroHelper.IsEmpaired(comboTarget) || comboTarget.IsRecalling()))
            {
                _spells[SpellSlot.W].CastIfHitchanceEquals(comboTarget, MenuHelper.GetHitchance());
            }

            if (_spells[SpellSlot.R].IsEnabledAndReady(Mode.Combo))
            {
                if (HeroHelper.IsSafePosition(ObjectManager.Player.ServerPosition) && _spells[SpellSlot.R].GetDamage(rTarget) >= rTarget.Health + 25 &&
                    rTarget.CountEnemiesInRange(800f) <= 2 && rTarget.CountAlliesInRange(600f) < 3 && rTarget.Distance(ObjectManager.Player) >= ObjectManager.Player.AttackRange)
                {
                    _spells[SpellSlot.R].CastOnUnit(rTarget);
                }
            }

            #region E Combos
            if (_spells[SpellSlot.E].IsEnabledAndReady(Mode.Combo) && !_spells[SpellSlot.R].IsEnabledAndReady(Mode.Combo) && eqTarget.IsValidTarget() && eqTarget.Distance(ObjectManager.Player) >= Orbwalking.GetRealAutoAttackRange(null))
            {
                var afterEPosition = GetPositionAfterE(WhereToEForPosition(eqTarget.ServerPosition));
                if (!CaitlynIsSafePosition(afterEPosition))
                {
                    return;
                }
                var delay = (int)Math.Ceiling(ObjectManager.Player.Distance(afterEPosition) / _spells[SpellSlot.E].Speed * 1000 + 100);
                //var delayPrediction = Prediction.GetPrediction(eqTarget, delay);
                //E AA
                if (afterEPosition.Distance(eqTarget.ServerPosition) <= Orbwalking.GetRealAutoAttackRange(null) - 50 && ObjectManager.Player.GetAutoAttackDamage(eqTarget) >= eqTarget.Health + 20)
                {
                    _spells[SpellSlot.E].Cast(WhereToEForPosition(eqTarget.ServerPosition));
                    LeagueSharp.Common.Utility.DelayAction.Add((int)(delay + Game.Ping / 2f), Orbwalking.ResetAutoAttackTimer);
                    _orbwalker.ForceTarget(eqTarget);
                    return;
                }
                //E Q
                PredictionOutput customPrediction = PredictionHelper.GetP(afterEPosition, _spells[SpellSlot.Q], eqTarget, false);
                if (_spells[SpellSlot.Q].IsKillable(eqTarget) && _spells[SpellSlot.Q].IsReady() &&
                    afterEPosition.Distance(eqTarget.ServerPosition) <= _spells[SpellSlot.Q].Range &&
                    !(afterEPosition.Distance(eqTarget.ServerPosition) <= Orbwalking.GetRealAutoAttackRange(null) &&
                      ObjectManager.Player.GetAutoAttackDamage(eqTarget) >= eqTarget.Health + 20))
                {
                    _spells[SpellSlot.E].Cast(WhereToEForPosition(eqTarget.ServerPosition));
                    LeagueSharp.Common.Utility.DelayAction.Add(delay, () => _spells[SpellSlot.Q].Cast(customPrediction.CastPosition));
                }
            }
            #endregion
        }