public override void Execute() { if (Core.TempestHero != null && Core.TempestHero.Hero.IsAlive) { if (UnitExtensions.HasModifier(Core.TempestHero.Hero, "modifier_teleporting")) { return; } if (UnitExtensions.IsChanneling(Core.TempestHero.Hero)) { return; } if (_sleeper.Sleeping) { return; } _sleeper.Sleep(150); var currentLane = GetLane(Core.TempestHero.Hero); CurrentLane = currentLane; var target = Core.TempestHero.Orbwalker.GetTarget(); if (target == null || target.Position.IsZero || !target.IsAlive) { var path = FindOrGetNeededPath(Core.TempestHero.Hero); var lastPoint = path[path.Count - 1]; var closest = path.Where( x => x.Distance2D(lastPoint) < Core.TempestHero.Hero.Position.Distance2D(lastPoint) - 300) .OrderBy(pos => CheckForDist(pos, Core.TempestHero.Hero)) .FirstOrDefault(); Core.TempestHero.Hero.Move(closest); Status = "Moving"; if (MenuManager.UseTravels) { var travels = Core.TempestHero.Hero.GetItemById(AbilityId.item_travel_boots) ?? Core.TempestHero.Hero.GetItemById(AbilityId.item_travel_boots_2); if (travels != null && travels.CanBeCasted()) { Status = "Moving [?TP]"; var temp = path.ToList(); temp.Reverse(); if (MenuManager.CheckForCreeps) { var enemyCreeps = EntityManager <Creep> .Entities.Where( x => x.IsValid && x.IsVisible && x.IsAlive && x.Team != ObjectManager.LocalHero.Team && Map.GetLane(x) == currentLane); Creep creepForTravels = null; var allyCreeps = EntityManager <Creep> .Entities.Where( allyCreep => allyCreep.IsValid && allyCreep.IsAlive && allyCreep.Team == ObjectManager.LocalHero.Team && Map.GetLane(allyCreep) == currentLane && allyCreep.HealthPercent() > 0.75).ToList(); foreach (var point in temp) { creepForTravels = allyCreeps.FirstOrDefault( allyCreep => point.IsInRange(allyCreep.Position, 1500) && enemyCreeps.Any(z => z.IsInRange(allyCreep, 1500))); if (creepForTravels != null) { break; } } if (creepForTravels != null && creepForTravels.Distance2D(Core.TempestHero.Hero) > 1500) { var point = path[path.Count - 1]; var distance1 = point.Distance2D(creepForTravels); var distance2 = point.Distance2D(Core.TempestHero.Hero); if (distance1 < distance2 || Map.GetLane(Core.TempestHero.Hero) != currentLane) { travels.UseAbility(creepForTravels); Status = "Doing Tp"; _sleeper.Sleep(1000); return; } } } else { var finalPos = temp.First(); var ally = EntityManager <Creep> .Entities.Where( allyCreep => allyCreep.IsValid && allyCreep.IsAlive && allyCreep.Team == ObjectManager.LocalHero.Team && Map.GetLane(allyCreep) == currentLane && allyCreep.HealthPercent() > 0.75) .OrderBy(y => EntityExtensions.Distance2D(y, finalPos)) .FirstOrDefault(); var allyTwr = EntityManager <Tower> .Entities.Where( allyCreep => allyCreep.IsValid && allyCreep.IsAlive && allyCreep.Team == ObjectManager.LocalHero.Team && Map.GetLane(allyCreep) == currentLane && allyCreep.HealthPercent() > 0.1) .OrderBy(y => EntityExtensions.Distance2D(y, finalPos)) .FirstOrDefault(); Unit tpTarget = null; if (ally != null && allyTwr != null) { var dist1 = finalPos.Distance2D(ally); var dist2 = finalPos.Distance2D(allyTwr); if (dist1 > dist2) { tpTarget = allyTwr; } else { tpTarget = ally; } } if (tpTarget != null && tpTarget.Distance2D(Core.TempestHero.Hero) > 1500) { var point = path[path.Count - 1]; var distance1 = point.Distance2D(tpTarget); var distance2 = point.Distance2D(Core.TempestHero.Hero); if (distance1 < distance2 || Map.GetLane(Core.TempestHero.Hero) != currentLane) { travels.UseAbility(tpTarget.Position); _sleeper.Sleep(1000); Status = "Doing Tp"; return; } } } } } try { foreach (var illusion in IllusionManager.GetIllusions) { illusion.Hero.Move(closest); } foreach (var necro in NecronomiconManager.GetNecronomicons) { necro.Necr.Move(closest); } } catch (Exception e) { Printer.Both("kek " + e.Message); } } else { Status = $"Pushing{(target is Tower ? " Tower" : "")}"; if (Core.TempestHero.Spark.CanBeCasted()) { Printer.Log( $"[AutoPushing][Spark][{target.Name} ({target.NetworkName})]->{target.Position.PrintVector()}", true); if (!target.Position.IsZero) { Core.TempestHero.Spark.UseAbility(target.Position); Status = "Casting spark"; _sleeper.Sleep(500); return; } } var itemForPushing = Core.TempestHero.Hero.GetItemById(ItemId.item_mjollnir); if (itemForPushing != null && itemForPushing.CanBeCasted()) { var allyCreep = EntityManager <Creep> .Entities .FirstOrDefault( x => x.IsAlive && x.Team == ObjectManager.LocalHero.Team && x.IsInRange(Core.TempestHero.Hero, 500) && x.HealthPercent() <= 0.92 && x.IsMelee); if (allyCreep != null) { itemForPushing.UseAbility(allyCreep); _sleeper.Sleep(500); } } itemForPushing = Core.TempestHero.Hero.GetItemById(ItemId.item_manta); if (itemForPushing != null && itemForPushing.CanBeCasted()) { itemForPushing.UseAbility(); _sleeper.Sleep(500); } itemForPushing = Core.TempestHero.Hero.GetItemById(ItemId.item_necronomicon) ?? Core.TempestHero.Hero.GetItemById(ItemId.item_necronomicon_2) ?? Core.TempestHero.Hero.GetItemById(ItemId.item_necronomicon_3); if (itemForPushing != null && itemForPushing.CanBeCasted()) { itemForPushing.UseAbility(); _sleeper.Sleep(500); } if (Core.TempestHero.Orbwalker.GetTarget() is Tower) { var field = Core.TempestHero.MagneticField; if (field.CanBeCasted()) { var pos = (Core.TempestHero.Orbwalker.GetTarget().NetworkPosition - Core.TempestHero.Hero.NetworkPosition).Normalized(); pos *= 280 + 150; pos = Core.TempestHero.Orbwalker.GetTarget().NetworkPosition - pos; field.UseAbility(pos); _sleeper.Sleep(1000); } } } if (MenuManager.AutoPushingTargetting) { var enemyHero = Heroes.GetByTeam(ObjectManager.LocalHero.GetEnemyTeam()) .FirstOrDefault( x => x.IsVisible && x.IsAlive && x.IsInRange(Core.TempestHero.Hero, MenuManager .AutoPushingTargettingRange) /*Core.TempestHero.Hero.IsValidOrbwalkingTarget(x)*/); if (enemyHero != null) { //OrderManager.ChangeOrder(OrderManager.Orders.SparkSpamTempest); Core.Target = enemyHero; MenuManager.TempestCombo.SetValue(new KeyBind(MenuManager.TempestCombo.GetValue <KeyBind>().Key, KeyBindType.Toggle, true)); Core.Target = enemyHero; ParticleManager?.Remove("targetting_range"); } else { if (MenuManager.DrawTargettingRange) { ParticleManager.DrawRange(Core.TempestHero.Hero, "targetting_range", MenuManager.AutoPushingTargettingRange, Color.White); } } } } else { Status = "Tempest is dead"; var illusions = IllusionManager.GetIllusions.Where(x => x.Orbwalker.GetTarget() == null).ToList(); var necros = NecronomiconManager.GetNecronomicons.Where(x => x.Orbwalker.GetTarget() == null).ToList(); var any = illusions.Any() || necros.Any(); if (any) { foreach (var illusion in illusions) { var path = FindOrGetNeededPath(illusion.Hero); var lastPoint = path[path.Count - 1]; var closest = path.Where( x => x.Distance2D(lastPoint) < Core.TempestHero.Hero.Position.Distance2D(lastPoint) - 300) .OrderBy(pos => CheckForDist(pos, Core.TempestHero.Hero)) .FirstOrDefault(); illusion.Hero.Move(closest); } foreach (var necro in necros) { var path = FindOrGetNeededPath(necro.Necr); var lastPoint = path[path.Count - 1]; var closest = path.Where( x => x.Distance2D(lastPoint) < Core.TempestHero.Hero.Position.Distance2D(lastPoint) - 300) .OrderBy(pos => CheckForDist(pos, Core.TempestHero.Hero)) .FirstOrDefault(); necro.Necr.Move(closest); } _sleeper.Sleep(500); } } }
// MIDAS ON BEAR BUGGY: If lone druid cooldown = 0 and bear cooldown > 0 there's discrepancy private static void AutoMidas(Unit unit) { if (!ItemKeyItem.GetValue <AbilityToggler>().IsEnabled("item_hand_of_midas") || !unit.IsAlive) { return; } Item midas = unit.FindItem("item_hand_of_midas"); if (midas != null && midas.CanBeCasted()) { Item aether = unit.FindItem("item_aether_lens"); uint castRange = midas.CastRange; if (aether != null) { castRange += 200; } Creep highestHPCreep = ObjectManager.GetEntities <Creep>().Where(x => x.Team != me.Team && x.IsAlive && !x.IsAncient && x.Distance2D(unit) <= (castRange + 200) && x.IsVisible && x.Health > 0 && !x.IsMagicImmune() && x.BaseMovementSpeed > 0 && !x.Name.Contains("npc_dota_necronomicon_warrior") && !x.Name.Contains("npc_dota_necronomicon_archer")).MaxOrDefault(x => x.Health); if (highestHPCreep != null && midas.Cooldown <= 0 && Utils.SleepCheck("Midas") && highestHPCreep.Distance2D(unit) <= castRange && unit.IsAlive) { midas.UseAbility(highestHPCreep); Utils.Sleep(250, "Midas"); } } }
public override void Execute() { if (Core.TempestHero != null && Core.TempestHero.IsAlive) { if (Core.TempestHero.Orbwalker.GetTarget() == null) { ClosestLane = GetClosestLane(); var lastPoint = ClosestLane.Points[ClosestLane.Points.Count - 1]; ClosestLane.ClosestPosition = ClosestLane.Points.Where( x => x.Distance2D(lastPoint) < Core.TempestHero.Hero.Position.Distance2D(lastPoint) - 300) .OrderBy(CheckForDist) .FirstOrDefault(); if (ClosestLane.ClosestPosition != null && !ClosestLane.ClosestPosition.IsZero) { if (MenuManager.UseTravels) { var travels = Core.TempestHero.Hero.GetItemById(AbilityId.item_travel_boots) ?? Core.TempestHero.Hero.GetItemById(AbilityId.item_travel_boots_2); if (travels != null && travels.CanBeCasted() && !_sleeper.Sleeping) { var temp = ClosestLane.Points.ToList(); temp.Reverse(); var enemyCreeps = CreepManager.GetCreepManager() .GetCreeps.Where(x => x.Team != ObjectManager.LocalHero.Team); Creep creepForTravels = null; foreach (var v in temp) { creepForTravels = CreepManager.GetCreepManager() .GetCreeps.FirstOrDefault( y => y.IsValid && y.HealthPercent() > 0.75 && v.IsInRange(y.Position, 1500) && y.Team == ObjectManager.LocalHero.Team && enemyCreeps.Any(z => z.IsInRange(y, 1500))); if (creepForTravels != null) { break; } } if (creepForTravels != null && creepForTravels.Distance2D(Core.TempestHero.Hero) > 1500) { travels.UseAbility(creepForTravels); _sleeper.Sleep(500); } } } if (_sleeper.Sleeping) { return; } _sleeper.Sleep(250); Core.TempestHero.Hero.Move(ClosestLane.ClosestPosition); ClosestPosition = ClosestLane.ClosestPosition; } } else if (!_sleeper.Sleeping) { if (Core.TempestHero.Spark.CanBeCasted()) { Core.TempestHero.Spark.UseAbility(Core.TempestHero.Orbwalker.GetTarget().Position); _sleeper.Sleep(500); } var mjol = Core.TempestHero.Hero.GetItemById(ItemId.item_mjollnir); if (mjol != null && mjol.CanBeCasted()) { var allyCreep = CreepManager.GetCreepManager() .GetCreeps .FirstOrDefault( x => x.Team == ObjectManager.LocalHero.Team && x.IsInRange(Core.TempestHero.Hero, 500) && x.HealthPercent() <= 0.92 && x.IsMelee); if (allyCreep != null) { mjol.UseAbility(allyCreep); _sleeper.Sleep(500); } } if (Core.TempestHero.Orbwalker.GetTarget() is Tower) { var field = Core.TempestHero.MagneticField; if (field.CanBeCasted()) { var pos = (Core.TempestHero.Orbwalker.GetTarget().NetworkPosition - Core.TempestHero.Hero.NetworkPosition).Normalized(); pos *= (280 + 150); pos = Core.TempestHero.Orbwalker.GetTarget().NetworkPosition - pos; field.UseAbility(pos); _sleeper.Sleep(1000); } } } if (MenuManager.AutoPushingTargetting) { var enemyHero = Heroes.GetByTeam(ObjectManager.LocalHero.GetEnemyTeam()) .FirstOrDefault(x => Core.TempestHero.Hero.IsValidOrbwalkingTarget(x)); if (enemyHero != null) { //OrderManager.ChangeOrder(OrderManager.Orders.SparkSpamTempest); Core.Target = enemyHero; MenuManager.TempestCombo.SetValue(new KeyBind(MenuManager.TempestCombo.GetValue <KeyBind>().Key, KeyBindType.Toggle, true)); Core.Target = enemyHero; } } } }
public override void Execute() { if (Core.TempestHero != null && Core.TempestHero.Hero.IsAlive) { if (_sleeper.Sleeping) { return; } if (Core.TempestHero.Orbwalker.GetTarget() == null || Core.TempestHero.Orbwalker.GetTarget().Position.IsZero) { ClosestLane = GetClosestLane(Core.TempestHero.Hero); var lastPoint = ClosestLane.Points[ClosestLane.Points.Count - 1]; ClosestLane.ClosestPosition = ClosestLane.Points.Where( x => x.Distance2D(lastPoint) < Core.TempestHero.Hero.Position.Distance2D(lastPoint) - 300) .OrderBy(pos => CheckForDist(pos, Core.TempestHero.Hero)) .FirstOrDefault(); if (ClosestLane.ClosestPosition != null && !ClosestLane.ClosestPosition.IsZero) { if (MenuManager.UseTravels) { var travels = Core.TempestHero.Hero.GetItemById(AbilityId.item_travel_boots) ?? Core.TempestHero.Hero.GetItemById(AbilityId.item_travel_boots_2); if (travels != null && travels.CanBeCasted() && !_sleeper.Sleeping) { var temp = ClosestLane.Points.ToList(); temp.Reverse(); var enemyCreeps = EntityManager <Creep> .Entities.Where(x => x.IsValid && x.IsVisible && x.IsAlive && x.Team != ObjectManager.LocalHero.Team); Creep creepForTravels = null; foreach (var point in temp) { creepForTravels = EntityManager <Creep> .Entities.FirstOrDefault( allyCreep => allyCreep.IsValid && allyCreep.IsAlive && allyCreep.Team == ObjectManager.LocalHero.Team && allyCreep.HealthPercent() > 0.75 && point.IsInRange(allyCreep.Position, 1500) && enemyCreeps.Any(z => z.IsInRange(allyCreep, 1500))); if (creepForTravels != null) { break; } } if (creepForTravels != null && creepForTravels.Distance2D(Core.TempestHero.Hero) > 1500) { travels.UseAbility(creepForTravels); _sleeper.Sleep(500); } } } Core.TempestHero.Hero.Move(ClosestLane.ClosestPosition); try { foreach (var illusion in IllusionManager.GetIllusions) { illusion.Hero.Move(ClosestLane.ClosestPosition); } foreach (var necro in NecronomiconManager.GetNecronomicons) { necro.Necr.Move(ClosestLane.ClosestPosition); } } catch (Exception e) { Printer.Both("kek " + e.Message); } ClosestPosition = ClosestLane.ClosestPosition; } } else if (!_sleeper.Sleeping) { if (Core.TempestHero.Spark.CanBeCasted()) { var target = Core.TempestHero.Orbwalker.GetTarget(); if (target != null) { Printer.Log($"[AutoPushing][Spark][{target.Name}]->{target.Position.PrintVector()}", true); Core.TempestHero.Spark.UseAbility(target.Position); _sleeper.Sleep(500); } } var itemForPushing = Core.TempestHero.Hero.GetItemById(ItemId.item_mjollnir); if (itemForPushing != null && itemForPushing.CanBeCasted()) { var allyCreep = EntityManager <Creep> .Entities .FirstOrDefault( x => x.IsAlive && x.Team == ObjectManager.LocalHero.Team && x.IsInRange(Core.TempestHero.Hero, 500) && x.HealthPercent() <= 0.92 && x.IsMelee); if (allyCreep != null) { itemForPushing.UseAbility(allyCreep); _sleeper.Sleep(500); } } itemForPushing = Core.TempestHero.Hero.GetItemById(ItemId.item_manta); if (itemForPushing != null && itemForPushing.CanBeCasted()) { itemForPushing.UseAbility(); _sleeper.Sleep(500); } itemForPushing = Core.TempestHero.Hero.GetItemById(ItemId.item_necronomicon) ?? Core.TempestHero.Hero.GetItemById(ItemId.item_necronomicon_2) ?? Core.TempestHero.Hero.GetItemById(ItemId.item_necronomicon_3); if (itemForPushing != null && itemForPushing.CanBeCasted()) { itemForPushing.UseAbility(); _sleeper.Sleep(500); } if (Core.TempestHero.Orbwalker.GetTarget() is Tower) { var field = Core.TempestHero.MagneticField; if (field.CanBeCasted()) { var pos = (Core.TempestHero.Orbwalker.GetTarget().NetworkPosition - Core.TempestHero.Hero.NetworkPosition).Normalized(); pos *= (280 + 150); pos = Core.TempestHero.Orbwalker.GetTarget().NetworkPosition - pos; field.UseAbility(pos); _sleeper.Sleep(1000); } } } if (MenuManager.AutoPushingTargetting) { var enemyHero = Heroes.GetByTeam(ObjectManager.LocalHero.GetEnemyTeam()) .FirstOrDefault(x => Core.TempestHero.Hero.IsValidOrbwalkingTarget(x)); if (enemyHero != null) { //OrderManager.ChangeOrder(OrderManager.Orders.SparkSpamTempest); Core.Target = enemyHero; MenuManager.TempestCombo.SetValue(new KeyBind(MenuManager.TempestCombo.GetValue <KeyBind>().Key, KeyBindType.Toggle, true)); Core.Target = enemyHero; } } _sleeper.Sleep(250); } else { if (_sleeper.Sleeping) { return; } _sleeper.Sleep(400); foreach (var illusion in IllusionManager.GetIllusions.Where(x => x.Orbwalker.GetTarget() == null)) { ClosestLane = GetClosestLane(illusion.Hero); var pushPos = ClosestLane.Points.LastOrDefault(); illusion.Hero.Move(pushPos); } foreach (var necro in NecronomiconManager.GetNecronomicons.Where(x => x.Orbwalker.GetTarget() == null)) { ClosestLane = GetClosestLane(necro.Necr); var pushPos = ClosestLane.Points.LastOrDefault(); necro.Necr.Move(pushPos); } } }