private void Survival() { if (Player.HealthPercent < 60 && (Seraph.IsReady() || Zhonya.IsReady() || CanUse(barrier))) { double dmg = OktwCommon.GetIncomingDamage(Player); var enemys = Player.CountEnemiesInRange(800); if (dmg > 0 || enemys > 0) { if (CanUse(barrier) && Config.Item("Barrier").GetValue <bool>()) { var value = 95 + Player.Level * 20; if (dmg > value && Player.HealthPercent < 50) { Player.Spellbook.CastSpell(barrier, Player); } else if (Player.Health - dmg < enemys * Player.Level * 20) { Player.Spellbook.CastSpell(barrier, Player); } else if (Player.Health - dmg < Player.Level * 10) { Player.Spellbook.CastSpell(barrier, Player); } } if (Seraph.IsReady() && Config.Item("Seraph").GetValue <bool>()) { var value = Player.Mana * 0.2 + 150; if (dmg > value && Player.HealthPercent < 50) { Seraph.Cast(); } else if (Player.Health - dmg < enemys * Player.Level * 20) { Seraph.Cast(); } else if (Player.Health - dmg < Player.Level * 10) { Seraph.Cast(); } } if (Zhonya.IsReady() && Config.Item("Zhonya").GetValue <bool>()) { if (dmg > Player.Level * 35) { ZhonyaTryCast(); } else if (Player.Health - dmg < enemys * Player.Level * 20) { ZhonyaTryCast(); } else if (Player.Health - dmg < Player.Level * 10) { ZhonyaTryCast(); } } } } if (!Solari.IsReady() && !FaceOfTheMountain.IsReady() && !CanUse(heal)) { return; } foreach (var ally in HeroManager.Allies.Where(ally => ally.IsValid && !ally.IsDead && ally.HealthPercent < 50 && Player.Distance(ally.ServerPosition) < 700)) { double dmg = OktwCommon.GetIncomingDamage(ally); if (dmg == 0) { continue; } if (CanUse(heal) && Config.Item("Heal").GetValue <bool>()) { if (!Config.Item("AllyHeal").GetValue <bool>() && !ally.IsMe) { return; } if (ally.Health - dmg < ally.Level * 10) { Player.Spellbook.CastSpell(heal, ally); } else if (ally.Health - dmg < ally.Level * 10) { Player.Spellbook.CastSpell(heal, ally); } } if (Config.Item("Solari").GetValue <bool>() && Solari.IsReady() && Player.Distance(ally.ServerPosition) < Solari.Range) { var value = 75 + (15 * Player.Level); if (dmg > value && Player.HealthPercent < 50) { Solari.Cast(); } else if (ally.Health - dmg < ally.Level * 10) { Solari.Cast(); } else if (ally.Health - dmg < ally.Level * 10) { Solari.Cast(); } } if (Config.Item("FaceOfTheMountain").GetValue <bool>() && FaceOfTheMountain.IsReady() && Player.Distance(ally.ServerPosition) < FaceOfTheMountain.Range) { var value = 0.1 * Player.MaxHealth; if (dmg > value && Player.HealthPercent < 50) { FaceOfTheMountain.Cast(ally); } else if (ally.Health - dmg < ally.Level * 10) { FaceOfTheMountain.Cast(ally); } else if (ally.Health - dmg < ally.Level * 10) { FaceOfTheMountain.Cast(ally); } } } }
private void Survival() { if (Redemption.IsReady() && Config.Item("Redemption").GetValue <bool>()) { var target = HeroManager.Enemies.FirstOrDefault(x => x.IsValidTarget(5000) && x.Position.CountAlliesInRange(600) > 0); if (target != null) { var ally = HeroManager.Allies.FirstOrDefault(x => x.IsValid && !x.IsDead && x.Position.Distance(target.Position) < 400); if (ally != null && ally.Health - OktwCommon.GetIncomingDamage(ally) < ally.MaxHealth * 0.5) { if (target.CountAlliesInRange(600) > 1 || ally.CountEnemiesInRange(600) > 1) { var predInput = new SebbyLib.Prediction.PredictionInput { Aoe = true, Collision = false, Speed = float.MaxValue, Delay = 0.5f, Range = 5500, From = Player.ServerPosition, Radius = 500, Unit = target, Type = SebbyLib.Prediction.SkillshotType.SkillshotCircle }; var pos = SebbyLib.Prediction.Prediction.GetPrediction(predInput); Redemption.Cast(pos.CastPosition); } } } } if (Player.HealthPercent < 60 && (Seraph.IsReady() || Zhonya.IsReady() || CanUse(barrier))) { double dmg = OktwCommon.GetIncomingDamage(Player); var enemys = Player.CountEnemiesInRange(800); if (dmg > 0 || enemys > 0) { if (CanUse(barrier) && Config.Item("Barrier").GetValue <bool>()) { var value = 95 + Player.Level * 20; if (dmg > value && Player.HealthPercent < 50) { Player.Spellbook.CastSpell(barrier, Player); } else if (Player.Health - dmg < enemys * Player.Level * 20) { Player.Spellbook.CastSpell(barrier, Player); } else if (Player.Health - dmg < Player.Level * 10) { Player.Spellbook.CastSpell(barrier, Player); } } if (Seraph.IsReady() && Config.Item("Seraph").GetValue <bool>()) { var value = Player.Mana * 0.2 + 150; if (dmg > value && Player.HealthPercent < 50) { Seraph.Cast(); } else if (Player.Health - dmg < enemys * Player.Level * 20) { Seraph.Cast(); } else if (Player.Health - dmg < Player.Level * 10) { Seraph.Cast(); } } if (Zhonya.IsReady() && Config.Item("Zhonya").GetValue <bool>()) { if (dmg > Player.Level * 35) { ZhonyaTryCast(); } else if (Player.Health - dmg < enemys * Player.Level * 20) { ZhonyaTryCast(); } else if (Player.Health - dmg < Player.Level * 10) { ZhonyaTryCast(); } } } } if (!Solari.IsReady() && !FaceOfTheMountain.IsReady() && !CanUse(heal)) { return; } foreach (var ally in HeroManager.Allies.Where(ally => ally.IsValid && !ally.IsDead && ally.HealthPercent < 50 && Player.Distance(ally.ServerPosition) < 700)) { double dmg = OktwCommon.GetIncomingDamage(ally); if (dmg == 0) { continue; } if (CanUse(heal) && Config.Item("Heal").GetValue <bool>()) { if (!Config.Item("AllyHeal").GetValue <bool>() && !ally.IsMe) { return; } if (ally.Health - dmg < ally.Level * 10) { Player.Spellbook.CastSpell(heal, ally); } else if (ally.Health - dmg < ally.Level * 10) { Player.Spellbook.CastSpell(heal, ally); } } if (Config.Item("Solari").GetValue <bool>() && Solari.IsReady() && Player.Distance(ally.ServerPosition) < Solari.Range) { var value = 75 + (15 * Player.Level); if (dmg > value && Player.HealthPercent < 50) { Solari.Cast(); } else if (ally.Health - dmg < ally.Level * 10) { Solari.Cast(); } else if (ally.Health - dmg < ally.Level * 10) { Solari.Cast(); } } if (Config.Item("FaceOfTheMountain").GetValue <bool>() && FaceOfTheMountain.IsReady() && Player.Distance(ally.ServerPosition) < FaceOfTheMountain.Range) { var value = 0.1 * Player.MaxHealth; if (dmg > value && Player.HealthPercent < 50) { FaceOfTheMountain.Cast(ally); } else if (ally.Health - dmg < ally.Level * 10) { FaceOfTheMountain.Cast(ally); } else if (ally.Health - dmg < ally.Level * 10) { FaceOfTheMountain.Cast(ally); } } } }
public static void Execute() { if (Player.Instance.IsInShopRange() || Player.Instance.CountAlliesInRange(Misc.RangeEnemy) < Misc.EnemyCount || Activator.lastUsed >= Environment.TickCount) { return; } #region Self if (Zhonyas.IsReady() && Zhonyas.IsOwned() && Player.Instance.InDanger(Settings.ZhonyasMyHp) && Settings.Zhonyas) { Zhonyas.Cast(); Activator.lastUsed = Environment.TickCount + 1500; } if (Seraph.IsReady() && Seraph.IsOwned() && Player.Instance.InDanger(Settings.MYHPSeraph) && Settings.UseSeraph) { Seraph.Cast(); Activator.lastUsed = Environment.TickCount + 1500; } if (Talisman.IsReady() && Player.Instance.CountAlliesInRange(450) >= 2 && Talisman.IsOwned() && Player.Instance.InDanger(30)) { Talisman.Cast(); Activator.lastUsed = Environment.TickCount + 1500; } if (Randuin.IsReady() && Player.Instance.CountEnemiesInRange(Randuin.Range) >= 2 && Randuin.IsOwned() && Player.Instance.InDanger(30)) { Randuin.Cast(); Activator.lastUsed = Environment.TickCount + 500; } //Allies if (FaceOfTheMountain.IsReady() && FaceOfTheMountain.IsOwned()) { var allyFace = EntityManager.Heroes.Allies.FirstOrDefault(a => a.InDanger(Settings.AllyHPFaceOfTheMountain)); if (allyFace != null) { FaceOfTheMountain.Cast(allyFace); Activator.lastUsed = Environment.TickCount + 500; } } if (Mikael.IsReady() && Player.Instance.HasCCs() && Mikael.IsOwned()) { var allyMikael = EntityManager.Heroes.Allies.FirstOrDefault(a => a.InDanger(Settings.AllyHPMikaelHeal)); if (allyMikael != null) { Mikael.Cast(allyMikael); Activator.lastUsed = Environment.TickCount + 500; } } if (Solari.IsReady() && Solari.IsOwned()) { var allySolari = EntityManager.Heroes.Allies.FirstOrDefault(a => a.InDanger(Settings.AllyHealthSolari)); if (allySolari != null) { Solari.Cast(); Activator.lastUsed = Environment.TickCount + 1500; } } if (Ohm.IsReady() && Ohm.IsOwned()) { var turret = EntityManager.Turrets.Enemies.FirstOrDefault(t => t.IsAttackingPlayer); var allyFace = EntityManager.Heroes.Allies.FirstOrDefault(a => a.InDanger(Settings.OhmHealth)); if (allyFace != null && turret != null) { Ohm.Cast(turret); Activator.lastUsed = Environment.TickCount + 500; } } //CC if (DerbishBlade.IsReady() && DerbishBlade.IsOwned() && Settings.DerbishBlade && Player.Instance.HasCCs()) { Core.DelayAction(() => DerbishBlade.Cast(), Settings.CleanseDelay); Activator.lastUsed = Environment.TickCount + 1500; } if (Mercurial.IsReady() && Mercurial.IsOwned() && Settings.Mercurial && Player.Instance.HasCCs()) { Core.DelayAction(() => Mercurial.Cast(), Settings.CleanseDelay); Activator.lastUsed = Environment.TickCount + 1500; } if (QuickSilver.IsReady() && QuickSilver.IsOwned() && Settings.QuickSilver && Player.Instance.HasCCs()) { Core.DelayAction(() => QuickSilver.Cast(), Settings.CleanseDelay); Activator.lastUsed = Environment.TickCount + 1500; } var ally = EntityManager.Heroes.Allies.FirstOrDefault(a => a.IsValidTarget(Mikael.Range)); if (ally == null) { return; } if (!ally.HasCCs()) { return; } if (Mikael.IsReady() && Mikael.IsOwned() && Settings.MikaelCleanse) { Core.DelayAction(() => Mikael.Cast(ally), Settings.CleanseDelay); Activator.lastUsed = Environment.TickCount + 1500; } #endregion Self }
public static void Execute() { if (Player.Instance.IsInShopRange() || Player.Instance.CountAlliesInRange(Misc.RangeEnemy) < Misc.EnemyCount || Activator.lastUsed >= Environment.TickCount) { return; } #region Self if (Zhonyas.IsReady() && Zhonyas.IsOwned() && Player.Instance.InDanger(Settings.ZhonyasMyHp) && Settings.Zhonyas) { Zhonyas.Cast(); Activator.lastUsed = Environment.TickCount + 1500; } if (ArchengelStaff.IsReady() && ArchengelStaff.IsOwned() && Player.Instance.InDanger(Settings.MYHPArchengelStaff) && Settings.UseArchengelStaff) { ArchengelStaff.Cast(); Activator.lastUsed = Environment.TickCount + 1500; } if (FaceOfTheMountain.IsReady() && FaceOfTheMountain.IsOwned() && Player.Instance.InDanger(30)) { FaceOfTheMountain.Cast(Player.Instance); Activator.lastUsed = Environment.TickCount + 1500; } if (Talisman.IsReady() && Player.Instance.CountAlliesInRange(450) >= 2 && Talisman.IsOwned() && Player.Instance.InDanger(30)) { Talisman.Cast(); Activator.lastUsed = Environment.TickCount + 1500; } if (Mikael.IsReady() && Player.Instance.HasCC() && Mikael.IsOwned() && Player.Instance.InDanger(30)) { Mikael.Cast(Player.Instance); Activator.lastUsed = Environment.TickCount + 1500; } if (Solari.IsReady() && Solari.IsOwned() && Player.Instance.InDanger(30)) { Solari.Cast(); Activator.lastUsed = Environment.TickCount + 1500; } if (Ohm.IsReady() && Ohm.IsOwned() && Player.Instance.InDanger(30)) { var turret = EntityManager.Turrets.Enemies.FirstOrDefault(t => t.IsAttackingPlayer); if (turret != null) { Ohm.Cast(turret); Activator.lastUsed = Environment.TickCount + 1500; } } if (Randuin.IsReady() && Player.Instance.CountEnemiesInRange(Randuin.Range) >= 2 && Randuin.IsOwned() && Player.Instance.InDanger(30)) { Randuin.Cast(); Activator.lastUsed = Environment.TickCount + 1500; } //CC if (!Player.Instance.HasCC()) { return; } if (DerbishBlade.IsReady() && DerbishBlade.IsOwned()) { DerbishBlade.Cast(); Activator.lastUsed = Environment.TickCount + 1500; } if (Mercurial.IsReady() && Mercurial.IsOwned()) { Mercurial.Cast(); Activator.lastUsed = Environment.TickCount + 1500; } if (QuickSilver.IsReady() && QuickSilver.IsOwned()) { QuickSilver.Cast(); Activator.lastUsed = Environment.TickCount + 1500; } #endregion Self }
public static void Defensive() { //Zhonyas if (ActiveMenu["Zhonyas"].Cast <CheckBox>().CurrentValue) { if (Player.Instance.IsDead) { return; } if ((Player.Instance.CountEnemiesInRange(700) >= 1) && Zhonyas.IsOwned() && Zhonyas.IsReady()) { if (Player.Instance.HealthPercent <= ActiveMenu["Item.ZyHp"].Cast <Slider>().CurrentValue) { Zhonyas.Cast(); } } } //Seraph if (ActiveMenu["Seraph"].Cast <CheckBox>().CurrentValue) { if (Player.Instance.IsDead) { return; } if ((Player.Instance.CountEnemiesInRange(650) >= 1) && Seraph.IsOwned() && Seraph.IsReady()) { if (Player.Instance.HealthPercent <= ActiveMenu["Item.SeraphHp"].Cast <Slider>().CurrentValue) { Seraph.Cast(); } } } //Solari if (ActiveMenu["Solari"].Cast <CheckBox>().CurrentValue) { if (Player.Instance.IsDead) { return; } if ((Player.Instance.CountEnemiesInRange(600) >= 1) && Solari.IsOwned() && Solari.IsReady()) { if (Player.Instance.HealthPercent <= ActiveMenu["Item.SolariHp"].Cast <Slider>().CurrentValue) { Solari.Cast(); } } } //Face var Ally = EntityManager.Heroes.Allies.Where( a => a.HealthPercent <= ActiveMenu["Item.FaceHP"].Cast <Slider>().CurrentValue) .FirstOrDefault(a => a.IsValidTarget(Face.Range)); if (ActiveMenu["Face"].Cast <CheckBox>().CurrentValue) { if (Player.Instance.IsDead) { return; } if (Face.IsOwned() && Face.IsReady() && Ally.IsValid) { Face.Cast(Ally); } } }
protected override void Volatile_ProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args) { if (!sender.IsEnemy) { return; } if (!Solari.IsReady() && !FaceOfTheMountain.IsReady() && !Seraph.IsReady() && !Zhonya.IsReady() && !CanUse(_barrier) && !CanUse(_heal) && !CanUse(_exhaust)) { return; } if (sender.Distance(Player.Position) > 1600) { return; } foreach ( var ally in EntityManager.Heroes.Allies.Where( ally => ally.IsValid && !ally.IsDead && ally.HealthPercent < 51 && Player.Distance(ally.ServerPosition) < 700)) { double dmg = 0; if (args.Target != null && args.Target.NetworkId == ally.NetworkId) { dmg = dmg + ((AIHeroClient)sender).GetSpellDamage(ally, args.Slot); } else { var castArea = ally.Distance(args.End) * (args.End - ally.ServerPosition).Normalized() + ally.ServerPosition; if (castArea.Distance(ally.ServerPosition) < ally.BoundingRadius / 2) { dmg = dmg + ((AIHeroClient)sender).GetSpellDamage(ally, args.Slot); } else { continue; } } if (CanUse(_exhaust) && SummonersMenu["exhaust"].Cast <CheckBox>().CurrentValue) { if (ally.Health - dmg < ally.CountEnemiesInRange(700) * ally.Level * 40) { TryCast(() => Player.Spellbook.CastSpell(_exhaust, sender)); } } if (CanUse(_heal) && SummonersMenu["heal"].Cast <CheckBox>().CurrentValue) { if (SummonersMenu["healteam"].Cast <CheckBox>().CurrentValue&& !ally.IsMe) { return; } if (ally.Health - dmg < ally.CountEnemiesInRange(700) * ally.Level * 10) { TryCast(() => Player.Spellbook.CastSpell(_heal, ally)); } else if (ally.Health - dmg < ally.Level * 10) { TryCast(() => Player.Spellbook.CastSpell(_heal, ally)); } } if (DefensivesMenu["lotis"].Cast <CheckBox>().CurrentValue&& Solari.IsReady() && Player.Distance(ally.ServerPosition) < Solari.Range) { var value = 75 + (15 * Player.Level); if (dmg > value && Player.HealthPercent < 50) { Solari.Cast(); } else if (ally.Health - dmg < ally.CountEnemiesInRange(700) * ally.Level * 15) { Solari.Cast(); } else if (ally.Health - dmg < ally.Level * 10) { Solari.Cast(); } } if (DefensivesMenu["fotm"].Cast <CheckBox>().CurrentValue&& FaceOfTheMountain.IsReady() && Player.Distance(ally.ServerPosition) < FaceOfTheMountain.Range) { var value = 0.1 * Player.MaxHealth; if (dmg > value && Player.HealthPercent < 50) { TryCast(() => FaceOfTheMountain.Cast(ally)); } else if (ally.Health - dmg < ally.CountEnemiesInRange(700) * ally.Level * 15) { TryCast(() => FaceOfTheMountain.Cast(ally)); } else if (ally.Health - dmg < ally.Level * 10) { TryCast(() => FaceOfTheMountain.Cast(ally)); } } if (!ally.IsMe) { continue; } if (CanUse(_barrier) && SummonersMenu["barrier"].Cast <CheckBox>().CurrentValue) { var value = 95 + Player.Level * 20; if (dmg > value && Player.HealthPercent < 50) { TryCast(() => Player.Spellbook.CastSpell(_barrier, Player)); } else if (Player.Health - dmg < Player.CountEnemiesInRange(700) * Player.Level * 15) { TryCast(() => Player.Spellbook.CastSpell(_barrier, Player)); } else if (ally.Health - dmg < ally.Level * 15) { TryCast(() => Seraph.Cast()); } } if (Seraph.IsReady() && DefensivesMenu["se"].Cast <CheckBox>().CurrentValue) { var value = Player.Mana * 0.2 + 150; if (dmg > value && Player.HealthPercent < 50) { TryCast(() => Seraph.Cast()); } else if (ally.Health - dmg < ally.CountEnemiesInRange(700) * ally.Level * 15) { TryCast(() => Seraph.Cast()); } else if (ally.Health - dmg < ally.Level * 15) { TryCast(() => Seraph.Cast()); } } if (Zhonya.IsReady() && DefensivesMenu["zh"].Cast <CheckBox>().CurrentValue) { if (dmg > Player.Level * 30) { TryCast(() => Zhonya.Cast()); } else if (ally.Health - dmg < ally.CountEnemiesInRange(700) * ally.Level * 15) { TryCast(() => Zhonya.Cast()); } else if (ally.Health - dmg < ally.Level * 15) { TryCast(() => Zhonya.Cast()); } } } }