Esempio n. 1
0
        public static Vector3 GetInsecPos(AIHeroClient target)
        {
            try
            {
                if (ClicksecEnabled && InsecMenu.GetCheckBoxValue("clickInsec"))
                {
                    InsecLinePos = Drawing.WorldToScreen(InsecClickPos);
                    return(V2E(InsecClickPos, target.Position, target.Distance(InsecClickPos) + 230).To3D());
                }
                if (isNullInsecPos)
                {
                    isNullInsecPos = false;
                    insecPos       = myHero.Position;
                }

                if (GetAllyHeroes(target, 2000 + InsecMenu.GetSliderValue("bonusrangea")).Count > 0 &&
                    InsecMenu.GetCheckBoxValue("insecally"))
                {
                    var insecPosition =
                        InterceptionPoint(
                            GetAllyInsec(
                                GetAllyHeroes(target, 2000 + InsecMenu.GetSliderValue("bonusrangea"))));

                    InsecLinePos = Drawing.WorldToScreen(insecPosition);
                    return(V2E(insecPosition, target.Position, target.Distance(insecPosition) + 230).To3D());
                }

                var tower =
                    ObjectManager.Get <Obj_AI_Turret>()
                    .Where(
                        turret =>
                        turret.Distance(target) - 725 <= 950 && turret.IsAlly && turret.IsVisible &&
                        turret.Health > 0 && turret.Distance(target) <= 1300 && turret.Distance(target) > 400)
                    .MinOrDefault(i => target.Distance(myHero));

                if (tower != null)
                {
                    InsecLinePos = Drawing.WorldToScreen(tower.Position);
                    return(V2E(tower.Position, target.Position, target.Distance(tower.Position) + 230).To3D());
                }

                if (InsecMenu.GetCheckBoxValue("insecpos"))
                {
                    InsecLinePos = Drawing.WorldToScreen(insecPos);
                    return(V2E(insecPos, target.Position, target.Distance(insecPos) + 230).To3D());
                }
                return(new Vector3());
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
            return(new Vector3());
        }
Esempio n. 2
0
        private static List <AIHeroClient> GetAllyInsec(List <AIHeroClient> heroes)
        {
            byte alliesAround = 0;
            var  tempObject   = new AIHeroClient();

            foreach (var hero in heroes)
            {
                var localTemp =
                    GetAllyHeroes(hero, 500 + InsecMenu.GetSliderValue("bonusrangea")).Count;
                if (localTemp > alliesAround)
                {
                    tempObject   = hero;
                    alliesAround = (byte)localTemp;
                }
            }
            return(GetAllyHeroes(tempObject, 500 + InsecMenu.GetSliderValue("bonusrangea")));
        }