private static void CastQ(Obj_AI_Base target) { if (!_q.IsReady()) { return; } if (WShadow != null && target.LSDistance(WShadow.ServerPosition) <= 900 && target.LSDistance(_player.ServerPosition) > 450) { var shadowpred = _q.GetPrediction(target); _q.UpdateSourcePosition(WShadow.ServerPosition, WShadow.ServerPosition); if (shadowpred.Hitchance >= HitChance.Medium) { _q.Cast(target); } } else { _q.UpdateSourcePosition(_player.ServerPosition, _player.ServerPosition); var normalpred = _q.GetPrediction(target); if (normalpred.CastPosition.LSDistance(_player.ServerPosition) < 900 && normalpred.Hitchance >= HitChance.Medium) { _q.Cast(target); } } }
public static void CastBasicFarm(Spell spell) { if (!spell.IsReady()) return; var minion = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, spell.Range, MinionTypes.All, MinionTeam.NotAlly); if (minion.Count == 0) return; if (spell.Type == SkillshotType.SkillshotCircle) { spell.UpdateSourcePosition(); var predPosition = spell.GetCircularFarmLocation(minion); if (predPosition.MinionsHit >= 2) { spell.Cast(predPosition.Position); } } else if (spell.Type == SkillshotType.SkillshotLine || spell.Type == SkillshotType.SkillshotCone) { spell.UpdateSourcePosition(); var predPosition = spell.GetLineFarmLocation(minion); if (predPosition.MinionsHit >= 2) spell.Cast(predPosition.Position); } }
public static void CastBasicSkillShot(Spell spell, float range, TargetSelector.DamageType type, HitChance hitChance, bool towerCheck = false) { var target = TargetSelector.GetTarget(range, type); if (target == null || !spell.IsReady()) return; if (towerCheck && target.UnderTurret(true)) return; spell.UpdateSourcePosition(); if (spell.Type == SkillshotType.SkillshotCircle) { var pred = Prediction.GetPrediction(target, spell.Delay); if (pred.Hitchance >= hitChance) spell.Cast(pred.CastPosition); } else { spell.CastIfHitchanceEquals(target, hitChance); } }
public static void CastBasicSkillShot(Spell spell, float range, LeagueSharp.Common.TargetSelector.DamageType type, HitChance hitChance) { var target = LeagueSharp.Common.TargetSelector.GetTarget(range, type); if (target == null || !spell.IsReady()) return; spell.UpdateSourcePosition(); if (spell.GetPrediction(target).Hitchance >= hitChance) spell.Cast(target, packets()); }
private static void HandleQ(AIHeroClient target) { Q.UpdateSourcePosition(blade); var pred = Q.GetPrediction(target); var poly = CombatHelper.GetPoly(blade.LSExtend(player.Position, 30), player.LSDistance(blade), 150); if (((pred.HitChance >= EloBuddy.SDK.Enumerations.HitChance.High && poly.IsInside(pred.UnitPosition)) || (target.LSDistance(blade) < 100) || (target.LSDistance(blade) < 500 && poly.IsInside(target.Position)) || player.LSDistance(target) < Orbwalking.GetRealAutoAttackRange(target) || ObjectManager.Player.Spellbook.IsAutoAttacking) && CheckQDef()) { Q.Cast(); } }
private static void HandleQ(AIHeroClient target) { Q.UpdateSourcePosition(blade); var pred = Q.GetPrediction(target); var poly = CombatHelper.GetPoly(blade.Extend(player.Position, 30).To3DWorld(), player.Distance(blade), 150); if (((pred.Hitchance >= HitChance.VeryHigh && poly.IsInside(pred.UnitPosition)) || (target.Distance(blade) < 100) || (target.Distance(blade) < 500 && poly.IsInside(target.Position)) || player.Distance(target) < Orbwalking.GetRealAutoAttackRange(target) || player.Spellbook.IsAutoAttacking) && CheckQDef()) { Q.Cast(); } }
private static void CastE(Obj_AI_Base t, HitChance hitchance) { if (Player.ServerPosition.Distance(t.ServerPosition) < ECastRange) { E.UpdateSourcePosition(t.ServerPosition, t.ServerPosition); var pred = E.GetPrediction(t, true); if (pred.Hitchance >= hitchance) { EloBuddy.Player.CastSpell(SpellSlot.E, pred.CastPosition, t.ServerPosition); //E.Cast(t.ServerPosition, pred.CastPosition); } } else if (Player.ServerPosition.Distance(t.ServerPosition) < ECastRange + E.Range) { var castStartPos = Player.ServerPosition.Extend(t.ServerPosition, ECastRange).To3DWorld(); E.UpdateSourcePosition(castStartPos, castStartPos); var pred = E.GetPrediction(t, true); if (pred.Hitchance >= hitchance) { EloBuddy.Player.CastSpell(SpellSlot.E, pred.CastPosition, castStartPos); //E.Cast(castStartPos, pred.CastPosition); } } }
public static void CastSingleLine(Spell spell, Spell spell2, bool wallCheck, float extraPrerange = 1) { if (!spell.IsReady() || Utils.TickCount - _lastCast < 0) return; //-------------------------------Single--------------------------- var target = TargetSelector.GetTarget(spell.Range + spell2.Range, TargetSelector.DamageType.Magical); if (target == null) return; var vector1 = Player.ServerPosition + Vector3.Normalize(target.ServerPosition - Player.ServerPosition) * (spell.Range * extraPrerange); spell2.UpdateSourcePosition(vector1, vector1); var pred = Prediction.GetPrediction(target, spell.Delay); Geometry.Polygon.Rectangle rec1 = new Geometry.Polygon.Rectangle(vector1, vector1.Extend(pred.CastPosition, spell2.Range), spell.Width); if (Player.Distance(target) < spell.Range) { var vector2 = pred.CastPosition.Extend(target.ServerPosition, spell2.Range*.3f); Geometry.Polygon.Rectangle rec2 = new Geometry.Polygon.Rectangle(vector2, vector2.Extend(pred.CastPosition, spell2.Range), spell.Width); if ((!rec2.Points.Exists(Util.IsWall) || !wallCheck) && pred.Hitchance >= HitChance.Medium && target.IsMoving) { spell2.UpdateSourcePosition(vector2, vector2); CastLineSpell(vector2, vector2.Extend(pred.CastPosition, spell2.Range)); _lastCast = Utils.TickCount + 500; } } else if (!rec1.Points.Exists(Util.IsWall) || !wallCheck) { //wall check if (pred.Hitchance >= HitChance.High) { CastLineSpell(vector1, pred.CastPosition); } } }
public static void SkillShot(Obj_AI_Base target, Spell spell, HitChance hitChance, bool aoe = false, bool towerCheck = false) { if (!spell.IsReady()) { return; } if (target == null || towerCheck && target.UnderTurret(true)) { return; } spell.UpdateSourcePosition(); var prediction = spell.GetPrediction(target, aoe); if (prediction.Hitchance >= hitChance) { spell.Cast(prediction.CastPosition); } }
public static void CastBestLine(bool forceUlt, Spell spell, Spell spell2, int midPointRange, Menu menu, float extraPrerange = 1, bool wallCheck = true) { if (!spell.IsReady()) return; int maxHit = 0; Vector3 start = Vector3.Zero; Vector3 end = Vector3.Zero; //loop one foreach (var target in ObjectManager.Get<Obj_AI_Hero>().Where(x => x.IsValidTarget(spell.Range))) { //loop 2 var target1 = target; var target2 = target; foreach (var enemy in ObjectManager.Get<Obj_AI_Hero>().Where(x => x.IsValidTarget(spell.Range + spell2.Range) && x.NetworkId != target1.NetworkId && x.Distance(target1.Position) < spell2.Range - 100).OrderByDescending(x => x.Distance(target2.Position))) { int hit = 2; var targetPred = Prediction.GetPrediction(target, spell.Delay); var enemyPred = Prediction.GetPrediction(enemy, spell.Delay); var midpoint = (enemyPred.CastPosition + targetPred.CastPosition) / 2; var startpos = midpoint + Vector3.Normalize(enemyPred.CastPosition - targetPred.CastPosition) * midPointRange; var endPos = midpoint - Vector3.Normalize(enemyPred.CastPosition - targetPred.CastPosition) * midPointRange; Geometry.Polygon.Rectangle rec1 = new Geometry.Polygon.Rectangle(startpos, endPos, spell.Width); if (!rec1.Points.Exists(Util.IsWall) && Player.CountEnemiesInRange(spell.Range + spell2.Range) > 2) { //loop 3 var target3 = target; var enemy1 = enemy; foreach (var enemy2 in ObjectManager.Get<Obj_AI_Hero>().Where(x => x.IsValidTarget(spell.Range + spell2.Range) && x.NetworkId != target3.NetworkId && x.NetworkId != enemy1.NetworkId && x.Distance(target3.Position) < 1000)) { var enemy2Pred = Prediction.GetPrediction(enemy2, spell.Delay); Object[] obj = Util.VectorPointProjectionOnLineSegment(startpos.To2D(), endPos.To2D(), enemy2Pred.CastPosition.To2D()); var isOnseg = (bool)obj[2]; var pointLine = (Vector2)obj[1]; if (pointLine.Distance(enemy2Pred.CastPosition.To2D()) < spell.Width && isOnseg) { hit++; } } } if (hit > maxHit && hit > 1 && !rec1.Points.Exists(Util.IsWall)) { maxHit = hit; start = startpos; end = endPos; } } } if (start != Vector3.Zero && end != Vector3.Zero && spell.IsReady()) { spell2.UpdateSourcePosition(start, start); if (forceUlt) CastLineSpell(start, end); if (menu.Item("ComboActive", true).GetValue<KeyBind>().Active && maxHit >= menu.Item("Line_If_Enemy_Count_Combo", true).GetValue<Slider>().Value) CastLineSpell(start, end); if (maxHit >= menu.Item("Line_If_Enemy_Count", true).GetValue<Slider>().Value) CastLineSpell(start, end); } //check if only one target if (forceUlt) { CastSingleLine(spell, spell2, wallCheck, extraPrerange); } }
public void Cast_BasicLineSkillshot_Enemy(Spell spell, Vector3 sourcePosition, SimpleTs.DamageType damageType = SimpleTs.DamageType.Physical) { if(!spell.IsReady() || !ManaManagerAllowCast(spell)) return; spell.UpdateSourcePosition(sourcePosition, sourcePosition); foreach (var hero in Program.Helper.EnemyTeam .Where(hero => (hero.Distance(sourcePosition) < spell.Range) && hero.IsValidTarget()).Where(hero => spell.GetPrediction(hero).Hitchance >= HitChance.High)) { spell.Cast(hero, Packets()); return; } }
public void Cast_BasicSkillshot_AOE_Farm(Spell spell, int extrawidth = 0) { if(!spell.IsReady()) return; var minions = MinionManager.GetMinions(MyHero.ServerPosition, spell.Type == SkillshotType.SkillshotLine ? spell.Range : spell.Range + ((spell.Width + extrawidth) / 2), MinionTypes.All, MinionTeam.NotAlly); if(minions.Count == 0) return; MinionManager.FarmLocation castPostion; switch(spell.Type) { case SkillshotType.SkillshotCircle: castPostion = MinionManager.GetBestCircularFarmLocation(minions.Select(minion => minion.ServerPosition.To2D()).ToList(), spell.Width + extrawidth, spell.Range); break; case SkillshotType.SkillshotLine: castPostion = MinionManager.GetBestLineFarmLocation( minions.Select(minion => minion.ServerPosition.To2D()).ToList(), spell.Width, spell.Range); break; default: return; } spell.UpdateSourcePosition(); if(castPostion.MinionsHit >= 2 || minions.Any(x => x.Team == GameObjectTeam.Neutral)) spell.Cast(castPostion.Position, UsePackets()); }
public Obj_AI_Hero Cast_BasicSkillshot_Enemy(Spell spell, SimpleTs.DamageType prio = SimpleTs.DamageType.True, float extrarange = 0) { if(!spell.IsReady()) return null; var target = SimpleTs.GetTarget(spell.Range + extrarange, prio); if(target == null) return null; if(!target.IsValidTarget(spell.Range + extrarange) || spell.GetPrediction(target).Hitchance < HitChance.Medium) return null; spell.UpdateSourcePosition(); spell.Cast(target, UsePackets()); return target; }
public static void Farm(Spell spell, int minHit = 2, float overrideWidth = -1f) { if (!spell.IsReady()) { return; } var minions = MinionManager.GetMinions( ObjectManager.Player.ServerPosition, spell.Range, MinionTypes.All, MinionTeam.NotAlly, MinionOrderTypes.MaxHealth).ToList(); if (minions.Count == 0) { return; } if (spell.Type == SkillshotType.SkillshotCircle) { spell.UpdateSourcePosition(); var prediction = spell.GetCircularFarmLocation(minions, overrideWidth); if (prediction.MinionsHit >= minHit) { spell.Cast(prediction.Position); } } else if (spell.Type == SkillshotType.SkillshotLine) { spell.UpdateSourcePosition(); var prediction = spell.GetLineFarmLocation(minions, overrideWidth); if (prediction.MinionsHit >= minHit) { spell.Cast(prediction.Position); } } }
protected void CastBasicFarm(Spell spell) { if(!spell.IsReady()) return; var minion = MinionManager.GetMinions(Player.ServerPosition, spell.Range, MinionTypes.All, MinionTeam.NotAlly); if (minion.Count == 0) return; if (spell.Type == SkillshotType.SkillshotCircle) { spell.UpdateSourcePosition(); var predPosition = spell.GetCircularFarmLocation(minion); if (predPosition.MinionsHit >= 2) { spell.Cast(predPosition.Position, Player.ChampionName == "Kartus" || packets()); } } else if (spell.Type == SkillshotType.SkillshotLine) { spell.UpdateSourcePosition(); var predPosition = spell.GetLineFarmLocation(minion); if(predPosition.MinionsHit >= 2) spell.Cast(predPosition.Position, packets()); } }
protected void CastBasicSkillShot(Spell spell, float range, TargetSelector.DamageType type, HitChance hitChance, bool towerCheck = false) { var target = TargetSelector.GetTarget(range, type); if (target == null || !spell.IsReady()) return; if (towerCheck && target.UnderTurret(true)) return; spell.UpdateSourcePosition(); if (spell.GetPrediction(target).Hitchance >= hitChance) spell.Cast(target, packets()); }