private void castR(EloBuddy.AIHeroClient target) { var inx = rMenu["hitchanceR"].Cast <Slider>().CurrentValue; if (inx == 0) { R.Cast(R.GetPrediction(target).CastPosition); } else if (inx == 1) { R.Cast(target); } else if (inx == 2) { Program.CastSpell(R, target); } else if (inx == 3) { List <Vector2> waypoints = target.GetWaypoints(); if ((Player.LSDistance(waypoints.Last <Vector2>().To3D()) - Player.LSDistance(target.Position)) > 400) { Program.CastSpell(R, target); } } }
private int CountHeroesInRange(EloBuddy.AIHeroClient target, bool checkteam, float range = 1200f) { var objListTeam = EloBuddy.ObjectManager.Get <EloBuddy.AIHeroClient>() .Where( x => x.LSIsValidTarget(range, false)); return(objListTeam.Count(hero => checkteam ? hero.Team != target.Team : hero.Team == target.Team)); }
public static bool IsActiveForHero(EloBuddy.AIHeroClient buddy) { try { return(Menu["cm.cleanser.active.for." + buddy.ChampionName.ToLower()].Cast <CheckBox>().CurrentValue); } catch (Exception) { return(false); } }
private static void CreateCheckboxForHero(EloBuddy.AIHeroClient buddy) { try { Menu.Add("cm.cleanser.active.for." + buddy.ChampionName.ToLower(), new CheckBox("Use on " + buddy.ChampionName)); } catch (Exception) { // Iggnored ( blame Elobuddy SDK for adding all champs double into Entitiemanager ... ) PM me if this is fixed } }
static void Interrupter2_OnInterruptableTarget(EloBuddy.AIHeroClient sender, LeagueSharp.Common.Interrupter2.InterruptableTargetEventArgs args) { if (!Misc["autoEI"].Cast <CheckBox>().CurrentValue) { return; } if (EloBuddy.ObjectManager.Player.LSDistance(sender, true) < _spellE.Range * _spellE.Range) { _spellE.Cast(sender); } }
static bool OkToUlt() { if (Helper.EnemyTeam.Any(x => x.LSDistance(EloBuddy.ObjectManager.Player) < 500)) //any enemies around me? { return(true); } Vector3 mousePos = EloBuddy.Game.CursorPos; var enemiesNearMouse = Helper.EnemyTeam.Where(x => x.LSDistance(EloBuddy.ObjectManager.Player) < _spellR.Range && x.LSDistance(mousePos) < 650); if (enemiesNearMouse.Count() > 0) { if (IsRActive()) //R already active { return(true); } bool enoughMana = EloBuddy.ObjectManager.Player.Mana > EloBuddy.ObjectManager.Player.Spellbook.GetSpell(EloBuddy.SpellSlot.Q).SData.Mana + EloBuddy.ObjectManager.Player.Spellbook.GetSpell(EloBuddy.SpellSlot.E).SData.Mana + EloBuddy.ObjectManager.Player.Spellbook.GetSpell(EloBuddy.SpellSlot.R).SData.Mana; if (ComboM["comboROnlyUserInitiate"].Cast <CheckBox>().CurrentValue || !(_spellQ.IsReady() && _spellE.IsReady()) || !enoughMana) //dont initiate if user doesnt want to, also dont initiate if Q and E isnt ready or not enough mana for QER combo { return(false); } var friendsNearMouse = Helper.OwnTeam.Where(x => x.IsMe || x.LSDistance(mousePos) < 650); //me and friends near mouse (already in fight) if (enemiesNearMouse.Count() == 1) //x vs 1 enemy { EloBuddy.AIHeroClient enemy = enemiesNearMouse.FirstOrDefault(); bool underTower = Utility.UnderTurret(enemy); return(GetComboDamage(enemy) / enemy.Health >= (underTower ? 1.25f : 1)); //if enemy under tower, only initiate if combo damage is >125% of enemy health } else //fight if enemies low health or 2 friends vs 3 enemies and 3 friends vs 3 enemies, but not 2vs4 { int lowHealthEnemies = enemiesNearMouse.Count(x => x.Health / x.MaxHealth <= 0.1); //dont count low health enemies float totalEnemyHealth = enemiesNearMouse.Sum(x => x.Health); return(friendsNearMouse.Count() - (enemiesNearMouse.Count() - lowHealthEnemies) >= -1 || EloBuddy.ObjectManager.Player.Health / totalEnemyHealth >= 0.8); } } return(false); }
private float GetUltTravelTime(EloBuddy.AIHeroClient source, float speed, float delay, Vector3 targetpos) { float distance = Vector3.Distance(source.ServerPosition, targetpos); float missilespeed = speed; if (source.ChampionName == "Jinx" && distance > 1350) { const float accelerationrate = 0.3f; //= (1500f - 1350f) / (2200 - speed), 1 unit = 0.3units/second var acceldifference = distance - 1350f; if (acceldifference > 150f) //it only accelerates 150 units { acceldifference = 150f; } var difference = distance - 1500f; missilespeed = (1350f * speed + acceldifference * (speed + accelerationrate * acceldifference) + difference * 2200f) / distance; } return(distance / missilespeed + delay); }
private bool IsCondemnable(EloBuddy.AIHeroClient hero) { if (!hero.LSIsValidTarget(550f) || hero.HasBuffOfType(EloBuddy.BuffType.SpellShield) || hero.HasBuffOfType(EloBuddy.BuffType.SpellImmunity) || hero.IsDashing()) { return(false); } //values for pred calc pP = player position; p = enemy position; pD = push distance var pP = EloBuddy.ObjectManager.Player.ServerPosition; var p = hero.ServerPosition; var pD = EPushDistanceSlider; var mode = EModeStringList; if (mode == 1 && (IsCollisionable(p.LSExtend(pP, -pD)) || IsCollisionable(p.LSExtend(pP, -pD / 2f)) || IsCollisionable(p.LSExtend(pP, -pD / 3f)))) { if (!hero.CanMove) { return(true); } var enemiesCount = EloBuddy.ObjectManager.Player.CountEnemyHeroesInRange(1200); if (enemiesCount > 1 && enemiesCount <= 3) { var prediction = E.GetPrediction(hero); for (var i = 15; i < pD; i += 75) { if (i > pD) { var lastPosFlags = EloBuddy.NavMesh.GetCollisionFlags( prediction.UnitPosition.ToVector2() .Extend( pP.ToVector2(), -pD) .ToVector3()); if (lastPosFlags.HasFlag(EloBuddy.CollisionFlags.Wall) || lastPosFlags.HasFlag(EloBuddy.CollisionFlags.Building)) { return(true); } return(false); } var posFlags = EloBuddy.NavMesh.GetCollisionFlags( prediction.UnitPosition.ToVector2() .Extend( pP.ToVector2(), -i) .ToVector3()); if (posFlags.HasFlag(EloBuddy.CollisionFlags.Wall) || posFlags.HasFlag(EloBuddy.CollisionFlags.Building)) { return(true); } } return(false); } else { var hitchance = EHitchanceSlider; var angle = 0.20 * hitchance; const float travelDistance = 0.5f; var alpha = new Vector2((float)(p.X + travelDistance * Math.Cos(Math.PI / 180 * angle)), (float)(p.X + travelDistance * Math.Sin(Math.PI / 180 * angle))); var beta = new Vector2((float)(p.X - travelDistance * Math.Cos(Math.PI / 180 * angle)), (float)(p.X - travelDistance * Math.Sin(Math.PI / 180 * angle))); for (var i = 15; i < pD; i += 100) { if (i > pD) { return(false); } if (IsCollisionable(pP.ToVector2().Extend(alpha, i) .ToVector3()) && IsCollisionable(pP.ToVector2().Extend(beta, i).ToVector3())) { return(true); } } return(false); } } if (mode == 2 && (IsCollisionable(p.LSExtend(pP, -pD)) || IsCollisionable(p.LSExtend(pP, -pD / 2f)) || IsCollisionable(p.LSExtend(pP, -pD / 3f)))) { if (!hero.CanMove || (hero.Spellbook.IsAutoAttacking)) { return(true); } var hitchance = EHitchanceSlider; var angle = 0.20 * hitchance; const float travelDistance = 0.5f; var alpha = new Vector2((float)(p.X + travelDistance * Math.Cos(Math.PI / 180 * angle)), (float)(p.X + travelDistance * Math.Sin(Math.PI / 180 * angle))); var beta = new Vector2((float)(p.X - travelDistance * Math.Cos(Math.PI / 180 * angle)), (float)(p.X - travelDistance * Math.Sin(Math.PI / 180 * angle))); for (var i = 15; i < pD; i += 100) { if (i > pD) { return(IsCollisionable(alpha.Extend(pP.ToVector2(), -pD) .ToVector3()) && IsCollisionable(beta.Extend(pP.ToVector2(), -pD).ToVector3())); } if (IsCollisionable(alpha.Extend(pP.ToVector2(), -i) .ToVector3()) && IsCollisionable(beta.Extend(pP.ToVector2(), -i).ToVector3())) { return(true); } } return(false); } if (mode == 9) { if (!hero.CanMove || (hero.Spellbook.IsAutoAttacking)) { return(true); } var hitchance = EHitchanceSlider; var angle = 0.20 * hitchance; const float travelDistance = 0.5f; var alpha = new Vector2((float)(p.X + travelDistance * Math.Cos(Math.PI / 180 * angle)), (float)(p.X + travelDistance * Math.Sin(Math.PI / 180 * angle))); var beta = new Vector2((float)(p.X - travelDistance * Math.Cos(Math.PI / 180 * angle)), (float)(p.X - travelDistance * Math.Sin(Math.PI / 180 * angle))); for (var i = 15; i < pD; i += 100) { if (IsCollisionable(pP.ToVector2().Extend(alpha, i) .ToVector3()) || IsCollisionable(pP.ToVector2().Extend(beta, i).ToVector3())) { return(true); } } return(false); } if (mode == 3) { var prediction = E.GetPrediction(hero); return(EloBuddy.NavMesh.GetCollisionFlags( prediction.UnitPosition.ToVector2() .Extend( pP.ToVector2(), -pD) .ToVector3()).HasFlag(EloBuddy.CollisionFlags.Wall) || EloBuddy.NavMesh.GetCollisionFlags( prediction.UnitPosition.ToVector2() .Extend( pP.ToVector2(), -pD / 2f) .ToVector3()).HasFlag(EloBuddy.CollisionFlags.Wall)); } if (mode == 4) { var prediction = E.GetPrediction(hero); for (var i = 15; i < pD; i += 100) { if (i > pD) { return(false); } var posCF = EloBuddy.NavMesh.GetCollisionFlags( prediction.UnitPosition.ToVector2() .Extend( pP.ToVector2(), -i) .ToVector3()); if (posCF.HasFlag(EloBuddy.CollisionFlags.Wall) || posCF.HasFlag(EloBuddy.CollisionFlags.Building)) { return(true); } } return(false); } if (mode == 5) { var prediction = E.GetPrediction(hero); for (var i = 15; i < pD; i += 75) { var posCF = EloBuddy.NavMesh.GetCollisionFlags( prediction.UnitPosition.ToVector2() .Extend( pP.ToVector2(), -i) .ToVector3()); if (posCF.HasFlag(EloBuddy.CollisionFlags.Wall) || posCF.HasFlag(EloBuddy.CollisionFlags.Building)) { return(true); } } return(false); } if (mode == 6) { var prediction = E.GetPrediction(hero); for (var i = 15; i < pD; i += (int)hero.BoundingRadius) //:frosty: { var posCF = EloBuddy.NavMesh.GetCollisionFlags( prediction.UnitPosition.ToVector2() .Extend( pP.ToVector2(), -i) .ToVector3()); if (posCF.HasFlag(EloBuddy.CollisionFlags.Wall) || posCF.HasFlag(EloBuddy.CollisionFlags.Building)) { return(true); } } return(false); } if (mode == 7) { var prediction = E.GetPrediction(hero); for (var i = 15; i < pD; i += 75) { var posCF = EloBuddy.NavMesh.GetCollisionFlags( prediction.UnitPosition.ToVector2() .Extend( pP.ToVector2(), -i) .ToVector3()); if (posCF.HasFlag(EloBuddy.CollisionFlags.Wall) || posCF.HasFlag(EloBuddy.CollisionFlags.Building)) { return(true); } } return(false); } if (mode == 8 && (IsCollisionable(p.LSExtend(pP, -pD)) || IsCollisionable(p.LSExtend(pP, -pD / 2f)) || IsCollisionable(p.LSExtend(pP, -pD / 3f)))) { return(true); } return(false); }
private bool IsInvulnerable(EloBuddy.AIHeroClient target) { return(target.HasBuffOfType(EloBuddy.BuffType.SpellShield) || target.HasBuffOfType(EloBuddy.BuffType.SpellImmunity)); }
private bool IsKillable(EloBuddy.AIHeroClient hero) { return(EloBuddy.ObjectManager.Player.GetAutoAttackDamage(hero) * 2 < hero.Health); }