//return asap to check the most amount of times bool SecondEChecker(Obj_AI_Hero target) { if (LissUtils.isHealthy() && LissEMissile != null && E.IsReady()) { if (Vector2.Distance(MissilePosition, target.ServerPosition.To2D()) < Vector3.Distance(player.ServerPosition, target.ServerPosition) && !LissUtils.PointUnderEnemyTurret(MissilePosition) && Vector3.Distance(target.ServerPosition, LissEMissile.EndPosition) > Vector3.Distance(player.ServerPosition, target.ServerPosition)) { if (safeGap(LissEMissile.Position.To2D())) { E.Cast(); return(true); } } var Enemiesatpoint = LissEMissile.Position.GetEnemiesInRange(R.Range); var enemiesatpointR = Enemiesatpoint.Count; if ((enemiesatpointR >= 2 && SpellSlot.R.IsReady()) || (Enemiesatpoint.Any(e => IsKillableFromPoint(e, LissEMissile.Position) && Vector3.Distance(LissEMissile.Position, e.ServerPosition) < Vector3.Distance(player.ServerPosition, e.ServerPosition)))) { if (safeGap(LissEMissile.Position.To2D())) { E.Cast(); return(true); } } var enemiesatpointW = LissEMissile.Position.CountEnemiesInRange(W.Range); if (enemiesatpointW >= 2 && SpellSlot.W.IsReady()) { if (safeGap(LissEMissile.Position.To2D())) { E.Cast(); return(true); } } } return(false); }
//return asap to check the most amount of times bool SecondEChecker(AIHeroClient target) { if (LissUtils.isHealthy() && LissEMissile != null && E.IsReady()) { if (Vector2.Distance(MissilePosition, target.ServerPosition.To2D()) < Vector3.Distance(player.ServerPosition, target.ServerPosition) && !LissUtils.PointUnderEnemyTurret(MissilePosition) && Vector3.Distance(target.ServerPosition, LissEMissile.EndPosition) > Vector3.Distance(player.ServerPosition, target.ServerPosition)) { if (safeGap(LissEMissile.Position.To2D())) { E.Cast(); return(true); } } var enemiesatpoint = EntityManager.Heroes.Enemies.Where(x => !x.IsDead && x.IsInRange(ObjectManager.Player.ServerPosition, R.Range)); var enemiesatpointR = enemiesatpoint.Count(); if (enemiesatpointR >= 2 && R.IsReady() || enemiesatpoint.Any(e => IsKillableFromPoint(e, LissEMissile.Position) && Vector3.Distance(LissEMissile.Position, e.ServerPosition) < Vector3.Distance(player.ServerPosition, e.ServerPosition))) { if (safeGap(LissEMissile.Position.To2D())) { E.Cast(); return(true); } } var enemiesatpointW = LissEMissile.Position.CountEnemiesInRange(W.Range); if (enemiesatpointW >= 2 && W.IsReady()) { if (safeGap(LissEMissile.Position.To2D())) { E.Cast(); return(true); } } } return(false); }
bool CastR(AIHeroClient currenttarget) { var check = EntityManager.Heroes.Enemies .Where( h => h.IsValidTarget(R.Range) && h.CountEnemiesInRange(R.Range) >= 2 && h.HealthPercent > 22).ToList(); if (player.CountEnemiesInRange(R.Range) >= 2) { check.Add(player); } if (check.Any()) { if (check.Contains(player) && !LissUtils.isHealthy()) { R.CastOnUnit(player); return(true); } var target = check.FirstOrDefault();//(TargetSelector.GetPriority if (target != null) { R.Cast(target); return(true); } } if (IsKillableFromPoint(currenttarget, player.ServerPosition) && player.Distance(currenttarget) < R.Range) { R.Cast(currenttarget); return(true); } if (LissUtils.PointUnderAllyTurret(currenttarget.ServerPosition)) { R.Cast(currenttarget); return(true); } var dmgto = player.GetSpellDamage(currenttarget, SpellSlot.R); if (dmgto > currenttarget.Health && currenttarget.Health >= 0.40 * dmgto) { R.Cast(currenttarget); return(true); } var enemycount = 2; if (!LissUtils.isHealthy() && player.CountEnemiesInRange(R.Range - 100) >= enemycount) { R.CastOnUnit(player); return(true); } var possibilities = EntityManager.Heroes.Enemies.Where(h => (h.IsValidTarget() && Vector3.Distance(h.ServerPosition, player.ServerPosition) <= R.Range || (IsKillableFromPoint(h, player.ServerPosition) && h.IsValidTarget() && !h.IsInvulnerable))).ToList(); var arranged = possibilities.OrderByDescending(h => h.CountEnemiesInRange(R.Range)); var ultTarget = arranged.FirstOrDefault(); if (ultTarget != null) { if (!LissUtils.isHealthy() && player.CountEnemiesInRange(R.Range) > ultTarget.CountEnemiesInRange(R.Range) + 1) { R.CastOnUnit(player); return(true); } /*if (R.Cast(UltTarget) == Spell..SuccessfullyCasted) * return true;*/ } return(false); }