private static void ImplementationOnPreAttack(object enemy, PreAttackEventArgs events) { var turret = GameObjects.EnemyTurrets.FirstOrDefault(t => !t.IsDead); if (turret.ServerPosition.Distance(Player.ServerPosition) > turret.AttackRange && Player.HasBuff("vaynetumblefade")) { if (Player.CountEnemyHeroesInRange(1200) >= Setup.Combo["Stealth"].As <MenuSlider>().Value) { events.Cancel = true; } if (Player.HasBuff("summonerexhaust")) { events.Cancel = true; } } if (Setup.Misc["FocusW"].As <MenuBool>().Enabled) { var force = TargetSelector.GetOrderedTargets(850).FirstOrDefault(h => h.IsValidTarget() && h.GetRealBuffCount("vaynesilvereddebuff") == 2); if (force != null) { events.Target = force; } } }
public static void OnCastingR() { switch (MenuManager.GetRMode()) { case RMode.Auto: Obj_AI_Hero t1 = TargetSelector.GetTarget(GetRRange()); SpellManager.Get(SpellSlot.R).CastMob(t1); break; case RMode.NearMouse: Obj_AI_Hero t2 = TargetSelector .GetOrderedTargets( GetRRange() ).FirstOrDefault(h => h != null && h.Distance(Game.CursorPos) <= Program.RNearMouseRange); SpellManager.Spells[SpellSlot.R].CastMob(t2); break; case RMode.Tap: Obj_AI_Hero t3 = TargetSelector.GetTarget(GetRRange()); if (Program.TapKeyPressed && SpellManager.Get(SpellSlot.R).CastMob(t3)) { Program.TapKeyPressed = false; } break; } }
private static void Killsteal() { if (Player.ManaPercent() < Setup.Killsteal["M"].As <MenuSlider>().Value) { return; } if (Setup.Killsteal["E"].As <MenuBool>().Enabled&& Spells.E.Ready) { var target = TargetSelector.GetOrderedTargets(Spells.E.Range).FirstOrDefault(x => Player.GetSpellDamage(x, SpellSlot.E) >= x.Health); var pred = Spells.E.GetPrediction(target); if (target.IsValidTarget() && pred.HitChance >= HitChance.High) { Spells.E.Cast(target); } } if (Setup.Killsteal["Q"].As <MenuBool>().Enabled&& Spells.Q.Ready) { var target = TargetSelector.GetOrderedTargets(Spells.Q.Range).FirstOrDefault(x => Player.GetSpellDamage(x, SpellSlot.Q) >= x.Health); var pred = Spells.Q.GetPrediction(target); if (target.IsValidTarget() && pred.HitChance >= HitChance.High) { Spells.Q.Cast(target); } } }
/// <summary> /// Gets the best valid killable enemy hero target in the game inside a determined range. /// </summary> public static AIHeroClient GetBestSortedTarget( DamageType damageType = DamageType.True, bool ignoreShields = false) { var target = TargetSelector.GetOrderedTargets(ObjectCache.EnemyHeroes) .FirstOrDefault(t => !t.IsZombie() && !Invulnerable.Check(t, damageType, ignoreShields)); return(target); }
/// <summary> /// Gets the best valid killable enemy heroes targets in the game inside a determined range. /// </summary> public static IEnumerable <AIHeroClient> GetBestSortedTargetsInRange( float range, DamageType damageType = DamageType.True, bool ignoreShields = false) { var targets = TargetSelector.GetOrderedTargets(ObjectCache.EnemyHeroes) .Where(t => !t.IsZombie() && t.IsValidTarget(range) && !Invulnerable.IsInvulnerable(t, damageType, ignoreShields)); return(targets); }
/// <summary> /// Gets the best valid killable enemy heroes targets in the game inside a determined range. /// </summary> public static IEnumerable <AIHeroClient> GetBestSortedTargetsInRange( float range, DamageType damageType = DamageType.True, bool ignoreShields = false, bool includeBoundingRadius = false) { range = range + (includeBoundingRadius ? UtilityClass.Player.BoundingRadius : 0); var targets = TargetSelector.GetOrderedTargets(ObjectCache.EnemyHeroes) .Where(t => !t.IsZombie() && t.IsValidTarget(range) && !Invulnerable.Check(t, damageType, ignoreShields)); return(targets); }
private static void Combo() { if (MenuManager.Combo["comboR"].As <MenuBool>().Enabled&& SpellManager.R.Ready) { var target = TargetSelector.GetOrderedTargets(MenuManager.Ultimate["ultMinRange"].As <MenuSlider>().Value).FirstOrDefault(x => Player.GetSpellDamage(x, SpellSlot.R) >= x.Health); if (target.IsValidTarget()) { var pred = SpellManager.R.GetPrediction(target); var collisions = pred.CollisionObjects.Count > 7 ? 7 : pred.CollisionObjects.Count; //Can't have the damage reduced by more than 70%. var ultDamage = Player.GetSpellDamage(target, SpellSlot.R); if (collisions > 0) { float multiplier = collisions / 10; ultDamage = ultDamage - (ultDamage * multiplier); } if (ultDamage >= target.Health) { SpellManager.R.Cast(target); } } } if (MenuManager.Combo["comboQ"].As <MenuBool>().Enabled&& SpellManager.Q.Ready) { var target = TargetSelector.GetTarget(SpellManager.Q.Range); var pred = SpellManager.Q.GetPrediction(target); if (target.IsValidTarget() && pred.HitChance >= HitChance.High) { SpellManager.Q.Cast(target); } } if (MenuManager.Combo["comboW"].As <MenuBool>().Enabled&& SpellManager.W.Ready) { var target = TargetSelector.GetTarget(SpellManager.W.Range); var pred = SpellManager.W.GetPrediction(target); if (target.IsValidTarget() && pred.HitChance >= HitChance.High) { SpellManager.W.Cast(target); } } }
private static void HarassEvent() { try { if (HarassMenu["FlowersVladimir.HarassMenu.Q"].Enabled && Q.Ready) { var target = TargetSelector.GetOrderedTargets(Q.Range) .FirstOrDefault( x => HarassMenu["FlowersVladimir.HarassMenu.Target_" + x.ChampionName].Enabled); if (target != null && target.IsValidTarget(Q.Range)) { Q.CastOnUnit(target); } } } catch (Exception ex) { Console.WriteLine("Error in MyEventManager.HarassEvent." + ex); } }
private static void SemiRLogic() { if (R.Ready) { if (Q.IsCharging) { return; } var target = TargetSelector.GetOrderedTargets(R.Range).FirstOrDefault(x => !x.HaveShiledBuff()); if (target.IsValidTarget(R.Range)) { var rPred = R.GetPrediction(target); if (rPred.HitChance >= HitChance.High) { R.Cast(rPred.UnitPosition); } } } }
/// <summary> /// Gets the best valid enemy heroes targets in the game inside a determined range. /// </summary> public static List <AIHeroClient> GetBestEnemyHeroesTargetsInRange(float range) { return(TargetSelector.GetOrderedTargets(ObjectCache.EnemyHeroes).Where(t => t.DistanceToPlayer() < range) .ToList()); }
private static void HarassEvent() { try { if (Me.ManaPercent() >= HarassMenu["FlowersRyze.HarassMenu.Mana"].Value) { if (HarassMenu["FlowersRyze.HarassMenu.Q"].Enabled && Q.Ready && !FullStack) { var minions = GameObjects.EnemyMinions.Where(x => x.IsValidTarget(Q.Range) && (x.IsMinion() || x.IsMob())) .Where( x => x.HasBuff("RyzeE") && x.Health < x.GetRealQDamage() && GameObjects.EnemyHeroes.Any(a => a.Distance(x) <= 290)) .ToArray(); if (minions.Any()) { foreach (var minion in minions.Where(x => x.IsValidTarget(Q.Range))) { if (minion != null && minion.IsValidTarget(Q.Range)) { var qPred = Q.GetPrediction(minion); if (qPred.HitChance >= HitChance.Medium) { Q.Cast(qPred.UnitPosition); } } } } else { var target = TargetSelector.GetTarget(Q.Range); if (target != null && target.IsValidTarget(Q.Range)) { var qPred = Q.GetPrediction(target); if (qPred.HitChance >= HitChance.High) { Q.Cast(qPred.UnitPosition); } } } } if (HarassMenu["FlowersRyze.HarassMenu.E"].Enabled && E.Ready && !HalfStack) { var minions = GameObjects.EnemyMinions.Where(x => x.IsValidTarget(E.Range) && (x.IsMinion() || x.IsMob())) .Where( x => x.Health < E.GetDamage(x) && GameObjects.EnemyHeroes.Any(a => a.Distance(x.Position) <= 290)) .ToArray(); if (minions.Any()) { foreach (var minion in minions.Where(x => x.IsValidTarget(E.Range))) { if (minion != null && minion.IsValidTarget(E.Range)) { E.CastOnUnit(minion); } } } else { var target = TargetSelector.GetTarget(E.Range); if (target != null && target.IsValidTarget(E.Range)) { E.CastOnUnit(target); } } } if (HarassMenu["FlowersRyze.HarassMenu.W"].Enabled && W.Ready && !HalfStack) { var target = TargetSelector.GetOrderedTargets(W.Range).FirstOrDefault(x => x.IsValidTarget(W.Range) && !x.HasBuff("RyzeE")); if (target != null && target.IsValidTarget(W.Range)) { W.CastOnUnit(target); } } } } catch (Exception ex) { Console.WriteLine("Error in MyEventManager.HarassEvent." + ex); } }
internal static Obj_AI_Hero GetTarget(float range) { return (TargetSelector.GetOrderedTargets(range). FirstOrDefault(x => x.IsValidTarget(range) && GetHarassTargetEnabled(x.ChampionName))); }
private static void ComboEvent() { try { var target = TargetSelector.GetOrderedTargets(R.Range).FirstOrDefault(); if (target != null && target.IsValidTarget() && !isEActive) { if (ComboMenu["FlowersVladimir.ComboMenu.Ignite"].Enabled && IgniteSlot != SpellSlot.Unknown && Ignite.Ready && target.IsValidTarget(600) && (target.Health < MyExtraManager.GetComboDamage(target) && target.IsValidTarget(400) || target.Health < Me.GetIgniteDamage(target))) { Ignite.CastOnUnit(target); } if (ComboMenu["FlowersVladimir.ComboMenu.R"].As <MenuKeyBind>().Enabled&& R.Ready && target.IsValidTarget(R.Range)) { if (ComboMenu["FlowersVladimir.ComboMenu.RAlways"].Enabled) { var rPred = R.GetPrediction(target); if (rPred.HitChance >= HitChance.High) { R.Cast(rPred.CastPosition); return; } } if (ComboMenu["FlowersVladimir.ComboMenu.RKillAble"].Enabled && target.Health < R.GetDamage(target)) { var rPred = R.GetPrediction(target); if (rPred.HitChance >= HitChance.High) { R.Cast(rPred.CastPosition); return; } } if (ComboMenu["FlowersVladimir.ComboMenu.RCountHit"].As <MenuSliderBool>().Enabled) { if (R.CastIfWillHit(target, ComboMenu["FlowersVladimir.ComboMenu.RCountHit"].As <MenuSliderBool>().Value)) { return; } } if (ComboMenu["FlowersVladimir.ComboMenu.RBurstCombo"].Enabled && Me.CountEnemyHeroesInRange(600) == 1 && target.IsValidTarget(R.Range)) { if (target.Health < R.GetDamage(target) + E.GetDamage(target) + W.GetDamage(target) * 2 + Q.GetDamage(target) * 2) { var rPred = R.GetPrediction(target); if (rPred.HitChance >= HitChance.High) { R.Cast(rPred.CastPosition); return; } } } } if (ComboMenu["FlowersVladimir.ComboMenu.E"].Enabled && E.Ready && target.IsValidTarget(E.Range)) { if (GameObjects.EnemyHeroes.Any(x => x.IsValidTarget(E.Range) && WillbeHit(x))) { if (isEActive) { if (Game.TickCount - lastETime > 1050 + Game.Ping && !isWActive) { E.Cast(); } } else { Me.SpellBook.CastSpell(SpellSlot.E); } } } if (ComboMenu["FlowersVladimir.ComboMenu.W"].Enabled && W.Ready && target.IsValidTarget(450f)) { if (ComboMenu["FlowersVladimir.ComboMenu.WECharge"].Enabled) { if (isEActive && target.IsValidTarget(450f)) { W.Cast(); } } else { if (!isQActive && target.IsValidTarget(W.Range) && Me.HealthPercent() > 40 && Me.GetSpell(SpellSlot.E).CooldownEnd - Game.ClockTime > 2.3 + Game.Ping / 100) { W.Cast(); } } } if (isEActive || isWActive) { return; } if (ComboMenu["FlowersVladimir.ComboMenu.Q"].Enabled && Q.Ready && target.IsValidTarget(Q.Range)) { Q.CastOnUnit(target); } } } catch (Exception ex) { Console.WriteLine("Error in MyEventManager.ComboEvent." + ex); } }
/// <summary> /// Called on tick update. /// </summary> public void Combo(EntropyEventArgs args) { /// <summary> /// The Q Combo Logic. /// </summary> if (SpellClass.Q.Ready && MenuClass.Q["combo"].Enabled) { var bestTarget = Extensions.GetBestEnemyHeroTargetInRange(SpellClass.Q.Range); if (bestTarget != null && !Invulnerable.Check(bestTarget, DamageType.Magical)) { switch (MenuClass.Q["modes"]["combo"].Value) { case 0: if (!IsNearWorkedGround()) { SpellClass.Q.Cast(bestTarget); } break; case 1: SpellClass.Q.Cast(bestTarget); break; } } } /// <summary> /// The W Combo Logics. /// </summary> if (SpellClass.W.Ready) { /// <summary> /// The W-> E Combo Logic. /// </summary> if (MenuClass.W["boulders"].Enabled) { var bestTargets = TargetSelector.GetOrderedTargets(ObjectCache.EnemyHeroes) .Where(t => MenuClass.W["selection"][t.CharName.ToLower()].Value < 4); var objAiHeroes = bestTargets as AIHeroClient[] ?? bestTargets.ToArray(); foreach (var target in objAiHeroes) { var bestBoulderHitPos = GetBestBouldersHitPosition(target); var bestBoulderHitPosHitBoulders = GetBestBouldersHitPositionHitBoulders(target); if (bestBoulderHitPos != Vector3.Zero && bestBoulderHitPosHitBoulders > 0) { SpellClass.W.Cast(bestBoulderHitPos, SpellClass.W.GetPrediction(target).CastPosition); return; } } } /// <summary> /// The W-> E Combo Logic. /// </summary> if ((SpellClass.E.Ready || !MenuClass.W["customization"]["onlyeready"].Enabled) && MenuClass.W["combo"].Enabled) { var bestTarget = Extensions.GetBestEnemyHeroTargetInRange(SpellClass.W.Range); if (bestTarget != null && !Invulnerable.Check(bestTarget, DamageType.Magical, false)) { switch (MenuClass.Root["pattern"].Value) { case 0: SpellClass.W.Cast(GetTargetPositionAfterW(bestTarget), SpellClass.W.GetPrediction(bestTarget).CastPosition); break; } } } } /// <summary> /// The E Combo Logic. /// </summary> if (SpellClass.E.Ready && MenuClass.E["combo"].Enabled) { if (MenuClass.Root["pattern"].Value == 0) { return; } if (!SpellClass.W.Ready && MenuClass.E["customization"]["onlywready"].Enabled && UtilityClass.Player.Spellbook.GetSpellState(SpellSlot.W) != SpellState.NotLearned) { return; } var bestETarget = Extensions.GetBestEnemyHeroTargetInRange(SpellClass.E.Range - 150f); if (bestETarget != null && !Invulnerable.Check(bestETarget, DamageType.Magical)) { SpellClass.E.Cast(bestETarget.Position); } } }