private void Render_OnPresent() { //PrintTimers(); //EvadeHelper.CheckMovePath(Game.CursorPos.To2D()); //TestUnderTurret(); /*if (EvadeHelper.CheckPathCollision(myHero, Game.CursorPos.To2D())) * { * var paths = myHero.GetPath(ObjectCache.myHeroCache.serverPos2DExtra.To3D(), Game.CursorPos); * foreach (var path in paths) * { * Render.Circle.DrawCircle(path, ObjectCache.myHeroCache.boundingRadius, Color.Red, 3); * } * } * else * { * Render.Circle.DrawCircle(Game.CursorPos, ObjectCache.myHeroCache.boundingRadius, Color.White, 3); * }*/ foreach (var entry in SpellDetector.drawSpells) { var spell = entry.Value; if (spell.spellType == SpellType.Line) { var spellPos = spell.currentSpellPosition; Render.Circle(new Vector3(spellPos.X, spellPos.Y, myHero.Position.Z), spell.info.radius, 50, Color.White); /*spellPos = spellPos + spell.Orientation * spell.info.projectileSpeed * (60 / 1000); //move the spellPos by 50 miliseconds forwards * spellPos = spellPos + spell.Orientation * 200; //move the spellPos by 50 units forwards * * Render.Circle.DrawCircle(new Vector3(spellPos.X, spellPos.Y, myHero.Position.Z), spell.info.radius, Color.White, 3);*/ } } if (testMenu["(TestHeroPos)"].As <MenuBool>().Enabled) { var path = myHero.Path; if (path.Length > 0) { var heroPos2 = EvadeHelper.GetRealHeroPos(ObjectCache.gamePing + 50); // path[path.Length - 1].To2D(); var heroPos1 = ObjectCache.myHeroCache.serverPos2D; Render.Circle(new Vector3(heroPos2.X, heroPos2.Y, myHero.ServerPosition.Z), ObjectCache.myHeroCache.boundingRadius, 50, Color.Red); Render.Circle( new Vector3(myHero.ServerPosition.X, myHero.ServerPosition.Y, myHero.ServerPosition.Z), ObjectCache.myHeroCache.boundingRadius, 50, Color.White); Vector2 heroPos; Render.WorldToScreen(ObjectManager.GetLocalPlayer().Position, out heroPos); //var dimension = Render.GetTextExtent("Evade: ON"); Render.Text(heroPos.X - 10, heroPos.Y, Color.Red, "" + (int)heroPos2.Distance(heroPos1)); Render.Circle(new Vector3(circleRenderPos.X, circleRenderPos.Y, myHero.ServerPosition.Z), 10, 50, Color.Red); } } if (testMenu["(DrawHeroPos)"].As <MenuBool>().Enabled) { Render.Circle(new Vector3(myHero.ServerPosition.X, myHero.ServerPosition.Y, myHero.ServerPosition.Z), ObjectCache.myHeroCache.boundingRadius, 50, Color.White); } if (testMenu["(TestMoveTo)"].As <MenuKeyBind>().Enabled) { // fix ? wtf var MenuKeyBind = testMenu["(TestMoveTo)"].As <MenuKeyBind>(); testMenu["(TestMoveTo)"].As <MenuKeyBind>().Value = false; /*lastRightMouseClickTime = EvadeUtils.TickCount; * myHero.IssueOrder(OrderType.MoveTo, Game.CursorPos,false);*/ myHero.IssueOrder(OrderType.MoveTo, Game.CursorPos); var dir = (Game.CursorPos - myHero.Position).Normalized(); //var pos2 = myHero.Position - dir * Game.CursorPos.Distance(myHero.Position); //var pos2 = myHero.Position.To2D() - dir.To2D() * 75; var pos2 = Game.CursorPos.To2D() - dir.To2D() * 75; //Console.WriteLine(myHero.BBox.Maximum.Distance(myHero.Position)); DelayAction.Add(20, () => myHero.IssueOrder(OrderType.MoveTo, pos2.To3D())); //myHero.IssueOrder(OrderType.MoveTo, pos2, false); } if (testMenu["(TestPath)"].As <MenuBool>().Enabled) { var tPath = myHero.GetPath(Game.CursorPos); var lastPoint = Vector2.Zero; foreach (var point in tPath) { var point2D = point.To2D(); Render.Circle(new Vector3(point.X, point.Y, point.Z), ObjectCache.myHeroCache.boundingRadius, 50, Color.Violet); lastPoint = point2D; } } if (testMenu["(TestPath)"].As <MenuBool>().Enabled) { var tPath = myHero.GetPath(Game.CursorPos); var lastPoint = Vector2.Zero; foreach (var point in tPath) { var point2D = point.To2D(); //Render.Circle.DrawCircle(new Vector3(point.X, point.Y, point.Z), ObjectCache.myHeroCache.boundingRadius, Color.Violet, 3); lastPoint = point2D; } foreach (var entry in SpellDetector.spells) { var spell = entry.Value; var to = Game.CursorPos.To2D(); var dir = (to - myHero.Position.To2D()).Normalized(); Vector2 cPos1, cPos2; var cpa = MathUtilsCPA.CPAPointsEx(myHero.Position.To2D(), dir * ObjectCache.myHeroCache.moveSpeed, spell.endPos, spell.direction * spell.info.projectileSpeed, to, spell.endPos); var cpaTime = MathUtilsCPA.CPATime(myHero.Position.To2D(), dir * ObjectCache.myHeroCache.moveSpeed, spell.endPos, spell.direction * spell.info.projectileSpeed); //ConsolePrinter.Print("" + cpaTime); //Render.Circle.DrawCircle(cPos1.To3D(), ObjectCache.myHeroCache.boundingRadius, Color.Red, 3); if (cpa < ObjectCache.myHeroCache.boundingRadius + spell.radius) { } } } if (testMenu["(ShowBuffs)"].As <MenuBool>().Enabled) { var target = myHero; foreach (var hero in GameObjects.EnemyHeroes) { target = hero; } var buffs = target.Buffs; //ConsolePrinter.Print(myHero.ChampionName); //if(myHero.IsDead) // ConsolePrinter.Print("dead"); if (!target.IsTargetable) { ConsolePrinter.Print("invul" + EvadeUtils.TickCount); } var height = 20; foreach (var buff in buffs) { if (buff.IsValid) { Render.Text(10, height, Color.White, buff.Name); height += 20; ConsolePrinter.Print(buff.Name); } } } if (testMenu["(TestTracker)"].As <MenuBool>().Enabled) { foreach (var entry in ObjectTracker.objTracker) { var info = entry.Value; Vector3 endPos2; if (info.usePosition == false) { endPos2 = info.obj.Position; } else { endPos2 = info.position; } Render.Circle(new Vector3(endPos2.X, endPos2.Y, myHero.Position.Z), 50, 50, Color.Green); } } if (testMenu["(ShowMissileInfo)"].As <MenuBool>().Enabled) { if (testMissile != null) { //Render.Circle.DrawCircle(testMissile.Position, testMissile.BoundingRadius, Color.White, 3); } } if (testMenu["(TestWall)"].As <MenuBool>().Enabled) { /*foreach (var posInfo in sortedBestPos) * { * var posOnScreen = Drawing.WorldToScreen(posInfo.position.To3D()); * //Render.Text(posOnScreen.X, posOnScreen.Y, Color.Aqua, "" + (int)posInfo.closestDistance); * * * if (!posInfo.rejectPosition) * { * Render.Text(posOnScreen.X, posOnScreen.Y, Color.Aqua, "" + (int)posInfo.closestDistance); * } * * Render.Text(posOnScreen.X, posOnScreen.Y, Color.Aqua, "" + (int)posInfo.closestDistance); * * if (posInfo.posDangerCount <= 0) * { * var pos = posInfo.position; * Render.Circle.DrawCircle(new Vector3(pos.X, pos.Y, myHero.Position.Z), (float)25, Color.White, 3); * } * }*/ var posChecked = 0; var maxPosToCheck = 50; var posRadius = 50; var radiusIndex = 0; var heroPoint = ObjectCache.myHeroCache.serverPos2D; var posTable = new List <PositionInfo>(); while (posChecked < maxPosToCheck) { radiusIndex++; var curRadius = radiusIndex * 2 * posRadius; var curCircleChecks = (int)Math.Ceiling(2 * Math.PI * curRadius / (2 * (double)posRadius)); for (var i = 1; i < curCircleChecks; i++) { posChecked++; var cRadians = 2 * Math.PI / (curCircleChecks - 1) * i; //check decimals var pos = new Vector2((float)Math.Floor(heroPoint.X + curRadius * Math.Cos(cRadians)), (float)Math.Floor(heroPoint.Y + curRadius * Math.Sin(cRadians))); if (!EvadeHelper.CheckPathCollision(myHero, pos)) { Render.Circle(new Vector3(pos.X, pos.Y, myHero.Position.Z), 25, 50, Color.White); } } } } }
private void Render_OnPresent() { foreach (var entry in SpellDetector.DrawSpells) { var spell = entry.Value; if (spell.SpellType != SpellType.Line) { continue; } var spellPos = spell.CurrentSpellPosition; Render.Circle(new Vector3(spellPos.X, spellPos.Y, MyHero.Position.Z), spell.Info.Radius, 50, Color.White); } if (TestMenu["(TestHeroPos)"].Enabled) { var path = MyHero.Path; if (path.Length > 0) { var heroPos2 = EvadeHelper.GetRealHeroPos(ObjectCache.GamePing + 50); var heroPos1 = ObjectCache.MyHeroCache.ServerPos2D; Render.Circle(new Vector3(heroPos2.X, heroPos2.Y, MyHero.ServerPosition.Z), ObjectCache.MyHeroCache.BoundingRadius, 50, Color.Red); Render.Circle(new Vector3(MyHero.ServerPosition.X, MyHero.ServerPosition.Y, MyHero.ServerPosition.Z), ObjectCache.MyHeroCache.BoundingRadius, 50, Color.White); Render.WorldToScreen(ObjectManager.GetLocalPlayer().Position, out var heroPos); Render.Text($" {(int) heroPos2.Distance(heroPos1)}", new Vector2(heroPos.X - 10, heroPos.Y), RenderTextFlags.Center, Color.Red); Render.Circle(new Vector3(_circleRenderPos.X, _circleRenderPos.Y, MyHero.ServerPosition.Z), 10, 50, Color.Red); } } if (TestMenu["(DrawHeroPos)"].Enabled) { Render.Circle(new Vector3(MyHero.ServerPosition.X, MyHero.ServerPosition.Y, MyHero.ServerPosition.Z), ObjectCache.MyHeroCache.BoundingRadius, 50, Color.White); } if (TestMenu["(TestMoveTo)"].As <MenuKeyBind>().Enabled) { TestMenu["(TestMoveTo)"].As <MenuKeyBind>().Value = false; MyHero.IssueOrder(OrderType.MoveTo, Game.CursorPos); var dir = (Game.CursorPos - MyHero.Position).Normalized(); var pos2 = Game.CursorPos.To2D() - dir.To2D() * 75; DelayAction.Add(20, () => MyHero.IssueOrder(OrderType.MoveTo, pos2.To3D())); } if (TestMenu["(TestPath)"].Enabled) { var tPath = MyHero.GetPath(Game.CursorPos); foreach (var point in tPath) { var point2D = point.To2D(); Render.Circle(new Vector3(point.X, point.Y, point.Z), ObjectCache.MyHeroCache.BoundingRadius, 50, Color.Violet); } } if (TestMenu["(TestPath)"].Enabled) { foreach (var entry in SpellDetector.Spells) { var spell = entry.Value; var to = Game.CursorPos.To2D(); var dir = (to - MyHero.Position.To2D()).Normalized(); var cpa = MathUtilsCpa.CPAPointsEx(MyHero.Position.To2D(), dir * ObjectCache.MyHeroCache.MoveSpeed, spell.EndPos, spell.Direction * spell.Info.ProjectileSpeed, to, spell.EndPos); if (cpa < ObjectCache.MyHeroCache.BoundingRadius + spell.Radius) { } } } if (TestMenu["(ShowBuffs)"].Enabled) { var target = MyHero; foreach (var hero in GameObjects.EnemyHeroes) { target = hero; } var buffs = target.Buffs; if (!target.IsTargetable) { ConsolePrinter.Print("invul" + Environment.TickCount); } var height = 20; foreach (var buff in buffs) { if (!buff.IsValid) { continue; } Render.Text(buff.Name, new Vector2(10, height), RenderTextFlags.Center, Color.White); height += 20; ConsolePrinter.Print(buff.Name); } } if (TestMenu["(TestTracker)"].Enabled) { foreach (var entry in ObjectTracker.ObjTracker) { var info = entry.Value; var endPos2 = !info.UsePosition ? info.Obj.Position : info.Position; Render.Circle(new Vector3(endPos2.X, endPos2.Y, MyHero.Position.Z), 50, 50, Color.Green); } } if (!TestMenu["(TestWall)"].Enabled) { return; } var posChecked = 0; const int maxPosToCheck = 50; const int posRadius = 50; var radiusIndex = 0; var heroPoint = ObjectCache.MyHeroCache.ServerPos2D; while (posChecked < maxPosToCheck) { radiusIndex++; var curRadius = radiusIndex * 2 * posRadius; var curCircleChecks = (int)Math.Ceiling(2 * Math.PI * curRadius / (2 * (double)posRadius)); for (var i = 1; i < curCircleChecks; i++) { posChecked++; var cRadians = 2 * Math.PI / (curCircleChecks - 1) * i; //check decimals var pos = new Vector2((float)Math.Floor(heroPoint.X + curRadius * Math.Cos(cRadians)), (float)Math.Floor(heroPoint.Y + curRadius * Math.Sin(cRadians))); if (!EvadeHelper.CheckPathCollision(MyHero, pos)) { Render.Circle(new Vector3(pos.X, pos.Y, MyHero.Position.Z), 25, 50, Color.White); } } } }