//---------------------------------GetComboDamage(Obj_AI_Hero Target)---------------------------------- static float GetComboDamage(AIHeroClient Target) { if (Target != null) { float ComboDamage = new float(); ComboDamage = Q.IsReady() ? SpellDamage(Target, SpellSlot.Q) : 0; ComboDamage += W.IsReady() ? SpellDamage(Target, SpellSlot.W) : 0; ComboDamage += R.IsReady() ? SpellDamage(Target, SpellSlot.R) : 0; ComboDamage += Player.TotalAttackDamage; if (Ignite != null) { ComboDamage += Convert.ToSingle(Ignite.IsReady() && Ignite.IsInRange(Target) ? DamageLibrary.GetSummonerSpellDamage(Player, Target, DamageLibrary.SummonerSpells.Ignite) : 0); } return(ComboDamage); } return(0); }
//---------------------------------GetComboDamage(Obj_AI_Hero target)---------------------------------- static float GetComboDamage(AIHeroClient target) { if (target != null) { float ComboDamage = new float(); ComboDamage = Q.IsReady() ? SpellDamage(target, SpellSlot.Q) : 0; ComboDamage += SpellDamage(target, SpellSlot.W) * 2; ComboDamage += E.IsReady() ? SpellDamage(target, SpellSlot.E) : 0; ComboDamage += R.IsReady() ? SpellDamage(target, SpellSlot.R) : 0; ComboDamage += Player.TotalAttackDamage; if (Ignite != null) { ComboDamage += Convert.ToSingle(Ignite.IsReady() && Ignite.IsInRange(target) ? DamageLibrary.GetSummonerSpellDamage(Player, target, DamageLibrary.SummonerSpells.Ignite) : 0); } if (Smite != null) { ComboDamage += Convert.ToSingle(Ignite.IsReady() && Smite.Name.Contains("gank") && Ignite.IsInRange(target) ? DamageLibrary.GetSummonerSpellDamage(Player, target, DamageLibrary.SummonerSpells.Smite) : 0); } return(ComboDamage); } return(0); }
private static void Combo() { var target = TargetSelector.GetTarget(/*E.IsReady() ? E.Range + 375 : */ Q.Range, DamageType.Magical); if (target != null && target.IsValidTarget()) { if (E.CanCast(target) && combo.check("CE") && !(combo.check("EIMMO") && target.HaveImmovableBuff())) { var Epred = E.GetSPrediction(target); switch (comb(combo, "CEMODE")) { case 0: var pred1 = SPrediction.Prediction.GetFastUnitPosition(target, 0.75f); if (E.IsInRange(pred1)) { E.Cast(pred1); } else if (pred1.DistanceToPlayer() > E.Range && pred1.DistanceToPlayer() < E.Range + 370f) { E.Cast(myhero.Position.Extend(target.Position, 370f)); } break; case 1: var way = target.GetWaypoints().LastOrDefault(); var wayb = way != null && way.IsValid() ? target.DistanceToPlayer() < way.DistanceToPlayer() : false; var dist = target.HaveImmovableBuff() ? 310f : (target.IsFacing(myhero) ? (target.IsMoving || wayb ? 320f + 0.60f * target.MoveSpeed : 340f) : (target.IsMoving ? 230f - 0.60f * target.MoveSpeed : 260f)); var spot = target.Position.Extend(myhero.Position, dist); if (E.IsInRange(spot)) { E.Cast(spot); } break; case 2: var pred = E.GetAoeSPrediction(); if (pred.HitCount >= slider(combo, "CEAOE")) { E.Cast(pred.CastPosition); } break; } } if (Q.CanCast(target) && combo.check("CQ")) { var Qpred = Q.GetSPrediction(target); var col = Qpred.CollisionResult.Units.Any(x => x.Team != myhero.Team) ? Qpred.CollisionResult.Units.Count(x => x.Team != myhero.Team) < 2 : true; if (col && Qpred.HitChance >= hitQ && Q.Cast(Qpred.CastPosition)) { return; } } if (W.CanCast(target) && combo.check("CW")) { var Wpred = W.GetSPrediction(target); switch (comb(combo, "CWMODE")) { case 0: if (Wpred.HitChance >= hitW || Wpred.HitChance == HitChance.Immobile || (target.HasBuffOfType(BuffType.Slow) && Wpred.HitChance == HitChance.High)) { W.Cast(Wpred.CastPosition); } break; case 1: W.Cast(target.Position); break; case 2: if (target.HaveImmovableBuff()) { W.Cast(Wpred.CastPosition); } break; } } if (combo.check("CR") && R.IsReady() && R.IsInRange(target.Position) && (ComboDamage(target) > target.GetRealHealth(DamageType.Magical) || myhero.GetSpellDamage(target, SpellSlot.R) > target.GetRealHealth(DamageType.Magical)) && /*!target.HasBuff("bansheesveil") &&*/ !target.HasBuff("SamiraW") && !target.HaveSpellShield()) { if ((ComboDamage(target) - myhero.GetSpellDamage(target, SpellSlot.R)) > target.Health) { return; } R.Cast(target); } if (Ignite != null && combo.check("IgniteC") && Ignite.IsReady() && ComboDamage(target) < target.Health && Ignite.IsInRange(target.Position) && myhero.GetSummonerSpellDamage(target, SummonerSpell.Ignite) + ComboDamage(target) > target.Health) { Ignite.Cast(target); } } }
public override void Execute() { // KillSteal if (Settings.KsE && E.IsReady()) { var enemy = EntityManager.Heroes.Enemies.FirstOrDefault(e => !e.IsDead && e.Health > 0 && E.IsInRange(e) && e.IsVisible && !e.IsZombie && !e.IsInvulnerable && e.TotalShieldHealth() < Damages.EDamage(e)); if (enemy != null) { if (!enemy.HasBuffOfType(BuffType.SpellImmunity) && !enemy.HasBuffOfType(BuffType.SpellShield)) { Debug.WriteChat("Casting E in KS on {0}, Enemy HP: {1}", "" + enemy.ChampionName, "" + enemy.Health); E.Cast(enemy); return; } } } if (Settings.KsR && R.IsReady()) { var enemy = EntityManager.Heroes.Enemies.FirstOrDefault( e => !e.IsDead && e.Health > 0 && R.IsInRange(e) && e.IsVisible && !e.IsZombie && !e.IsInvulnerable && e.TotalShieldHealth() < Damages.RDamage(e)); if (enemy != null) { if (!enemy.HasBuffOfType(BuffType.SpellImmunity) && !enemy.HasBuffOfType(BuffType.SpellShield)) { Debug.WriteChat("Casting R in KS on {0}, Enemy HP: {1}", "" + enemy.ChampionName, "" + enemy.Health); R.Cast(); return; } } } if (Settings.KsIgnite && HasIgnite && Ignite.IsReady()) { var enemy = EntityManager.Heroes.Enemies.FirstOrDefault( e => !e.IsDead && e.Health > 0 && Ignite.IsInRange(e) && e.IsVisible && !e.IsZombie && !e.IsInvulnerable && e.TotalShieldHealth() < Damages.IgniteDmg(e)); if (enemy != null) { Debug.WriteChat("Casting Ignite in KS on {0}, Enemy HP: {1}", "" + enemy.ChampionName, "" + enemy.Health); Ignite.Cast(enemy); return; } } // Automatic ult usage if (Settings.AutoR && R.IsReady() && !Player.Instance.IsRecalling()) { var ultableEnemies = EntityManager.Heroes.Enemies.Where(e => R.IsInRange(e) && !e.IsDead && !e.IsZombie && !e.IsInvulnerable).ToList(); if (ultableEnemies.Count() >= Settings.AutoRMinEnemies && Player.Instance.HealthPercent >= Settings.AutoRMinHP) { Debug.WriteChat("AutoCasting R, Enemies in range: {0}", "" + "" + ultableEnemies.Count()); R.Cast(); return; } } // Potion manager if (Settings.Potion && !Player.Instance.IsInShopRange() && Player.Instance.HealthPercent <= Settings.potionMinHP && !(Player.Instance.HasBuff("RegenerationPotion") || Player.Instance.HasBuff("ItemCrystalFlaskJungle") || Player.Instance.HasBuff("ItemMiniRegenPotion") || Player.Instance.HasBuff("ItemCrystalFlask") || Player.Instance.HasBuff("ItemDarkCrystalFlask"))) { if (Item.HasItem(HealthPotion.Id) && Item.CanUseItem(HealthPotion.Id)) { Debug.WriteChat("Using HealthPotion because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent)); HealthPotion.Cast(); return; } if (Item.HasItem(HuntersPotion.Id) && Item.CanUseItem(HuntersPotion.Id)) { Debug.WriteChat("Using HuntersPotion because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent)); HealthPotion.Cast(); return; } if (Item.HasItem(TotalBiscuit.Id) && Item.CanUseItem(TotalBiscuit.Id)) { Debug.WriteChat("Using TotalBiscuitOfRejuvenation because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent)); TotalBiscuit.Cast(); return; } if (Item.HasItem(RefillablePotion.Id) && Item.CanUseItem(RefillablePotion.Id)) { Debug.WriteChat("Using RefillablePotion because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent)); RefillablePotion.Cast(); return; } if (Item.HasItem(CorruptingPotion.Id) && Item.CanUseItem(CorruptingPotion.Id)) { Debug.WriteChat("Using CorruptingPotion because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent)); CorruptingPotion.Cast(); return; } } if (Player.Instance.ManaPercent <= Settings.potionMinMP && !(Player.Instance.HasBuff("RegenerationPotion") || Player.Instance.HasBuff("ItemMiniRegenPotion") || Player.Instance.HasBuff("ItemCrystalFlask") || Player.Instance.HasBuff("ItemDarkCrystalFlask"))) { if (Item.HasItem(CorruptingPotion.Id) && Item.CanUseItem(CorruptingPotion.Id)) { Debug.WriteChat("Using HealthPotion because below {0}% MP - have {1}% MP", String.Format("{0}", Settings.potionMinMP), String.Format("{0:##.##}", Player.Instance.ManaPercent)); CorruptingPotion.Cast(); return; } } }
public override void Execute() { // KillSteal if (Settings.KsQ || Settings.KsE || (Settings.KsIgnite && HasIgnite)) { var enemies = EntityManager.Heroes.Enemies.Where(e => e.IsValidTarget(1500.0f)); if (Settings.KsQ && Q.IsReady()) { var target = enemies.FirstOrDefault(e => Q.IsInRange(e) && e.Health < Damages.QDamage(e)); if (target != null) { if (Orbwalker.AzirSoldiers.Count > 0) { foreach (var soldier in Orbwalker.AzirSoldiers) // Q KS { var pred = Prediction.Position.PredictLinearMissile(target, Q.Range, Q.Width, Q.CastDelay, Q.Speed, Int32.MaxValue, soldier.Position, true); if (pred.HitChance >= SettingsPrediction.MinQHCKillSteal) { Q.Cast(pred.CastPosition.Extend(pred.UnitPosition, 115.0f).To3D()); Debug.WriteChat("Casting Q in KS on {0}, who has {1}HP.", target.ChampionName, target.Health.ToString()); break; } } } else if (Orbwalker.AzirSoldiers.Count == 0 && W.IsReady() && PlayerManaExact >= 110) // WQ KS { var wCastPos = _PlayerPos.Extend(target, W.Range).To3D(); var pred = Prediction.Position.PredictLinearMissile(target, Q.Range, Q.Width, Q.CastDelay, Q.Speed, Int32.MaxValue, wCastPos, true); if (pred.HitChance >= SettingsPrediction.MinQHCKillSteal) { W.Cast(wCastPos); Q.Cast(pred.CastPosition.Extend(pred.UnitPosition, 115.0f).To3D()); Debug.WriteChat("Casting WQ in KS on {0}, who has {1}HP.", target.ChampionName, target.Health.ToString()); } } } } else if (Settings.KsE && E.IsReady()) { var target = enemies.FirstOrDefault(e => E.IsInRange(e) && e.Health < Damages.EDamage(e)); if (target != null) { if (Orbwalker.AzirSoldiers.Count > 0) { foreach (var soldier in Orbwalker.AzirSoldiers) // E KS { if (target.Position.Between(_PlayerPos, soldier.Position)) { E.Cast(); Debug.WriteChat("Casting E in KS on {0}, who has {1}HP.", target.ChampionName, target.Health.ToString()); break; } } } else if (Orbwalker.AzirSoldiers.Count == 0 && W.IsReady() && _PlayerPos.Distance(target) <= W.Range - 50 && PlayerManaExact >= 100) // WE KS { var wCastPos = _PlayerPos.Extend(target, W.Range).To3D(); W.Cast(wCastPos); E.Cast(); Debug.WriteChat("Casting WE in KS on {0}, who has {1}HP.", target.ChampionName, target.Health.ToString()); } } } else if (Settings.KsIgnite && HasIgnite && Ignite.IsReady()) { var target = enemies.FirstOrDefault(e => Ignite.IsInRange(e) && e.Health < Damages.IgniteDmg(e)); if (target != null) { Ignite.Cast(target); Debug.WriteChat("Casting Ignite in KS on {0}, who has {1}HP.", target.ChampionName, target.Health.ToString()); } } } // DashToCursor if (Settings.QWEToCursor) { var cursorPos = Game.CursorPos; var distanceToPlayer = cursorPos.Distance(_PlayerPos); if (E.IsReady() && distanceToPlayer > Orbwalker.HoldRadius) { var soldier = Orbwalker.ValidAzirSoldiers.FirstOrDefault(s => s.Distance(cursorPos) <= 150 && s.Distance(_PlayerPos) < E.Range); if (soldier != null) { E.Cast(); Debug.WriteChat("Dashing to existing soldier."); } else if (PlayerManaExact >= 100 && _PlayerPos.Distance(cursorPos) < W.Range && W.IsReady()) { W.Cast(cursorPos); E.Cast(); Debug.WriteChat("Using WE to dash to location"); } else if (PlayerManaExact >= 170 && _PlayerPos.Distance(cursorPos) < Q.Range - 100 && W.IsReady() && Q.IsReady()) { W.Cast(_PlayerPos.Extend(cursorPos, W.Range).To3D()); Core.DelayAction(() => { E.Cast(); }, 200); Q.Cast(cursorPos); Debug.WriteChat("Using QWE to dash to location"); } else { Orbwalker.MoveTo(cursorPos); } } else { Orbwalker.MoveTo(cursorPos); } } // Potion manager if (Settings.Potion && !Player.Instance.IsInShopRange() && Player.Instance.HealthPercent <= Settings.potionMinHP && !(Player.Instance.HasBuff("RegenerationPotion") || Player.Instance.HasBuff("ItemCrystalFlaskJungle") || Player.Instance.HasBuff("ItemMiniRegenPotion") || Player.Instance.HasBuff("ItemCrystalFlask") || Player.Instance.HasBuff("ItemDarkCrystalFlask"))) { if (Item.HasItem(HealthPotion.Id) && Item.CanUseItem(HealthPotion.Id)) { Debug.WriteChat("Using HealthPotion because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent)); HealthPotion.Cast(); return; } if (Item.HasItem(HuntersPotion.Id) && Item.CanUseItem(HuntersPotion.Id)) { Debug.WriteChat("Using HuntersPotion because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent)); HealthPotion.Cast(); return; } if (Item.HasItem(TotalBiscuit.Id) && Item.CanUseItem(TotalBiscuit.Id)) { Debug.WriteChat("Using TotalBiscuitOfRejuvenation because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent)); TotalBiscuit.Cast(); return; } if (Item.HasItem(RefillablePotion.Id) && Item.CanUseItem(RefillablePotion.Id)) { Debug.WriteChat("Using RefillablePotion because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent)); RefillablePotion.Cast(); return; } if (Item.HasItem(CorruptingPotion.Id) && Item.CanUseItem(CorruptingPotion.Id)) { Debug.WriteChat("Using CorruptingPotion because below {0}% HP - have {1}% HP", String.Format("{0}", Settings.potionMinHP), String.Format("{0:##.##}", Player.Instance.HealthPercent)); CorruptingPotion.Cast(); return; } } if (Player.Instance.ManaPercent <= Settings.potionMinMP && !(Player.Instance.HasBuff("RegenerationPotion") || Player.Instance.HasBuff("ItemMiniRegenPotion") || Player.Instance.HasBuff("ItemCrystalFlask") || Player.Instance.HasBuff("ItemDarkCrystalFlask"))) { if (Item.HasItem(CorruptingPotion.Id) && Item.CanUseItem(CorruptingPotion.Id)) { Debug.WriteChat("Using HealthPotion because below {0}% MP - have {1}% MP", String.Format("{0}", Settings.potionMinMP), String.Format("{0:##.##}", Player.Instance.ManaPercent)); CorruptingPotion.Cast(); } } }
private static void Combo() { var target = TargetSelector.GetTarget(950, DamageType.Physical, Player.Instance.Position); if (target != null && target.ValidTarget(950)) { if (DemSpells.E.CanCast(target) && check(combo, "CE")) { if (check(combo, "EIMMO") && target.HasBuffOfType(BuffType.Stun)) { return; } EDATA.Target = target; var Epred = Prediction.Manager.GetPrediction(EDATA); switch (comb(combo, "CEMODE")) { case 0: if (Epred.RealHitChancePercent >= slider(pred, "EPred")) { DemSpells.E.Cast(Epred.CastPosition); } break; case 1: if (Epred.PredictedPosition.Distance(myhero.Position) < DemSpells.E.Range - 5) { switch (target.IsFleeing) { case true: DemSpells.E.Cast(Epred.PredictedPosition.Shorten(myhero.Position, target.IsMoving ? 200 : 190)); break; case false: DemSpells.E.Cast(Epred.PredictedPosition.Extend(myhero.Position, target.IsMoving ? 200 : 190).To3D()); break; } } break; case 2: Prediction.Manager.PredictionSelected = "SDK Prediction"; if (DemSpells.E.CastIfItWillHit(slider(combo, "CEAOE"))) { return; } break; } } if (DemSpells.Q.CanCast(target) && check(combo, "CQ")) { QDATA.Target = target; var Qpred = Prediction.Manager.GetPrediction(QDATA); if (Qpred.CollisionObjects.Count() < 2 && Qpred.HitChancePercent >= slider(pred, "QPred") && DemSpells.Q.Cast(Qpred.CastPosition)) { return; } } if (DemSpells.W.CanCast(target) && check(combo, "CW")) { WDATA.Target = target; var Wpred = Prediction.Manager.GetPrediction(WDATA); switch (comb(combo, "CWMODE")) { case 0: if (Wpred.RealHitChancePercent >= slider(pred, "WPred") || Wpred.HitChance == HitChance.Immobile || (target.HasBuffOfType(BuffType.Slow) && Wpred.HitChance == HitChance.High)) { DemSpells.W.Cast(Wpred.CastPosition); } break; case 1: DemSpells.W.Cast(target.Position); break; case 2: if (target.HasBuffOfType(BuffType.Stun) || Wpred.HitChance == HitChance.Immobile) { DemSpells.W.Cast(Wpred.CastPosition); } break; } } if (check(combo, "CR") && DemSpells.R.IsReady() && DemSpells.R.IsInRange(target.Position) && ComboDamage(target) > target.Health && RDamage(target) > target.Health && !target.HasBuff("bansheesveil") && !target.HasBuff("fioraw")) { if ((ComboDamage(target) - RDamage(target)) > target.Health) { return; } DemSpells.R.Cast(target); } if (check(combo, "IgniteC") && Ignite.IsReady() && ComboDamage(target) < target.Health && Ignite.IsInRange(target.Position) && myhero.GetSummonerSpellDamage(target, DamageLibrary.SummonerSpells.Ignite) > target.Health && !check(misc, "autoign")) { Ignite.Cast(target); } } }