//from Evade by Esk0r public static bool HasSpellShield(Obj_AI_Hero unit) { if (ObjectManager.Player.HasBuffOfType(BuffType.SpellShield)) { return(true); } if (ObjectManager.Player.HasBuffOfType(BuffType.SpellImmunity)) { return(true); } //Sivir E if (unit.LastCastedSpellName() == "SivirE" && (Evade.GetTickCount() - Evade.lastSpellCastTime) < 300) { return(true); } //Morganas E if (unit.LastCastedSpellName() == "BlackShield" && (Evade.GetTickCount() - Evade.lastSpellCastTime) < 300) { return(true); } //Nocturnes E if (unit.LastCastedSpellName() == "NocturneShit" && (Evade.GetTickCount() - Evade.lastSpellCastTime) < 300) { return(true); } return(false); }
private void IssueTestMove(int recursionCount) { var movePos = myHero.ServerPosition.To2D(); Random rand = new Random(); lastRandomMoveCoeff = !lastRandomMoveCoeff; if (lastRandomMoveCoeff) { movePos.X += 65 + rand.Next(0, 20); } else { movePos.X -= 65 + rand.Next(0, 20); } lastTestMoveToCommand = new EvadeCommand { order = EvadeOrderCommand.MoveTo, targetPosition = movePos, timestamp = Evade.GetTickCount(), isProcessed = false }; myHero.IssueOrder(GameObjectOrder.MoveTo, movePos.To3D(), true); if (recursionCount > 1) { Utility.DelayAction.Add(500, () => IssueTestMove(recursionCount - 1)); } }
private void Game_OnGameUpdate(EventArgs args) { if (startWalkTime > 0) { if (Evade.GetTickCount() - startWalkTime > 500 && myHero.IsMoving == false) { //Game.PrintChat("walkspeed: " + startWalkPos.Distance(myHero.ServerPosition.To2D()) / (Evade.GetTickCount() - startWalkTime)); startWalkTime = 0; } } if (testMenu.Item("ShowWindupTime").GetValue <bool>()) { if (myHero.IsMoving && lastStopingTime > 0) { Game.PrintChat("WindupTime: " + (Evade.GetTickCount() - lastStopingTime)); lastStopingTime = 0; } else if (!myHero.IsMoving && lastStopingTime == 0) { lastStopingTime = Evade.GetTickCount(); } } if (testMenu.Item("ShowDashInfo").GetValue <bool>()) { if (myHero.IsDashing()) { var dashInfo = myHero.GetDashInfo(); Game.PrintChat("Dash Speed: " + dashInfo.Speed + " Dash dist: " + dashInfo.EndPos.Distance(dashInfo.StartPos)); } } }
private void CheckSpellEndTime() { foreach (var spell in spells.Where(s => (s.Value.endTime < Evade.GetTickCount()))) { DeleteSpell(spell.Key); } }
private void GameObject_OnFloatPropertyChange(GameObject obj, GameObjectFloatPropertyChangeEventArgs args) { //Game.PrintChat(obj.Name); /*foreach (var sth in ObjectManager.Get<Obj_AI_Base>()) * { * Console.WriteLine(sth.Name); * * }*/ if (obj.Name == "RobotBuddy") { renderPositions.Add(new RenderPosition(obj.Position.To2D(), Evade.GetTickCount() + 10)); } if (args.Property == "mHP" && args.OldValue > args.NewValue) { //Game.PrintChat("Damage taken: " + (Evade.GetTickCount() - lastSpellCastTime)); } if (!obj.IsMe) { return; } if (args.Property != "mExp" && args.Property != "mGold" && args.Property != "mGoldTotal") { //Game.PrintChat(args.Property + ": " + args.NewValue); } }
public static bool inSkillShot(Spell spell, Vector2 position, float radius) { if (spell.info.spellType == SpellType.Line) { Vector2 spellPos = SpellDetector.GetCurrentSpellPosition(spell); //leave little space at back of skillshot if (spell.info.projectileSpeed == float.MaxValue && Evade.GetTickCount() - spell.startTime > spell.info.spellDelay) { return(false); } var projection = position.ProjectOn(spellPos, spell.endPos); if (projection.SegmentPoint.Distance(spell.endPos) < 100) //Check Skillshot endpoints { //unfinished } return(projection.SegmentPoint.Distance(position) <= GetSpellRadius(spell) + radius); } else if (spell.info.spellType == SpellType.Circular) { return(position.Distance(spell.endPos) <= GetSpellRadius(spell) + radius); } else if (spell.info.spellType == SpellType.Cone) { } return(false); }
public static Vector2 GetCurrentSpellPosition(Spell spell, bool allowNegative = false, float delay = 0) { Vector2 spellPos = spell.startPos; if (spell.info.spellType == SpellType.Line) { float spellTime = Evade.GetTickCount() - spell.startTime - spell.info.spellDelay; if (spellTime >= 0) { spellPos = spell.startPos + spell.direction * spell.info.projectileSpeed * spellTime / 1000; } else if (allowNegative) { spellPos = spell.startPos + spell.direction * spell.info.projectileSpeed * (spellTime / 1000); } } else if (spell.info.spellType == SpellType.Circular) { spellPos = spell.endPos; } if (spell.spellObject != null) { spellPos = spell.spellObject.Position.To2D(); } if (delay > 0) { spellPos = spellPos + spell.direction * spell.info.projectileSpeed * (delay / 1000); } return(spellPos); }
public static bool CanHeroWalkIntoSpell(Spell spell) { Vector2 heroPos = myHero.Position.To2D(); if (spell.info.spellType == SpellType.Line) { var walkRadius = myHero.MoveSpeed * (spell.endTime - Evade.GetTickCount()) / 1000 + myHero.BoundingRadius + spell.info.radius; var spellPos = spell.GetCurrentSpellPosition(); var projection = heroPos.ProjectOn(spellPos, spell.endPos); return(projection.SegmentPoint.Distance(heroPos) <= walkRadius); } else if (spell.info.spellType == SpellType.Circular) { var walkRadius = myHero.MoveSpeed * (spell.endTime - Evade.GetTickCount()) / 1000 + myHero.BoundingRadius + spell.info.radius; if (heroPos.Distance(spell.endPos) < walkRadius) { return(true); } } return(false); }
private void Game_OnGameUpdate(EventArgs args) { try { if (Evade.GetTickCount() < lastTickCount) { Game.PrintChat("Time Error"); //lastTickCount = Evade.GetTickCount(); } CheckHeroInDanger(); ContinueLastBlockedCommand(); if (isChanneling && channelPosition.Distance(myHero.ServerPosition.To2D()) > 50) { isChanneling = false; } var limitDelay = Evade.menu.Item("TickLimiter").GetValue <Slider>().Value; //Tick limiter if (Evade.GetTickCount() - lastTickCount > limitDelay && Evade.GetTickCount() > lastStopEvadeTime) { DodgeSkillShots(); //walking EvadeSpell.UseEvadeSpell(); //using spells lastTickCount = Evade.GetTickCount(); } CheckDodgeOnlyDangerous(); } catch (Exception e) { Game.PrintChat(e.StackTrace); } }
private void SpellMissile_OnCreate(GameObject obj, EventArgs args) { if (!obj.IsValid <Obj_SpellMissile>()) { return; } if (testMenu.Item("ShowMissileInfo").GetValue <bool>() == false) { return; } Obj_SpellMissile missile = (Obj_SpellMissile)obj; Game.PrintChat("Missile Name " + missile.SData.Name); Game.PrintChat("Missile Speed " + missile.SData.MissileSpeed); Game.PrintChat("LineWidth " + missile.SData.LineWidth); Game.PrintChat("Range " + missile.SData.CastRange); /*Game.PrintChat("Offset: " + missile.SData.ParticleStartOffset); * Game.PrintChat("Missile Speed " + missile.SData.MissileSpeed); * Game.PrintChat("LineWidth " + missile.SData.LineWidth); * circleRenderPos = missile.SData.ParticleStartOffset.To2D();*/ renderPositions.Add( new RenderPosition(missile.StartPosition.To2D(), Evade.GetTickCount() + 500)); renderPositions.Add( new RenderPosition(missile.EndPosition.To2D(), Evade.GetTickCount() + 500)); SpellData spellData; if (missile.SpellCaster != null && missile.SpellCaster.Team != myHero.Team && missile.SData.Name != null && SpellDetector.onMissileSpells.TryGetValue(missile.SData.Name, out spellData) && missile.StartPosition != null && missile.EndPosition != null) { if (missile.StartPosition.Distance(myHero.Position) < spellData.range + 1000) { var hero = missile.SpellCaster; if (hero.IsVisible) { foreach (KeyValuePair <int, Spell> entry in SpellDetector.spells) { Spell spell = entry.Value; if (spell.info.missileName == missile.SData.Name && spell.heroID == missile.SpellCaster.NetworkId) { if (spell.info.isThreeWay == false && spell.info.isSpecial == false) { //spell.spellObject = obj; Game.PrintChat("Aquired: " + (Evade.GetTickCount() - spell.startTime)); } } } } } } }
private void Game_OnGameUpdate(EventArgs args) { if (Evade.GetTickCount() - lastCheckTime > 100) { CheckCasterDead(); CheckSpellEndTime(); lastCheckTime = Evade.GetTickCount(); } }
private void CompareSpellLocation(Spell spell, Vector2 pos, float time) { var pos2 = spell.GetCurrentSpellPosition(); if (spell.spellObject != null) { Game.PrintChat("Compare: " + (pos2.Distance(pos)) / (Evade.GetTickCount() - time)); } }
public PositionInfo( Vector2 position, bool isDangerousPos, float distanceToMouse) { this.position = position; this.isDangerousPos = isDangerousPos; this.distanceToMouse = distanceToMouse; this.timestamp = Evade.GetTickCount(); }
private void Game_OnGameUpdate(EventArgs args) { if (Evade.GetTickCount() - lastCheckTime > 1) { //CheckCasterDead(); CheckSpellEndTime(); AddDetectedSpells(); lastCheckTime = Evade.GetTickCount(); } }
private void SpellDetector_OnProcessDetectedSpells() { //var pos1 = newSpell.startPos;//SpellDetector.GetCurrentSpellPosition(newSpell); //Utility.DelayAction.Add(250, () => CompareSpellLocation2(newSpell)); sortedBestPos = EvadeHelper.GetBestPositionTest(); circleRenderPos = Evade.lastPosInfo.position; lastSpellCastTime = Evade.GetTickCount(); }
public static void CheckDashing() { if (Evade.GetTickCount() - lastSpellEvadeCommand.timestamp < 250 && myHero.IsDashing() && lastSpellEvadeCommand.evadeSpellData.evadeType == EvadeType.Dash) { var dashInfo = myHero.GetDashInfo(); //Game.PrintChat("" + dashInfo.EndPos.Distance(lastSpellEvadeCommand.targetPosition)); lastSpellEvadeCommand.targetPosition = dashInfo.EndPos; } }
public static void MoveTo(Vector2 movePos) { Evade.lastEvadeCommand = new EvadeCommand { order = EvadeOrderCommand.MoveTo, targetPosition = movePos, timestamp = Evade.GetTickCount(), isProcessed = false }; myHero.IssueOrder(GameObjectOrder.MoveTo, movePos.To3D(), false); }
private void Game_OnGameUpdate(EventArgs args) { if (startWalkTime > 0) { if (Evade.GetTickCount() - startWalkTime > 500 && myHero.IsMoving == false) { //Game.PrintChat("walkspeed: " + startWalkPos.Distance(myHero.ServerPosition.To2D()) / (Evade.GetTickCount() - startWalkTime)); startWalkTime = 0; } } }
private void CompareSpellLocation2(Spell spell) { var pos1 = spell.GetCurrentSpellPosition(); var timeNow = Evade.GetTickCount(); if (spell.spellObject != null) { Game.PrintChat("start distance: " + (spell.startPos.Distance(pos1))); } Utility.DelayAction.Add(250, () => CompareSpellLocation(spell, pos1, timeNow)); }
public static void CastSpell(EvadeSpellData spellData) { EvadeSpell.lastSpellEvadeCommand = new EvadeCommand { order = EvadeOrderCommand.CastSpell, evadeSpellData = spellData, timestamp = Evade.GetTickCount(), isProcessed = false }; myHero.Spellbook.CastSpell(spellData.spellKey, false); }
public static void CastSpell(EvadeSpellData spellData, Vector2 movePos) { EvadeSpell.lastSpellEvadeCommand = new EvadeCommand { order = EvadeOrderCommand.CastSpell, targetPosition = movePos, evadeSpellData = spellData, timestamp = Evade.GetTickCount(), isProcessed = false }; myHero.Spellbook.CastSpell(spellData.spellKey, movePos.To3D(), false); }
public static float GetSpellHitTime(Spell spell, Vector2 pos) { if (spell.info.spellType == SpellType.Line) { var spellPos = SpellDetector.GetCurrentSpellPosition(spell, true, Game.Ping); return(1000 * spellPos.Distance(pos) / spell.info.projectileSpeed); } else if (spell.info.spellType == SpellType.Circular) { return(Math.Max(0, spell.endTime - Evade.GetTickCount() - Game.Ping)); } return(float.MaxValue); }
private static void RenderTestCircles() { foreach (RenderPosition rendPos in renderPositions) { if (rendPos.renderEndTime - Evade.GetTickCount() > 0) { Render.Circle.DrawCircle(rendPos.renderPosition.To3D(), 50, Color.White, 3); } else { Utility.DelayAction.Add(1, () => renderPositions.Remove(rendPos)); } } }
private void Game_ProcessSpell(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args) { try { if (hero.IsMe) { string name; if (channeledSpells.TryGetValue(args.SData.Name, out name)) { Evade.isChanneling = true; Evade.channelPosition = myHero.ServerPosition.To2D(); } var castTime = (hero.Spellbook.CastTime - Game.Time) * 1000; if (castTime > 0 && hero.Spellbook.IsCastingSpell) { var extraDelayBuffer = Evade.menu.Item("ExtraPingBuffer").GetValue <Slider>().Value; Evade.lastWindupTime = Evade.GetTickCount() + castTime - Game.Ping - extraDelayBuffer; } } SpellData spellData; if (hero.Team != myHero.Team && onProcessSpells.TryGetValue(args.SData.Name, out spellData)) { if (spellData.usePackets == false) { var specialSpellArgs = new SpecialSpellEventArgs(); if (OnProcessSpecialSpell != null) { OnProcessSpecialSpell(hero, args, spellData, specialSpellArgs); } if (specialSpellArgs.noProcess == false && spellData.noProcess == false) { CreateSpellData(hero, args.Start, args.End, spellData, null); } } } } catch (Exception e) { Game.PrintChat(e.StackTrace); } }
public PositionInfo( Vector2 position, int posDangerLevel, int posDangerCount, bool isDangerousPos, float distanceToMouse, List <int> dodgeableSpells, List <int> undodgeableSpells) { this.position = position; this.posDangerLevel = posDangerLevel; this.posDangerCount = posDangerCount; this.isDangerousPos = isDangerousPos; this.distanceToMouse = distanceToMouse; this.dodgeableSpells = dodgeableSpells; this.undodgeableSpells = undodgeableSpells; this.timestamp = Evade.GetTickCount(); }
private void CheckSpellEndTime() { foreach (KeyValuePair <int, Spell> entry in detectedSpells) { Spell spell = entry.Value; foreach (var hero in HeroManager.Enemies) { if (hero.IsDead && spell.heroID == hero.NetworkId) { if (spell.spellObject == null) { Utility.DelayAction.Add(1, () => DeleteSpell(entry.Key)); } } } if (spell.endTime < Evade.GetTickCount() || CanHeroWalkIntoSpell(spell) == false) { Utility.DelayAction.Add(1, () => DeleteSpell(entry.Key)); } } }
private void Game_OnIssueOrder(Obj_AI_Base hero, GameObjectIssueOrderEventArgs args) { if (!hero.IsMe) { return; } if (args.Order == GameObjectOrder.HoldPosition) { var path = myHero.Path; var heroPoint = myHero.ServerPosition.To2D(); if (path.Length > 0) { var movePos = path[path.Length - 1].To2D(); var walkDir = (movePos - heroPoint).Normalized(); //circleRenderPos = EvadeHelper.GetRealHeroPos(); //heroPoint;// +walkDir * myHero.MoveSpeed * (((float)Game.Ping) / 1000); } } /* * if (args.Order == GameObjectOrder.MoveTo) * { * if (testingCollision) * { * if (args.TargetPosition.To2D().Distance(testCollisionPos) < 3) * { * //var path = myHero.GetPath(); * //circleRenderPos * * args.Process = false; * } * } * }*/ if (args.Order == GameObjectOrder.MoveTo) { Vector2 heroPos = myHero.ServerPosition.To2D(); Vector2 pos = args.TargetPosition.To2D(); float speed = myHero.MoveSpeed; startWalkPos = heroPos; startWalkTime = Evade.GetTickCount(); foreach (KeyValuePair <int, Spell> entry in SpellDetector.spells) { Spell spell = entry.Value; var spellPos = spell.GetCurrentSpellPosition(); var walkDir = (pos - heroPos).Normalized(); float spellTime = (Evade.GetTickCount() - spell.startTime) - spell.info.spellDelay; spellPos = spell.startPos + spell.direction * spell.info.projectileSpeed * (spellTime / 1000); //Game.PrintChat("aaaa" + spellTime); bool isCollision = false; float movingCollisionTime = MathUtils.GetCollisionTime(heroPos, spellPos, walkDir * (speed - 25), spell.direction * (spell.info.projectileSpeed - 200), myHero.BoundingRadius, spell.GetSpellRadius(), out isCollision); if (isCollision) { //Game.PrintChat("aaaa" + spellPos.Distance(spell.endPos) / spell.info.projectileSpeed); if (true)//spellPos.Distance(spell.endPos) / spell.info.projectileSpeed > movingCollisionTime) { Game.PrintChat("movingCollisionTime: " + movingCollisionTime); //circleRenderPos = heroPos + walkDir * speed * movingCollisionTime; } } } } }
private void Drawing_OnDraw(EventArgs args) { //PrintTimers(); //EvadeHelper.CheckMovePath(Game.CursorPos.To2D()); foreach (KeyValuePair <int, Spell> entry in SpellDetector.drawSpells) { Spell spell = entry.Value; if (spell.info.spellType == SpellType.Line) { Vector2 spellPos = spell.GetCurrentSpellPosition(); Render.Circle.DrawCircle(new Vector3(spellPos.X, spellPos.Y, myHero.Position.Z), spell.info.radius, Color.White, 3); /*spellPos = spellPos + spell.direction * spell.info.projectileSpeed * (60 / 1000); //move the spellPos by 50 miliseconds forwards * spellPos = spellPos + spell.direction * 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);*/ } } RenderTestCircles(); if (testMenu.Item("TestHeroPos").GetValue <bool>()) { var path = myHero.Path; if (path.Length > 0) { var heroPos2 = EvadeHelper.GetRealHeroPos(Game.Ping + 50);// path[path.Length - 1].To2D(); var heroPos1 = myHero.ServerPosition.To2D(); Render.Circle.DrawCircle(new Vector3(heroPos2.X, heroPos2.Y, myHero.ServerPosition.Z), myHero.BoundingRadius, Color.Red, 3); Render.Circle.DrawCircle(new Vector3(myHero.ServerPosition.X, myHero.ServerPosition.Y, myHero.ServerPosition.Z), myHero.BoundingRadius, Color.White, 3); var heroPos = Drawing.WorldToScreen(ObjectManager.Player.Position); var dimension = Drawing.GetTextExtent("Evade: ON"); Drawing.DrawText(heroPos.X - dimension.Width / 2, heroPos.Y, Color.Red, "" + (int)(heroPos2.Distance(heroPos1))); Render.Circle.DrawCircle(new Vector3(circleRenderPos.X, circleRenderPos.Y, myHero.ServerPosition.Z), 10, Color.Red, 3); } } if (testMenu.Item("DrawHeroPos").GetValue <bool>()) { Render.Circle.DrawCircle(new Vector3(myHero.ServerPosition.X, myHero.ServerPosition.Y, myHero.ServerPosition.Z), myHero.BoundingRadius, Color.White, 3); } if (testMenu.Item("TestMoveTo").GetValue <KeyBind>().Active) { var keyBind = testMenu.Item("TestMoveTo").GetValue <KeyBind>(); testMenu.Item("TestMoveTo").SetValue(new KeyBind(keyBind.Key, KeyBindType.Toggle, false)); myHero.IssueOrder(GameObjectOrder.MoveTo, Game.CursorPos); var dir = (Game.CursorPos - myHero.Position).Normalized(); var pos2 = myHero.Position - dir * Game.CursorPos.Distance(myHero.Position); Utility.DelayAction.Add(1, () => myHero.IssueOrder(GameObjectOrder.MoveTo, pos2)); } if (testMenu.Item("TestPath").GetValue <bool>()) { var tPath = myHero.GetPath(Game.CursorPos); Vector2 lastPoint = Vector2.Zero; foreach (Vector3 point in tPath) { var point2D = point.To2D(); //Render.Circle.DrawCircle(new Vector3(point.X, point.Y, point.Z), myHero.BoundingRadius, Color.Violet, 3); lastPoint = point2D; } } if (testMenu.Item("TestPath").GetValue <bool>()) { var tPath = myHero.GetPath(Game.CursorPos); Vector2 lastPoint = Vector2.Zero; foreach (Vector3 point in tPath) { var point2D = point.To2D(); //Render.Circle.DrawCircle(new Vector3(point.X, point.Y, point.Z), myHero.BoundingRadius, Color.Violet, 3); lastPoint = point2D; } foreach (KeyValuePair <int, Spell> entry in SpellDetector.spells) { Spell spell = entry.Value; Vector2 to = Game.CursorPos.To2D(); var dir = (to - myHero.Position.To2D()).Normalized(); Vector2 cPos1, cPos2; var cpa = MathUtilsCPA.CPAPointsEx(myHero.Position.To2D(), dir * myHero.MoveSpeed, spell.endPos, spell.direction * spell.info.projectileSpeed, to, spell.endPos); var cpaTime = MathUtilsCPA.CPATime(myHero.Position.To2D(), dir * myHero.MoveSpeed, spell.endPos, spell.direction * spell.info.projectileSpeed); //Game.PrintChat("" + cpaTime); //Render.Circle.DrawCircle(cPos1.To3D(), myHero.BoundingRadius, Color.Red, 3); if (cpa < myHero.BoundingRadius + spell.GetSpellRadius()) { } } } if (testMenu.Item("ShowBuffs").GetValue <bool>()) { var target = myHero; foreach (var hero in HeroManager.Enemies) { target = hero; } var buffs = target.Buffs; //Game.PrintChat(myHero.ChampionName); //if(myHero.IsDead) // Game.PrintChat("dead"); if (!target.IsTargetable) { Game.PrintChat("invul" + Evade.GetTickCount()); } int height = 20; foreach (var buff in buffs) { if (buff.IsValidBuff()) { Drawing.DrawText(10, height, Color.White, buff.Name); height += 20; Game.PrintChat(buff.Name); } } } if (testMenu.Item("TestTracker").GetValue <bool>()) { foreach (KeyValuePair <int, ObjectTrackerInfo> entry in SpecialSpells.objTracker) { var info = entry.Value; Vector3 endPos2; if (info.usePosition == false) { endPos2 = info.obj.Position; } else { endPos2 = info.position; } Render.Circle.DrawCircle(new Vector3(endPos2.X, endPos2.Y, myHero.Position.Z), 50, Color.Green, 3); } } if (testMenu.Item("TestWall").GetValue <bool>()) { foreach (var posInfo in sortedBestPos) { var posOnScreen = Drawing.WorldToScreen(posInfo.position.To3D()); //Drawing.DrawText(posOnScreen.X, posOnScreen.Y, Color.Aqua, "" + (int)posInfo.closestDistance); /* * if (!posInfo.rejectPosition) * { * Drawing.DrawText(posOnScreen.X, posOnScreen.Y, Color.Aqua, "" + (int)posInfo.closestDistance); * }*/ Drawing.DrawText(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); * }*/ } } }
public static bool PredictSpellCollision(Spell spell, Vector2 pos, float speed, float delay, Vector2 heroPos, float extraDist) { var walkDir = (pos - heroPos).Normalized(); var zVector = new Vector2(0, 0); /* * if (Evade.menu.SubMenu("MiscSettings").Item("CalculateHeroPos").GetValue<bool>()) * heroPos = GetRealHeroPos(); //testing*/ /*if (!myHero.IsMoving) * walkDir = zVector;*/ if (spell.info.spellType == SpellType.Line) { //zVector if (spell.info.projectileSpeed == float.MaxValue) { } var spellPos = SpellDetector.GetCurrentSpellPosition(spell, true); //Using triple checks //Check if skillshot will hit pos if hero is standing still bool isCollision = false; float standingCollisionTime = MathUtils.GetCollisionTime(pos, spellPos, zVector, spell.direction * spell.info.projectileSpeed, myHero.BoundingRadius, GetSpellRadius(spell), out isCollision); if (isCollision && standingCollisionTime > 0) { if (spellPos.Distance(spell.endPos) / spell.info.projectileSpeed > standingCollisionTime) { return(true); //if collision happens when the skillshot is in flight } } return(GetClosestDistanceApproach(spell, pos, speed, delay, heroPos, extraDist) == 0); /* * //Check if skillshot will hit hero if hero is moving * float movingCollisionTime = MathUtils.GetCollisionTime(heroPos, spellPos, walkDir * speed, spell.direction * spell.info.projectileSpeed, myHero.BoundingRadius, GetSpellRadius(spell) + 5, out isCollision); * if (isCollision && movingCollisionTime > 0) * { * if (spellPos.Distance(spell.endPos) / spell.info.projectileSpeed > movingCollisionTime) * return true; //if collision happens when the skillshot is in flight * } * * * //Check if skillshot will hit hero if hero is moving and the skillshot is moved forwards by 50 units * * spellPos = spellPos + spell.direction * spell.info.projectileSpeed * (delay / 1000); //move the spellPos by 50 miliseconds forwards * spellPos = spellPos + spell.direction * 50; //move the spellPos by 50 units forwards * * var finalExtraDelay = (50 / spell.info.projectileSpeed) + (delay / 1000); * * float extraCollisionTime = MathUtils.GetCollisionTime(heroPos, spellPos, walkDir * speed, spell.direction * spell.info.projectileSpeed, myHero.BoundingRadius, GetSpellRadius(spell) + 5, out isCollision); * if (isCollision && extraCollisionTime > -finalExtraDelay) * { * if (spellPos.Distance(spell.endPos) / spell.info.projectileSpeed > extraCollisionTime) * return true; //if collision happens when the skillshot is in flight * else * return false; * }*/ } else if (spell.info.spellType == SpellType.Circular) { var spellHitTime = Math.Max(0, spell.endTime - Evade.GetTickCount()); //extraDelay var walkRange = heroPos.Distance(pos); var predictedRange = speed * (spellHitTime / 1000); var tHeroPos = heroPos + walkDir * Math.Min(predictedRange, walkRange); //Hero predicted pos return(tHeroPos.Distance(spell.endPos) <= GetSpellRadius(spell) + myHero.BoundingRadius); //+ dodgeBuffer } else if (spell.info.spellType == SpellType.Cone) { var spellHitTime = Math.Max(0, spell.endTime - Evade.GetTickCount()); //extraDelay var tHeroPos = heroPos + walkDir * speed * (spellHitTime / 1000); return(inSkillShot(spell, tHeroPos, myHero.BoundingRadius)); } return(false); }
public static void UseEvadeSpell() { if (!Evade.menu.SubMenu("Main").Item("UseEvadeSpells").GetValue <bool>()) { return; } //int posDangerlevel = EvadeHelper.CheckPosDangerLevel(myHero.ServerPosition.To2D(), 0); if (Evade.GetTickCount() - lastSpellEvadeCommand.timestamp < 1000) { return; } foreach (KeyValuePair <int, Spell> entry in SpellDetector.spells) { Spell spell = entry.Value; if (!Evade.lastPosInfo.undodgeableSpells.Contains(spell.spellID)) { continue; } foreach (var evadeSpell in evadeSpells) { if (Evade.menu.SubMenu("EvadeSpells").SubMenu(evadeSpell.charName + evadeSpell.name + "EvadeSpellSettings") .Item(evadeSpell.name + "UseEvadeSpell").GetValue <bool>() == false || GetSpellDangerLevel(evadeSpell) > EvadeHelper.GetSpellDangerLevel(spell) || !(myHero.Spellbook.CanUseSpell(evadeSpell.spellKey) == SpellState.Ready)) { continue; //can't use spell right now } if (evadeSpell.evadeType == EvadeType.Blink) { var posInfo = EvadeHelper.GetBestPositionBlink(); if (posInfo != null) { EvadeCommand.CastSpell(evadeSpell, posInfo.position); } } else if (evadeSpell.evadeType == EvadeType.Dash) { var posInfo = EvadeHelper.GetBestPositionDash(evadeSpell); if (posInfo != null) { if (evadeSpell.isReversed) { var dir = (posInfo.position - myHero.ServerPosition.To2D()).Normalized(); var range = myHero.ServerPosition.To2D().Distance(posInfo.position); var pos = myHero.ServerPosition.To2D() - dir * range; posInfo.position = pos; } EvadeCommand.CastSpell(evadeSpell, posInfo.position); } } else if (evadeSpell.evadeType == EvadeType.SpellShield) { EvadeCommand.CastSpell(evadeSpell); } return; } } }