Пример #1
0
        private static void OnDraw(EventArgs args)
        {
            if (!Game.IsInGame)
            {
                return;
            }

            if (LucieHero.Living.IsDead)
            {
                return;
            }

            Drawing.DrawString(new Vector2(1920f / 2f, 1080f / 2f - 5f).ScreenToWorld(),
                               "Targeting mode: " + (KeysMenu.GetKeybind("keys.changeTargeting") ? "LowestHealth" : "NearMouse"), UnityEngine.Color.yellow);

            if (DrawingsMenu.GetBoolean("draw.healSafeRange"))
            {
                var allyTargets = EntitiesManager.LocalTeam.Where(x => !x.Living.IsDead);

                foreach (var ally in allyTargets)
                {
                    Drawing.DrawCircle(ally.MapObject.Position, HealMenu.GetSlider("heal.allySafeRange"), UnityEngine.Color.green);
                }
            }

            if (DrawingsMenu.GetBoolean("draw.rangeR.safeRange"))
            {
                var rSafeRange = ComboMenu.GetSlider("combo.useR.safeRange");

                Drawing.DrawCircle(MyPos, rSafeRange, UnityEngine.Color.magenta);
            }
        }
Пример #2
0
        private static void HealTeammate()
        {
            var minAllyHp      = HealMenu.GetSlider("heal.minHpOther");
            var energyRequired = HealMenu.GetIntSlider("heal.minEnergyBars") * 25;

            var possibleAllies = EntitiesManager.LocalTeam.Where(x => !x.IsLocalPlayer && !x.Living.IsDead && !x.PhysicsCollision.IsImmaterial &&
                                                                 x.Living.HealthPercent <= minAllyHp);

            var allyToTarget = TargetSelector.GetTarget(possibleAllies, TargetingMode.NearMouse, TrueERange);

            var isCastingOrChanneling = KaanHero.AbilitySystem.IsCasting || KaanHero.IsChanneling || KaanHero.HasBuff("ConsumeBuff") || KaanHero.HasBuff("ReapingScytheBuff");

            if (isCastingOrChanneling && LastAbilityFired == null)
            {
                LastAbilityFired = CastingIndexToSlot(KaanHero.AbilitySystem.CastingAbilityIndex);
            }

            var myPos = KaanHero.MapObject.Position;

            if (isCastingOrChanneling)
            {
                LocalPlayer.EditAimPosition = true;

                switch (LastAbilityFired)
                {
                case AbilitySlot.EXAbility2:
                    if (allyToTarget != null)
                    {
                        var pred = TestPrediction.GetNormalLinePrediction(myPos, allyToTarget, TrueERange, ESpeed, ERadius, true);
                        if (pred.CanHit)
                        {
                            LocalPlayer.Aim(pred.CastPosition);
                        }
                    }
                    break;
                }
            }
            else
            {
                LocalPlayer.EditAimPosition = false;
                LastAbilityFired            = null;
            }

            if (MiscUtils.CanCast(AbilitySlot.EXAbility2))
            {
                if (energyRequired <= KaanHero.Energized.Energy)
                {
                    if (LastAbilityFired == null && allyToTarget != null)
                    {
                        var pred = TestPrediction.GetNormalLinePrediction(myPos, allyToTarget, TrueERange, ESpeed, ERadius, true);
                        if (pred.CanHit)
                        {
                            LocalPlayer.PressAbility(AbilitySlot.EXAbility2, true);
                            LocalPlayer.EditAimPosition = true;
                            LocalPlayer.Aim(pred.CastPosition);
                        }
                    }
                }
            }
        }
Пример #3
0
        private static void HealSelf()
        {
            var useM2       = HealMenu.GetBoolean("heal.useM2");
            var useM2FullHP = HealMenu.GetBoolean("heal.useM2.fullHP");
            var useSpace    = HealMenu.GetBoolean("heal.useSpace");
            var safeRange   = HealMenu.GetSlider("heal.allySafeRange");

            var shouldM2    = useM2 && (useM2FullHP || LucieHero.Living.Health < LucieHero.Living.MaxRecoveryHealth);
            var shouldSpace = useSpace && LucieHero.EnemiesAroundAlive(safeRange) > 0;

            var isCastingOrChanneling = LucieHero.AbilitySystem.IsCasting || LucieHero.IsChanneling;

            if (isCastingOrChanneling && LastAbilityFired == null)
            {
                LastAbilityFired = CastingIndexToSlot(LucieHero.AbilitySystem.CastingAbilityIndex);
            }

            if (isCastingOrChanneling)
            {
                LocalPlayer.EditAimPosition = true;

                switch (LastAbilityFired)
                {
                case AbilitySlot.Ability3:
                case AbilitySlot.Ability2:
                    LocalPlayer.Aim(LucieHero.MapObject.Position);
                    break;
                }
            }
            else
            {
                LocalPlayer.EditAimPosition = false;
                LastAbilityFired            = null;
            }

            if (shouldSpace && MiscUtils.CanCast(AbilitySlot.Ability3) && LastAbilityFired == null)
            {
                LocalPlayer.PressAbility(AbilitySlot.Ability3, true);
            }

            if (shouldM2 && MiscUtils.CanCast(AbilitySlot.Ability2) && LastAbilityFired == null)
            {
                LocalPlayer.PressAbility(AbilitySlot.Ability2, true);
            }
        }
Пример #4
0
        private static void HealOthers()
        {
            var useM2        = HealMenu.GetBoolean("heal.useM2");
            var useM2FullHP  = HealMenu.GetBoolean("heal.useM2.fullHP");
            var useSpace     = HealMenu.GetBoolean("heal.useSpace");
            var useSpaceMode = HealMenu.GetComboBox("heal.useSpace.mode");
            var useQ         = HealMenu.GetBoolean("heal.useQ");
            var safeRange    = HealMenu.GetSlider("heal.allySafeRange");

            var possibleAllies = EntitiesManager.LocalTeam.Where(x => !x.IsLocalPlayer &&
                                                                 !x.Living.IsDead && !x.PhysicsCollision.IsImmaterial);

            var allySpace = useSpaceMode == 0
                ? possibleAllies.Where(x => x.EnemiesAroundAlive(safeRange) > 0)
                            .OrderByDescending(x => x.EnemiesAroundAlive(safeRange))
                            .ThenBy(x => x.MapObject.ScreenPosition.Distance(InputManager.MousePosition)).FirstOrDefault()

                : possibleAllies.Where(x => x.EnemiesAroundAlive(safeRange) > 0)
                            .OrderBy(x => x.MapObject.ScreenPosition.Distance(InputManager.MousePosition))
                            .ThenBy(x => x.EnemiesAroundAlive(safeRange)).FirstOrDefault();

            if (!useM2FullHP)
            {
                possibleAllies = possibleAllies.Where(x => x.Living.Health < x.Living.MaxRecoveryHealth);
            }

            var allyM2 = TargetSelector.GetTarget(possibleAllies, TargetingMode.NearMouse, M2Range);

            var isCastingOrChanneling = LucieHero.AbilitySystem.IsCasting || LucieHero.IsChanneling;

            if (isCastingOrChanneling && LastAbilityFired == null)
            {
                LastAbilityFired = CastingIndexToSlot(LucieHero.AbilitySystem.CastingAbilityIndex);
            }

            if (isCastingOrChanneling)
            {
                LocalPlayer.EditAimPosition = true;

                switch (LastAbilityFired)
                {
                case AbilitySlot.Ability3:
                    if (allySpace != null)
                    {
                        LocalPlayer.Aim(allySpace.MapObject.Position);
                    }
                    break;

                case AbilitySlot.Ability2:
                    if (allyM2 != null)
                    {
                        var pred = TestPrediction.GetNormalLinePrediction(MyPos, allyM2, M2Range, M2Speed, M2Radius, true);
                        if (pred.CanHit)
                        {
                            LocalPlayer.Aim(pred.CastPosition);
                        }
                    }
                    else
                    {
                        LocalPlayer.PressAbility(AbilitySlot.Interrupt, true);
                    }
                    break;
                }
            }
            else
            {
                LocalPlayer.EditAimPosition = false;
                LastAbilityFired            = null;
            }

            if (useSpace && MiscUtils.CanCast(AbilitySlot.Ability3))
            {
                if (LastAbilityFired == null && allySpace != null)
                {
                    LocalPlayer.PressAbility(AbilitySlot.Ability3, true);
                    LocalPlayer.EditAimPosition = true;
                    LocalPlayer.Aim(allySpace.MapObject.Position);
                    return;
                }
            }

            if (useM2 && MiscUtils.CanCast(AbilitySlot.Ability2))
            {
                if (LastAbilityFired == null && allyM2 != null)
                {
                    var pred = TestPrediction.GetNormalLinePrediction(MyPos, allyM2, M2Range, M2Speed, M2Radius, true);
                    if (pred.CanHit)
                    {
                        LocalPlayer.PressAbility(AbilitySlot.Ability2, true);
                        LocalPlayer.EditAimPosition = true;
                        LocalPlayer.Aim(pred.CastPosition);
                    }
                    return;
                }
            }
        }
Пример #5
0
        private static void HealOthers()
        {
            var possibleAllies = EntitiesManager.LocalTeam.Where(x => !x.IsLocalPlayer && !x.Living.IsDead);

            //var allyToHealM1 = possibleAllies.Where(x => x.Distance(ZanderHero) < M1Range)
            //    .OrderBy(x => x.Living.Health)
            //    .FirstOrDefault(x => x.Living.Health < x.Living.MaxRecoveryHealth);

            var allyToHealEX1 = possibleAllies.Where(x => x.Distance(ZanderHero) < EX1Range)
                                .OrderBy(x => x.Living.Health)
                                .FirstOrDefault(x => x.HasHardCC() && x.EnemiesAroundAlive(5f) > 0);

            var nearMouseAllyZander = TargetSelector.GetAlly(TargetingMode.NearMouse, M1Range);
            var nearMouseAllySpace  = SpaceClone == null ? null : TargetSelector.GetAlly(TargetingMode.NearMouse, M1Range, SpaceClone.Get <MapGameObject>().Position);
            var nearMouseAllyEX2    = EX2Clone == null ? null : TargetSelector.GetAlly(TargetingMode.NearMouse, M1Range, EX2Clone.Get <MapGameObject>().Position);
            var nearMouseAllyUlti   = UltiClone == null ? null : TargetSelector.GetAlly(TargetingMode.NearMouse, M1Range, UltiClone.Get <MapGameObject>().Position);

            var isCastingOrChanneling = ZanderHero.AbilitySystem.IsCasting || ZanderHero.IsChanneling;

            if (isCastingOrChanneling && LastAbilityFired == null)
            {
                LastAbilityFired = CastingIndexToSlot(ZanderHero.AbilitySystem.CastingAbilityIndex);
            }

            var myPos = ZanderHero.MapObject.Position;

            if (isCastingOrChanneling)
            {
                LocalPlayer.EditAimPosition = true;
                switch (LastAbilityFired)
                {
                case AbilitySlot.Ability1:
                    if (nearMouseAllyZander != null)
                    {
                        var pred = TestPrediction.GetNormalLinePrediction(myPos, nearMouseAllyZander, M1Range, M1Speed, M1Radius, true);
                        if (pred.CanHit)
                        {
                            LocalPlayer.Aim(pred.CastPosition);
                        }
                        else
                        {
                            LocalPlayer.PressAbility(AbilitySlot.Interrupt, true);
                        }
                    }
                    else if (nearMouseAllyUlti != null)
                    {
                        var pred = TestPrediction.GetNormalLinePrediction(UltiClone.Get <MapGameObject>().Position, nearMouseAllyUlti, M1Range, M1Speed, M1Radius, true);
                        if (pred.CanHit)
                        {
                            LocalPlayer.Aim(pred.CastPosition);
                        }
                        else
                        {
                            LocalPlayer.PressAbility(AbilitySlot.Interrupt, true);
                        }
                    }
                    else if (nearMouseAllySpace != null)
                    {
                        var pred = TestPrediction.GetNormalLinePrediction(SpaceClone.Get <MapGameObject>().Position, nearMouseAllySpace, M1Range, M1Speed, M1Radius, true);
                        if (pred.CanHit)
                        {
                            LocalPlayer.Aim(pred.CastPosition);
                        }
                        else
                        {
                            LocalPlayer.PressAbility(AbilitySlot.Interrupt, true);
                        }
                    }
                    else if (nearMouseAllyEX2 != null)
                    {
                        var pred = TestPrediction.GetNormalLinePrediction(EX2Clone.Get <MapGameObject>().Position, nearMouseAllyEX2, M1Range, M1Speed, M1Radius, true);
                        if (pred.CanHit)
                        {
                            LocalPlayer.Aim(pred.CastPosition);
                        }
                        else
                        {
                            LocalPlayer.PressAbility(AbilitySlot.Interrupt, true);
                        }
                    }
                    break;

                case AbilitySlot.EXAbility1:
                    if (allyToHealEX1 != null)
                    {
                        var pred = TestPrediction.GetPrediction(myPos, allyToHealEX1, EX1Range, 0f, EX1Radius, EX1AirTime);
                        if (pred.CanHit)
                        {
                            LocalPlayer.Aim(pred.CastPosition);
                        }
                    }
                    break;
                }
            }
            else
            {
                LocalPlayer.EditAimPosition = false;
                LastAbilityFired            = null;
            }

            if (HealMenu.GetBoolean("heal.useEX1.CC") && MiscUtils.CanCast(AbilitySlot.EXAbility1))
            {
                if (LastAbilityFired == null && allyToHealEX1 != null && allyToHealEX1.Living.HealthPercent <= HealMenu.GetSlider("heal.useEX1.CC.minHealth"))
                {
                    var pred = TestPrediction.GetPrediction(myPos, allyToHealEX1, EX1Range, 0f, EX1Radius, EX1AirTime);
                    if (pred.CanHit)
                    {
                        LocalPlayer.PressAbility(AbilitySlot.EXAbility1, true);
                    }
                }
            }

            if (HealMenu.GetBoolean("heal.useM1") && MiscUtils.CanCast(AbilitySlot.Ability1))
            {
                if (LastAbilityFired == null)
                {
                    if (nearMouseAllyUlti != null)
                    {
                        var pred = TestPrediction.GetNormalLinePrediction(UltiClone.Get <MapGameObject>().Position, nearMouseAllyUlti, M1Range, M1Speed, M1Radius, true);
                        if (pred.CanHit)
                        {
                            LocalPlayer.PressAbility(AbilitySlot.Ability1, true);
                        }
                    }
                    else if (nearMouseAllyZander != null)
                    {
                        var pred = TestPrediction.GetNormalLinePrediction(myPos, nearMouseAllyZander, M1Range, M1Speed, M1Radius, true);
                        if (pred.CanHit)
                        {
                            LocalPlayer.PressAbility(AbilitySlot.Ability1, true);
                        }
                    }
                    else if (nearMouseAllySpace != null)
                    {
                        var pred = TestPrediction.GetNormalLinePrediction(SpaceClone.Get <MapGameObject>().Position, nearMouseAllySpace, M1Range, M1Speed, M1Radius, true);
                        if (pred.CanHit)
                        {
                            LocalPlayer.PressAbility(AbilitySlot.Ability1, true);
                        }
                    }
                    else if (nearMouseAllyEX2 != null)
                    {
                        var pred = TestPrediction.GetNormalLinePrediction(EX2Clone.Get <MapGameObject>().Position, nearMouseAllyEX2, M1Range, M1Speed, M1Radius, true);
                        if (pred.CanHit)
                        {
                            LocalPlayer.PressAbility(AbilitySlot.Ability1, true);
                        }
                    }
                }
            }
        }