/// <summary> /// Perform the lane clear function /// </summary> private void OnLaneClear() { var minions = MinionManager.GetMinions(this.spells[SpellSlot.E].Range); if (getCheckBoxItem(laneClearMenu, "useQLC") && this.spells[SpellSlot.Q].IsReady()) { if (getCheckBoxItem(comboMenu, "saveManaR") && this.spells[SpellSlot.R].IsReady() && ObjectManager.Player.Mana < this.spells[SpellSlot.Q].Instance.SData.Mana + this.spells[SpellSlot.R].Instance.SData.Mana) { return; } foreach (var selectedMinion in from selectedMinion in minions let killcount = this.GetCollisionMinions( ObjectManager.Player, ObjectManager.Player.ServerPosition.LSExtend( selectedMinion.ServerPosition, this.spells[SpellSlot.Q].Range)) .Count( collisionMinion => collisionMinion.GetTotalHealth() < this.spells[SpellSlot.Q].GetDamage(collisionMinion)) where killcount >= getSliderItem(laneClearMenu, "minHitQ") where !Orbwalker.IsAutoAttacking && !ObjectManager.Player.IsDashing() select selectedMinion) { this.spells[SpellSlot.Q].Cast(selectedMinion.ServerPosition); } } var harassableMinion = MinionManager.GetMinions(this.spells[SpellSlot.E].Range, MinionTypes.All, MinionTeam.NotAlly) .Where(x => Extensions.IsRendKillable(x)) .OrderBy(x => x.GetTotalHealth()) .FirstOrDefault(); var rendTarget = HeroManager.Enemies.Where( x => this.spells[SpellSlot.E].IsInRange(x) && Extensions.GetRendDamage(x) >= 1 && !x.HasBuffOfType(BuffType.Invulnerability) && !x.HasBuffOfType(BuffType.SpellShield)).OrderByDescending(x => Extensions.GetRendDamage(x)).FirstOrDefault(); if (getCheckBoxItem(laneClearMenu, "minLC") && harassableMinion != null && rendTarget != null && this.spells[SpellSlot.E].CanCast(harassableMinion) && this.spells[SpellSlot.E].CanCast(rendTarget) && Environment.TickCount - this.spells[SpellSlot.E].LastCastAttemptT > 500) { this.spells[SpellSlot.E].Cast(); this.spells[SpellSlot.E].LastCastAttemptT = Environment.TickCount; } if (this.spells[SpellSlot.E].IsReady() && getCheckBoxItem(laneClearMenu, "useELC")) { var count = minions.Count(x => this.spells[SpellSlot.E].CanCast(x) && Extensions.IsRendKillable(x)); if (count >= getSliderItem(laneClearMenu, "eHit") && Environment.TickCount - this.spells[SpellSlot.E].LastCastAttemptT > 500) { this.spells[SpellSlot.E].Cast(); this.spells[SpellSlot.E].LastCastAttemptT = Environment.TickCount; } } }
void Orbwalker_OnUnkillableMinion(Obj_AI_Base target, Orbwalker.UnkillableMinionArgs args) { var killableMinion = target as Obj_AI_Base; if (killableMinion == null || !this.spells[SpellSlot.E].IsReady()) { return; } if (getCheckBoxItem(laneClearMenu, "eUnkillable") && Extensions.GetRendDamage(killableMinion) > killableMinion.GetTotalHealth() + 10 && this.spells[SpellSlot.E].CanCast(killableMinion) && killableMinion.HasBuff("KalistaExpungeMarker")) { this.spells[SpellSlot.E].Cast(); } }
void Orbwalker_OnUnkillableMinion(AttackableUnit minion) { var killableMinion = minion as Obj_AI_Base; if (killableMinion == null || !spells[SpellSlot.E].IsReady()) { return; } if (getCheckBoxItem(laneClearMenu, "eUnkillable") && Extensions.GetRendDamage(killableMinion) > killableMinion.GetTotalHealth() + 10 && spells[SpellSlot.E].CanCast(killableMinion) && killableMinion.HasBuff("KalistaExpungeMarker")) { spells[SpellSlot.E].Cast(); } }
/// <summary> /// Perform the combo /// </summary> private void OnCombo() { if (getCheckBoxItem(miscMenu, "exploit") && ObjectManager.Player.AttackDelay / 1 > 1.70) { foreach (var enemy in HeroManager.Enemies.Where(x => x.IsValidTarget(ObjectManager.Player.AttackRange))) { if (Game.Time * 1000 >= Orbwalker.LastAutoAttack + 1) { EloBuddy.Player.IssueOrder(GameObjectOrder.MoveTo, Game.CursorPos); } if (Game.Time * 1000 > Orbwalker.LastAutoAttack + ObjectManager.Player.AttackDelay * 1000 - 150) { EloBuddy.Player.IssueOrder(GameObjectOrder.AttackUnit, enemy); } } } if (this.spells[SpellSlot.Q].IsReady() && getCheckBoxItem(comboMenu, "useQ") && !ObjectManager.Player.IsDashing() && !Orbwalker.IsAutoAttacking) { foreach (var enemy in HeroManager.Enemies.Where(x => x.IsValidTarget(spells[SpellSlot.Q].Range))) { var prediction = this.spells[SpellSlot.Q].GetSPrediction(enemy); if (prediction.HitChance >= LeagueSharp.Common.HitChance.High) { this.spells[SpellSlot.Q].Cast(prediction.CastPosition); } else if (prediction.HitChance == LeagueSharp.Common.HitChance.Collision) { this.QCollisionCheck(enemy); } } } if (this.spells[SpellSlot.E].IsReady() && getCheckBoxItem(comboMenu, "useE")) { foreach (var enemy in HeroManager.Enemies.Where(x => x.IsValidTarget(spells[SpellSlot.E].Range) && x.HasBuff("KalistaExpungeMarker"))) { var stacks = enemy.GetBuffCount("kalistaexpungemarker"); var damage = Math.Ceiling(Extensions.GetRendDamage(enemy) * 100 / enemy.GetTotalHealth()); if (getCheckBoxItem(comboMenu, "eLeaving") && damage >= getSliderItem(comboMenu, "ePercent") && enemy.HealthPercent > 20 && enemy.ServerPosition.Distance(ObjectManager.Player.ServerPosition, true) > Math.Pow(this.spells[SpellSlot.E].Range * 0.8, 2) && Environment.TickCount - this.spells[SpellSlot.E].LastCastAttemptT > 500) { this.spells[SpellSlot.E].Cast(); this.spells[SpellSlot.E].LastCastAttemptT = Environment.TickCount; } } } }
/// <summary> /// TODO The on update. /// </summary> /// <param name="args"> /// TODO The args. /// </param> private void OnUpdate(EventArgs args) { if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo)) { OnCombo(); } if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Harass)) { OnHarass(); } if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LastHit)) { OnLastHit(); } if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LaneClear) || Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.JungleClear)) { OnLaneClear(); } this.HandleSentinels(); this.KillstealQ(); var enemies = HeroManager.Enemies.Count(x => ObjectManager.Player.Distance(x) <= this.spells[SpellSlot.E].Range); if (getCheckBoxItem(comboMenu, "eDeath") && enemies > 2 && ObjectManager.Player.HealthPercent <= getSliderItem(comboMenu, "eHealth") && this.spells[SpellSlot.E].IsReady()) { var target = HeroManager.Enemies.Where(x => this.spells[SpellSlot.E].IsInRange(x) && x.HasBuff("KalistaExpungeMarker")).OrderBy(x => Extensions.GetRendDamage(x)).FirstOrDefault(); if (target != null) { var stacks = Extensions.GetRendDamage(target); var damage = Math.Ceiling(stacks * 100 / target.GetTotalHealth()); if (damage >= getSliderItem(comboMenu, "eDeathC") && Environment.TickCount - this.spells[SpellSlot.E].LastCastAttemptT > 500) { this.spells[SpellSlot.E].Cast(); this.spells[SpellSlot.E].LastCastAttemptT = Environment.TickCount; } } } if (getCheckBoxItem(miscMenu, "useJungleSteal")) { this.DoMobSteal(); } if (getKeyBindItem(miscMenu, "fleeKey") || Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Flee)) { this.OnFlee(); } var item = new Item(ItemId.Farsight_Alteration); if (getCheckBoxItem(miscMenu, "autoTrinket") && ObjectManager.Player.Level >= 9 && ObjectManager.Player.InShop() && !Items.HasItem((int)ItemId.Farsight_Alteration)) { item.Buy(); } this.HandleBalista(); }
/// <summary> /// Perform the harass function /// </summary> private void OnHarass() { var spearTarget = TargetSelector.GetTarget( this.spells[SpellSlot.Q].Range, DamageType.Physical); if (getCheckBoxItem(harassMenu, "useQH") && this.spells[SpellSlot.Q].IsReady() && !Orbwalker.IsAutoAttacking && !ObjectManager.Player.IsDashing()) { if (getCheckBoxItem(miscMenu, "qMana") && ObjectManager.Player.Mana < this.spells[SpellSlot.Q].Instance.SData.Mana + this.spells[SpellSlot.E].Instance.SData.Mana && this.spells[SpellSlot.Q].GetDamage(spearTarget) < spearTarget.GetTotalHealth()) { return; } if (getCheckBoxItem(comboMenu, "saveManaR") && this.spells[SpellSlot.R].IsReady() && ObjectManager.Player.Mana < this.spells[SpellSlot.Q].Instance.SData.Mana + this.spells[SpellSlot.R].Instance.SData.Mana) { return; } foreach (var unit in HeroManager.Enemies.Where(x => x.IsValidTarget(this.spells[SpellSlot.Q].Range)) .Where(unit => this.spells[SpellSlot.Q].GetSPrediction(unit).HitChance == LeagueSharp.Common.HitChance.Immobile)) { this.spells[SpellSlot.Q].Cast(unit.ServerPosition); } var prediction = this.spells[SpellSlot.Q].GetSPrediction(spearTarget); if (!Orbwalker.IsAutoAttacking && !ObjectManager.Player.IsDashing()) { switch (prediction.HitChance) { case LeagueSharp.Common.HitChance.Collision: this.QCollisionCheck(spearTarget); break; case LeagueSharp.Common.HitChance.High: case LeagueSharp.Common.HitChance.VeryHigh: this.spells[SpellSlot.Q].Cast(prediction.CastPosition); break; } } } if (getCheckBoxItem(harassMenu, "useEH")) { var rendTarget = HeroManager.Enemies.Where( x => x.IsValidTarget(this.spells[SpellSlot.E].Range) && Extensions.GetRendDamage(x) >= 1 && !x.HasBuffOfType(BuffType.Invulnerability) && !x.HasBuffOfType(BuffType.SpellShield)) .OrderByDescending(x => Extensions.GetRendDamage(x)) .FirstOrDefault(); if (rendTarget != null) { var stackCount = rendTarget.GetBuffCount("kalistaexpungemarker"); if (Extensions.IsRendKillable(rendTarget) || stackCount >= getSliderItem(comboMenu, "minStacks")) { if (Environment.TickCount - this.spells[SpellSlot.E].LastCastAttemptT < 500) { return; } this.spells[SpellSlot.E].Cast(); this.spells[SpellSlot.E].LastCastAttemptT = Environment.TickCount; } } } if (getCheckBoxItem(harassMenu, "useEMin")) { var minion = MinionManager.GetMinions(this.spells[SpellSlot.E].Range, MinionTypes.All, MinionTeam.NotAlly) .Where(x => Extensions.IsRendKillable(x)) .OrderBy(x => x.GetTotalHealth()) .FirstOrDefault(); var target = HeroManager.Enemies.Where( x => this.spells[SpellSlot.E].CanCast(x) && Extensions.GetRendDamage(x) >= 1 && !x.HasBuffOfType(BuffType.SpellShield)) .OrderByDescending(x => Extensions.GetRendDamage(x)) .FirstOrDefault(); if (minion != null && target != null && this.spells[SpellSlot.E].CanCast(minion) && this.spells[SpellSlot.E].CanCast(target) && Environment.TickCount - this.spells[SpellSlot.E].LastCastAttemptT > 500) { this.spells[SpellSlot.E].Cast(); this.spells[SpellSlot.E].LastCastAttemptT = Environment.TickCount; } } }
/// <summary> /// Initialize all the events /// </summary> private void InitEvents() { LeagueSharp.Common.Utility.HpBarDamageIndicator.DamageToUnit = Extensions.GetRendDamage; LeagueSharp.Common.Utility.HpBarDamageIndicator.Enabled = true; CustomDamageIndicator.Initialize(Extensions.GetRendDamage); Game.OnUpdate += this.OnUpdate; Obj_AI_Base.OnProcessSpellCast += this.OnProcessSpell; Orbwalker.OnUnkillableMinion += Orbwalker_OnUnkillableMinion; Drawing.OnDraw += args => { if (getCheckBoxItem(drawMenu, "drawQ")) { Render.Circle.DrawCircle(ObjectManager.Player.Position, spells[SpellSlot.Q].Range, Color.FromArgb(150, Color.Red)); } if (getCheckBoxItem(drawMenu, "drawE")) { Render.Circle.DrawCircle(ObjectManager.Player.Position, spells[SpellSlot.E].Range, Color.FromArgb(150, Color.Red)); } CustomDamageIndicator.DrawingColor = Color.FromArgb(150, Color.LawnGreen); if (getCheckBoxItem(drawMenu, "drawPercentage")) { foreach (var source in HeroManager.Enemies.Where(x => ObjectManager.Player.Distance(x) <= 2000f && !x.IsDead)) { var currentPercentage = Extensions.GetRendDamage(source) * 100 / source.GetTotalHealth(); var updatedCurrentPercentage = (int)Math.Ceiling(currentPercentage); Drawing.DrawText( Drawing.WorldToScreen(source.Position)[0], Drawing.WorldToScreen(source.Position)[1], currentPercentage >= 100 ? Color.Gold : Color.White, currentPercentage >= 100 ? "Killable With E" : "Current Damage: " + updatedCurrentPercentage + "%"); } } if (getCheckBoxItem(drawMenu, "drawJunglePercentage")) { foreach (var jungleMobs in ObjectManager.Get <Obj_AI_Minion>().Where(x => ObjectManager.Player.Distance(x) <= spells[SpellSlot.E].Range && !x.IsDead && x.Team == GameObjectTeam.Neutral)) { var currentPercentage = Extensions.GetRendDamage(jungleMobs) * 100 / jungleMobs.GetTotalHealth(); var updatedCurrentPercentage = (int)Math.Ceiling(currentPercentage); var changeby = 40; if (updatedCurrentPercentage >= 0) { switch (jungleMobs.CharData.BaseSkinName) { case "SRU_Razorbeak": Drawing.DrawText(jungleMobs.HPBarPosition.X + 50, jungleMobs.HPBarPosition.Y + changeby, Color.GreenYellow, string.Format("{0}%", updatedCurrentPercentage)); break; case "SRU_Red": Drawing.DrawText(jungleMobs.HPBarPosition.X, jungleMobs.HPBarPosition.Y + changeby, Color.GreenYellow, string.Format("{0}%", updatedCurrentPercentage)); break; case "SRU_Blue": Drawing.DrawText(jungleMobs.HPBarPosition.X, jungleMobs.HPBarPosition.Y + changeby, Color.GreenYellow, string.Format("{0}%", updatedCurrentPercentage)); break; case "SRU_Dragon_Air": case "SRU_Dragon_Water": case "SRU_Dragon_Elder": case "SRU_Dragon_Fire": case "SRU_Dragon_Earth": Drawing.DrawText(jungleMobs.HPBarPosition.X, jungleMobs.HPBarPosition.Y + changeby, Color.GreenYellow, string.Format("{0}%", updatedCurrentPercentage)); break; case "SRU_Baron": Drawing.DrawText(jungleMobs.HPBarPosition.X, jungleMobs.HPBarPosition.Y + changeby, Color.GreenYellow, string.Format("{0}%", updatedCurrentPercentage)); break; case "SRU_Gromp": Drawing.DrawText(jungleMobs.HPBarPosition.X, jungleMobs.HPBarPosition.Y + changeby, Color.GreenYellow, string.Format("{0}%", updatedCurrentPercentage)); break; case "SRU_Krug": Drawing.DrawText(jungleMobs.HPBarPosition.X + 53, jungleMobs.HPBarPosition.Y + changeby, Color.GreenYellow, string.Format("{0}%", updatedCurrentPercentage)); break; case "SRU_Murkwolf": Drawing.DrawText(jungleMobs.HPBarPosition.X + 50, jungleMobs.HPBarPosition.Y + changeby, Color.GreenYellow, string.Format("{0}%", updatedCurrentPercentage)); break; case "Sru_Crab": Drawing.DrawText(jungleMobs.HPBarPosition.X + 50, jungleMobs.HPBarPosition.Y + 20, Color.GreenYellow, string.Format("{0}%", updatedCurrentPercentage)); break; } } } } }; }