예제 #1
0
        private static void AddNewHeal(Ability item)
        {
            if (NameManager.Name(item) != "item_soul_ring")
            {
                MyAbilities.DefensiveAbilities.Add(NameManager.Name(item) + "heal", item);
            }
            else if (Heals.HealsTogglerCreated &&
                     MainMenu.Menu.Item("healsToggler")
                     .GetValue <AbilityToggler>()
                     .Dictionary.ContainsKey(NameManager.Name(item)))
            {
                return;
            }

            if (!Heals.HealsTogglerCreated)
            {
                Heals.HealsTogglerCreated = true;
                MainMenu.Menu.AddItem(
                    new MenuItem("healsToggler", "Heals:").SetValue(new AbilityToggler(new Dictionary <string, bool>())));
                MainMenu.Menu.Item("healsToggler").GetValue <AbilityToggler>().Add(NameManager.Name(item));
                MainMenu.AbilitiesMenu.AddSubMenu(Heals.HealsMenu);
            }
            else
            {
                MainMenu.Menu.Item("healsToggler").GetValue <AbilityToggler>().Add(NameManager.Name(item));
            }

            var menu = HealMenu.Create(NameManager.Name(item));

            Heals.HealsMenuDictionary.Add(NameManager.Name(item), menu);
            Heals.HealsMenu.AddSubMenu(menu);
        }
예제 #2
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);
            }
        }
예제 #3
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);
                        }
                    }
                }
            }
        }
예제 #4
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);
            }
        }
예제 #5
0
        //-----------------//
        // Start Game-----//
        // Game On Start-//
        static void Game_OnStart(EventArgs args)
        {
            try
            {
                if (ChampionName != PlayerInstance.BaseSkinName)
                {
                    return;
                }

                Bootstrap.Init(null);

                Chat.Print("KKayle Addon Loading Success");
                Q           = new Spell.Targeted(SpellSlot.Q, 650);
                Q.CastDelay = 5;
                W           = new Spell.Targeted(SpellSlot.W, 900);
                E           = new Spell.Active(SpellSlot.E, 650);
                R           = new Spell.Targeted(SpellSlot.R, 900);
                if (Spell1("ignite"))
                {
                    Ignite = new Spell.Targeted(ObjectManager.Player.GetSpellSlotFromName("summonerdot"), 600);
                }

                Menu = MainMenu.AddMenu("KKayle", "kayle");
                Menu.AddSeparator();
                Menu.AddLabel("Criado por Bruno105");
                // Combo Menu
                ComboMenu = Menu.AddSubMenu("Combo", "ComboKayle");
                ComboMenu.Add("ComboW", new CheckBox("W Kullan", true));
                ComboMenu.Add("useIgnite", new CheckBox("Tutuştur Kullan", false));

                // Harass Menu
                HarassMenu = Menu.AddSubMenu("Harass", "HarassKayle");
                HarassMenu.Add("HarassQ", new CheckBox("Q Kullan", true));
                HarassMenu.Add("HarassW", new CheckBox("W Kullan", false));
                HarassMenu.Add("HarassE", new CheckBox("E Kullan", true));
                HarassMenu.Add("ManaH", new Slider("Manam şundan azsa kullanma  <=", 30));

                //Farm Menu
                FarmMenu = Menu.AddSubMenu("Farm", "FarmKayle");
                FarmMenu.Add("ManaF", new Slider("Manam şundan azsa büyü kullanma  <=", 40));
                FarmMenu.Add("FarmQ", new CheckBox("Q Kullan", true));
                FarmMenu.Add("FarmE", new CheckBox("E KUllan", true));
                FarmMenu.Add("MinionE", new Slider("E için gereken minyon sayısı >=", 3, 1, 5));
                FarmMenu.AddSeparator();
                FarmMenu.AddLabel("Last Hit");
                FarmMenu.Add("LastQ", new CheckBox("Q ile son vuruş", true));
                // FarmMenu.Add("LastE", new CheckBox("Use E to Last Hit", true));


                // Heal Menu
                var allies = EntityManager.Heroes.Allies.Where(a => !a.IsMe).OrderBy(a => a.BaseSkinName);
                HealMenu = Menu.AddSubMenu("Heal", "HealKayle");
                HealMenu.Add("autoW", new CheckBox("W otomatik kullan", true));
                HealMenu.Add("HealSelf", new Slider("W kendine kullan % HP", 50));
                HealMenu.Add("HealAlly", new Slider("Dostlara Kullan % HP", 50));
                foreach (var a in allies)
                {
                    HealMenu.Add("autoHeal_" + a.BaseSkinName, new CheckBox("Dostlara can  " + a.BaseSkinName));
                }


                //--------------//
                //---Ultmate---//
                //------------//

                var ally = EntityManager.Heroes.Allies.Where(a => !a.IsMe).OrderBy(a => a.BaseSkinName);
                UltMenu = Menu.AddSubMenu("Ultimate", "UltKayle");
                UltMenu.Add("autoR", new CheckBox("Otomatik Ulti ", true));
                UltMenu.Add("UltSelf", new Slider("Ulti kendine kullan % HP", 20));
                UltMenu.Add("UltAlly", new Slider("Dostlara kullan  % HP", 20));
                foreach (var a in ally)
                {
                    UltMenu.Add("autoUlt_" + a.BaseSkinName, new CheckBox("Ulti Kullan " + a.BaseSkinName));
                }


                //------------//
                //-Draw Menu-//
                //----------//
                DrawMenu = Menu.AddSubMenu("Draws", "DrawKayle");
                // DrawMenu.Add("drawDisable", new CheckBox("Desabilidatar todos os Draw", false));
                DrawMenu.Add("drawAA", new CheckBox("Devredışı Göster AA", true));
                DrawMenu.Add("drawQ", new CheckBox("Devredışı Göster Q", true));
                DrawMenu.Add("drawW", new CheckBox("Devredışı Göster W", true));
                DrawMenu.Add("drawE", new CheckBox("Devredışı Göster E", true));
            }
            catch (Exception e)
            {
                Chat.Print("KKayle: Exception occured while Initializing Addon. Error: " + e.Message);
            }
        }
예제 #6
0
        //-----------------//
        // Start Game-----//
        // Game On Start-//
        static void Game_OnStart(EventArgs args)
        {
            try
            {
                if (ChampionName != PlayerInstance.BaseSkinName)
                {
                    return;
                }

                Bootstrap.Init(null);

                Chat.Print("KKayle Addon Loading Success");
                Q           = new Spell.Targeted(SpellSlot.Q, 650);
                Q.CastDelay = 5;
                W           = new Spell.Targeted(SpellSlot.W, 900);
                E           = new Spell.Active(SpellSlot.E, 650);
                R           = new Spell.Targeted(SpellSlot.R, 900);
                if (Spell1("ignite"))
                {
                    Ignite = new Spell.Targeted(ObjectManager.Player.GetSpellSlotFromName("summonerdot"), 600);
                }

                Menu = MainMenu.AddMenu("K天使", "凯尔");
                Menu.AddSeparator();
                Menu.AddLabel("Criado por Bruno105 由 CH汉化");
                // Combo Menu
                ComboMenu = Menu.AddSubMenu("连招", "连招");
                ComboMenu.Add("ComboW", new CheckBox("连招使用W", true));
                ComboMenu.Add("useIgnite", new CheckBox("使用点燃", false));

                // Harass Menu
                HarassMenu = Menu.AddSubMenu("骚扰", "骚扰");
                HarassMenu.Add("HarassQ", new CheckBox("使用Q骚扰", true));
                HarassMenu.Add("HarassW", new CheckBox("使用W骚扰", false));
                HarassMenu.Add("HarassE", new CheckBox("使用E骚扰", true));
                HarassMenu.Add("ManaH", new Slider("不使用技能当蓝低于", 30));

                //Farm Menu
                FarmMenu = Menu.AddSubMenu("清线", "清线");
                FarmMenu.Add("ManaF", new Slider("不使用技能当蓝低于", 40));
                FarmMenu.Add("FarmQ", new CheckBox("使用Q尾兵", true));
                FarmMenu.Add("FarmE", new CheckBox("使用Q尾兵", true));
                FarmMenu.Add("MinionE", new Slider("小白数量多于时使用E技能清线", 3, 1, 5));
                FarmMenu.AddSeparator();
                FarmMenu.AddLabel("尾兵");
                FarmMenu.Add("LastQ", new CheckBox("使用Q尾兵", true));
                // FarmMenu.Add("LastE", new CheckBox("Use E to Last Hit", true));


                // Heal Menu
                var allies = EntityManager.Heroes.Allies.Where(a => !a.IsMe).OrderBy(a => a.BaseSkinName);
                HealMenu = Menu.AddSubMenu("治疗", "治疗");
                HealMenu.Add("autoW", new CheckBox("自动W", true));
                HealMenu.Add("HealSelf", new Slider("自身治疗当生命低于 %", 50));
                HealMenu.Add("HealAlly", new Slider("治疗友方当生命低于 %", 50));
                foreach (var a in allies)
                {
                    HealMenu.Add("autoHeal_" + a.BaseSkinName, new CheckBox("自动治疗友方 " + a.BaseSkinName));
                }


                //--------------//
                //---Ultmate---//
                //------------//

                var ally = EntityManager.Heroes.Allies.Where(a => !a.IsMe).OrderBy(a => a.BaseSkinName);
                UltMenu = Menu.AddSubMenu("大招", "大招");
                UltMenu.Add("autoR", new CheckBox("使用大招 ", true));
                UltMenu.Add("UltSelf", new Slider("对自身大招当生命低于 %", 20));
                UltMenu.Add("UltAlly", new Slider("对友方大招当生命低于  %", 20));
                foreach (var a in ally)
                {
                    UltMenu.Add("autoUlt_" + a.BaseSkinName, new CheckBox("对友方使用大招 " + a.BaseSkinName));
                }


                //------------//
                //-Draw Menu-//
                //----------//
                DrawMenu = Menu.AddSubMenu("线圈", "线圈");
                // DrawMenu.Add("drawDisable", new CheckBox("Desabilidatar todos os Draw", false));
                DrawMenu.Add("drawAA", new CheckBox("屏蔽AA范围", true));
                DrawMenu.Add("drawQ", new CheckBox("屏蔽Q线圈", true));
                DrawMenu.Add("drawW", new CheckBox("屏蔽W线圈", true));
                DrawMenu.Add("drawE", new CheckBox("屏蔽E线圈", true));
            }
            catch (Exception e)
            {
                Chat.Print("KKayle: Exception occured while Initializing Addon. Error: " + e.Message);
            }
        }
예제 #7
0
        /// <summary>
        /// Called when Loading is Completed
        /// </summary>
        /// <param name="args">The loading arguments</param>
        private static void Loading_OnLoadingComplete(EventArgs args)
        {
            try
            {
                if (ChampionName != PlayerInstance.BaseSkinName)
                {
                    return;
                }

                Bootstrap.Init(null);

                Q = new Spell.Skillshot(SpellSlot.Q, 800, SkillShotType.Circular, 283, 1100, 210);
                W = new Spell.Targeted(SpellSlot.W, 550);
                E = new Spell.Skillshot(SpellSlot.E, 925, SkillShotType.Circular, 500, 1750, 70);
                R = new Spell.Active(SpellSlot.R, int.MaxValue);

                SorakaBuddy = MainMenu.AddMenu("SorakaBuddy", "SorakaBuddy");

                // Combo Menu
                ComboMenu = SorakaBuddy.AddSubMenu("Combo", "Combo");
                ComboMenu.AddGroupLabel("Combo Setting");
                ComboMenu.Add("useQ", new CheckBox("Use Q"));
                ComboMenu.Add("useE", new CheckBox("Use E"));
                ComboMenu.AddSeparator();
                ComboMenu.AddGroupLabel("ManaManager");
                ComboMenu.Add("manaQ", new Slider("Min Mana % before Q", 25));
                ComboMenu.Add("manaE", new Slider("Min Mana % before E", 25));

                // Harass Menu
                HarassMenu = SorakaBuddy.AddSubMenu("Harass", "Harass");
                HarassMenu.AddGroupLabel("Harass Setting");
                HarassMenu.Add("useQ", new CheckBox("Use Q"));
                HarassMenu.Add("useE", new CheckBox("Use E"));
                HarassMenu.AddSeparator();
                HarassMenu.AddGroupLabel("ManaManager");
                HarassMenu.Add("manaQ", new Slider("Min Mana % before Q", 25));
                HarassMenu.Add("manaE", new Slider("Min Mana % before E", 25));

                // Heal Menu
                var allies = EntityManager.Heroes.Allies.Where(a => !a.IsMe).ToArray();
                HealMenu = SorakaBuddy.AddSubMenu("Auto Heal", "Heal");
                HealMenu.AddGroupLabel("Auto W Setting");
                HealMenu.Add("autoW", new CheckBox("Auto W Allies and Me"));
                HealMenu.Add("autoWHP_self", new Slider("Own HP % before using W", 50));
                HealMenu.Add("autoWHP_other", new Slider("Ally HP % before W", 50));
                HealMenu.AddSeparator();
                HealMenu.AddGroupLabel("Auto R Setting");
                HealMenu.Add("useR", new CheckBox("Auto R on HP %"));
                HealMenu.AddSeparator();
                HealMenu.Add("hpR", new Slider("HP % before using R", 25));
                HealMenu.AddSeparator();
                HealMenu.AddLabel("Which Champion to Heal? Using W?");
                foreach (var a in allies)
                {
                    HealMenu.Add("autoHeal_" + a.BaseSkinName, new CheckBox("Auto Heal with W " + a.ChampionName));
                }
                HealMenu.AddSeparator();
                HealMenu.AddLabel("Which Champion to Heal? Using R?");
                foreach (var a in allies)
                {
                    HealMenu.Add("autoHealR_" + a.BaseSkinName, new CheckBox("Auto Heal with R " + a.ChampionName));
                }
                HealMenu.Add("autoHealR_" + PlayerInstance.BaseSkinName, new CheckBox("Auto Heal Self with R"));
                HealMenu.AddSeparator();

                // Interrupt Menu
                InterruptMenu = SorakaBuddy.AddSubMenu("Interrupter", "Interrupter");
                InterruptMenu.AddGroupLabel("Interrupter Setting");
                InterruptMenu.Add("useE", new CheckBox("Use E on Interrupt"));

                // Gapcloser Menu
                GapcloserMenu = SorakaBuddy.AddSubMenu("Gapcloser", "Gapcloser");
                GapcloserMenu.AddGroupLabel("Gapcloser Setting");
                GapcloserMenu.Add("useQ", new CheckBox("Use Q on Gapcloser"));
                GapcloserMenu.Add("useE", new CheckBox("Use E on Gapcloser"));

                // Drawing Menu
                DrawingMenu = SorakaBuddy.AddSubMenu("Drawing", "Drawing");
                DrawingMenu.AddGroupLabel("Drawing Setting");
                DrawingMenu.Add("drawQ", new CheckBox("Draw Q Range"));
                DrawingMenu.Add("drawW", new CheckBox("Draw W Range"));
                DrawingMenu.Add("drawE", new CheckBox("Draw E Range"));

                // Misc Menu
                MiscMenu = SorakaBuddy.AddSubMenu("Misc", "Misc");
                MiscMenu.AddGroupLabel("Miscellaneous Setting");
                MiscMenu.Add("disableMAA", new CheckBox("Disable Minion AA"));
                MiscMenu.Add("disableCAA", new CheckBox("Disable Champion AA"));
                MiscMenu.AddLabel("Prediction Settings");
                var predictionSlider = MiscMenu.Add("Slider", new Slider("mode", 0, 0, 2));
                var predictionArray  = new[] { "High", "Medium", "Low" };
                predictionSlider.DisplayName    = predictionArray[predictionSlider.CurrentValue];
                predictionSlider.OnValueChange += delegate(ValueBase <int> sender, ValueBase <int> .ValueChangeArgs changeArgs)
                {
                    sender.DisplayName = predictionArray[changeArgs.NewValue];
                };

                Chat.Print("SorakaBuddy: Initialized", Color.LightGreen);

                Orbwalker.OnPreAttack += Orbwalker_OnPreAttack;
                Game.OnTick           += Game_OnTick;
                Drawing.OnDraw        += Drawing_OnDraw;

                Interrupter.OnInterruptableSpell += Interrupter_OnInterruptableSpell;
                Gapcloser.OnGapcloser            += Gapcloser_OnGapcloser;
            }
            catch (Exception e)
            {
                Chat.Print("SorakaBuddy: Exception occured while Initializing Addon. Error: " + e.Message);
            }
        }
예제 #8
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;
                }
            }
        }
예제 #9
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);
                        }
                    }
                }
            }
        }
예제 #10
0
	public void Init(HealMenu menu){
		healMenu = menu;
	}