void usekey(string ab) { switch (ab) { case "heal": heal.UseAbility(); break; case "blink": blink.UseAbility(); break; case "immunity": immunity.UseAbility(); break; } }
private static void UseBlink() { if (!useBlink.GetValue <bool>() || Blink == null || !Blink.CanBeCasted() || Target.Distance2D(Me.Position) < 600 || !Utils.SleepCheck("blink")) { return; } PredictXyz = Target.NetworkActivity == NetworkActivity.Move ? Prediction.InFront(Target, (float)(Target.MovementSpeed * (Game.Ping / 1000 + 0.3 + Target.GetTurnTime(Target)))) : Target.Position; if (Me.Position.Distance2D(PredictXyz) > 1200) { PredictXyz = (PredictXyz - Me.Position) * 1200 / PredictXyz.Distance2D(Me.Position) + Me.Position; } Blink.UseAbility(PredictXyz); Utils.Sleep(500, "blink"); }
private void UpdateManager_IngameUpdate() { var target = TargetSelector.CurrentTarget; if (target == null || !target.IsAlive || target.IsEnchanted()) { return; } if (!OrbWalkerSleeper.Sleeping) { OrbwalkerManager.OrbwalkTo(target, GameManager.MousePosition); OrbWalkerSleeper.Sleep(200); return; } if (AbilitySleeper.Sleeping || localHero.IsRooted()) { return; } var distanceToTarget = localHero.Distance2D(target); var blinkRange = Blink?.Range; //blink logic if (Blink != null && Blink.CanBeCasted()) { if (Roll.CanBeCasted() && blinkRange < distanceToTarget && blinkRange + Roll.Range > distanceToTarget && Blink.UseAbility(target)) { Stone.Sleeper.Sleep(300); Roll.Sleeper.Sleep(300); AbilitySleeper.Sleep(200); return; } if (!Roll.CanBeCasted() && distanceToTarget > blinkRange / 3 && distanceToTarget < blinkRange && Blink.UseAbility(target)) { Stone.Sleeper.Sleep(300); Roll.Sleeper.Sleep(300); AbilitySleeper.Sleep(200); return; } } if (VeilOfDiscord != null && VeilOfDiscord.UseAbility(target)) { AbilitySleeper.Sleep(100); return; } if (Hex != null && Hex.UseAbility(target)) { AbilitySleeper.Sleep(100); return; } if (Abyssal != null && Abyssal.UseAbility(target)) { AbilitySleeper.Sleep(100); return; } if (target.IsMagicImmune()) { return; } var firstStoneNearEnemy = StoneExtensions.FirstUnitInRange(target.Position, StoneExtensions.StoneName, 500); var firstStoneNearHero = StoneExtensions.FirstUnitInRange(localHero.Position, StoneExtensions.StoneName, 250); // roll logic if (Roll.CanBeCasted()) { var rudePredict = target.IsMoving ? target.InFront(150) : target.Position; var prediction = Smash.GetPrediction(target); var distToPredict = prediction.Distance2D(localHero.Position); if (firstStoneNearHero == null && firstStoneNearEnemy == null && !target.IsInvulnerable() && !context.AutoPushInTowerDirection.CanPushInTower && distToPredict < 600f && Grip.CanBeCasted() && Smash.CanBeCasted() && Stone.UseAbility(localHero.Position.Extend(rudePredict, 100))) { Blink?.Sleeper.Sleep(300); Grip.Sleeper.Sleep(distToPredict / Grip.Speed * 1000); Stone.Sleeper.Sleep(500); Roll.Sleeper.Sleep(300 + distToPredict / Grip.Speed * 1000); AbilitySleeper.Sleep(100); return; } var stoneBetween = StoneExtensions.FirstUnitBetween(localHero.Position, rudePredict, StoneExtensions.StoneName, 250, 350); if (firstStoneNearEnemy != null && firstStoneNearEnemy.Distance2D(localHero) < 1000f && stoneBetween == null && Grip.UseAbility(firstStoneNearEnemy.Position)) { Blink?.Sleeper.Sleep(300); AbilitySleeper.Sleep(100); return; } else if (firstStoneNearEnemy == null && distToPredict < 900f && !target.IsInvulnerable() && stoneBetween == null && !localHero.IsInRollPhase() && Grip.CanBeCasted() && Stone.UseAbility(rudePredict)) { Blink?.Sleeper.Sleep(300); Stone.Sleeper.Sleep(500); AbilitySleeper.Sleep(200); return; } if (!localHero.IsInRollPhase() && Roll.UseAbility(target)) { Smash.Sleeper.Sleep(1000); Blink?.Sleeper.Sleep(300); AbilitySleeper.Sleep(800); return; } } var intersectingStone = EntityManager.GetEntities <Unit>() .FirstOrDefault(x => x.Distance2D(target) < Grip.Range && x.Name == StoneExtensions.StoneName && x.IsAlive && StoneExtensions.FirstUnitBetween(localHero.Position, x.Position, target.Name, 200, Grip.Range) == target); if (intersectingStone != null && !target.IsInvulnerable() && Grip.UseAbility(intersectingStone.Position)) { Smash.Sleeper.Sleep(intersectingStone.Distance2D(localHero) / Grip.Speed * 1100); AbilitySleeper.Sleep(200); return; } if (Orchid != null && Orchid.UseAbility(target)) { AbilitySleeper.Sleep(100); return; } if (Halberd != null && Halberd.UseAbility(target)) { AbilitySleeper.Sleep(100); return; } if (Shivas != null && Shivas.UseAbility(target)) { AbilitySleeper.Sleep(100); return; } if (distanceToTarget < Smash.Range * 0.4f && !target.IsInvulnerable() && Smash.UseAbilityOnStone(target)) { AbilitySleeper.Sleep(200); return; } if (distanceToTarget < Smash.Range * 0.4f && !localHero.IsInRollPhase() && !target.IsInvulnerable() && Grip.CanBeCasted() && Smash.CanBeCasted() && Stone.UseAbility()) { Stone.Sleeper.Sleep(300); AbilitySleeper.Sleep(200); return; } if (distanceToTarget < Smash.Range * 0.4f && firstStoneNearHero == null && !target.IsInvulnerable() && (Grip.Base.Cooldown > Smash.Base.CooldownLength || (!Grip.CanBeCasted() && Grip.Base.Cooldown == 0)) && !localHero.IsInRollPhase() && Smash.CanBeCasted() && !context.AutoPushInTowerDirection.CanPushInTower && Stone.UseAbility()) { Stone.Sleeper.Sleep(300); AbilitySleeper.Sleep(100); return; } if (SpiritVessel != null && SpiritVessel.UseAbility(target)) { AbilitySleeper.Sleep(100); return; } }
public override async Task ExecuteAsync(CancellationToken token) { if (TargetSelector.IsActive) { Target = TargetSelector.Active.GetTargets().FirstOrDefault(); } if (Target != null) { if (Output.Unit != null && Output.AoeTargetsHit.Count >= (Config.AmountItem.Value == 1 ? 0 : Config.AmountItem.Value) && (BlackHole == null || !BlackHole.Ability.IsChanneling)) { Elsecount = 0; // Blink if (Blink != null && BlackHole != null && BlackHole.IsReady && Owner.Distance2D(Output.CastPosition) <= Blink.CastRange + (Lens != null ? Lens.GetCastRange() : 0) && Config.ItemsToggler.Value.IsEnabled(Blink.Item.Name) && Blink.CanBeCasted && Owner.Distance2D(Output.CastPosition) >= 400) { Blink.UseAbility(Output.CastPosition); await Await.Delay(Blink.GetCastDelay(Target.Position), token); } if (Blink == null || !Blink.CanBeCasted || !Config.ItemsToggler.Value.IsEnabled(Blink.Item.Name) || Owner.Distance2D(Output.CastPosition) <= 400) { UseItem(token); } // BlackHole if (BlackHole != null && Config.AbilityToggler.Value.IsEnabled(BlackHole.Ability.Name) && BlackHole.CanBeCasted && Elsecount == 6) { BlackHole.UseAbility(Output.CastPosition); await Await.Delay(BlackHole.GetCastDelay(Output.CastPosition), token); } else { Elsecount += 1; } // Refresher if (Refresher != null && Config.ItemsToggler.Value.IsEnabled(Refresher.Item.Name) && Refresher.CanBeCasted && BlackHole != null && !BlackHole.CanBeCasted && !BlackHole.Ability.IsChanneling && Elsecount == 7) { Refresher.UseAbility(); await Await.Delay(Refresher.GetCastDelay(), token); } } if (Target.IsAttackImmune() || Target.IsInvulnerable() && (BlackHole == null || !BlackHole.Ability.IsChanneling)) { Orbwalker.Move(Game.MousePosition); } else if (BlackHole == null || !BlackHole.Ability.IsChanneling) { Orbwalker.OrbwalkTo(Target); } } else if (BlackHole == null || !BlackHole.Ability.IsChanneling) { Orbwalker.Move(Game.MousePosition); } }
private static void Game_OnUpdate(EventArgs args) { _me = ObjectManager.LocalHero; if (!Game.IsInGame || _me == null || _me.ClassID != ClassID.CDOTA_Unit_Hero_Lina) { return; } if (Game.IsPaused || Game.IsChatOpen) { return; } _menuValue = Menu.Item("enabledAbilities").GetValue <AbilityToggler>(); _slider = Menu.Item("distance").GetValue <Slider>().Value; Q = _me.Spellbook.Spell1; W = _me.Spellbook.Spell2; R = _me.Spellbook.Spell4; Dagon = _me.Inventory.Items.FirstOrDefault(item => item.Name.Contains("item_dagon")); Hex = _me.FindItem("item_sheepstick"); Ethereal = _me.FindItem("item_ethereal_blade"); Veil = _me.FindItem("item_veil_of_discord"); Orchid = _me.FindItem("item_orchid"); Shiva = _me.FindItem("item_shivas_guard"); Eul = _me.FindItem("item_cyclone"); Blink = _me.FindItem("item_blink"); if (!Game.IsKeyDown(Menu.Item("Cooombo").GetValue <KeyBind>().Key)) { _targetActive = false; return; } if (!_targetActive) { _target = _me.ClosestToMouseTarget(300); _targetActive = true; } else { var modifHex = _target.Modifiers.Where(y => y.Name == "modifier_sheepstick_debuff") .DefaultIfEmpty(null) .FirstOrDefault(); var modifEul = _target.Modifiers.Where(y => y.Name == "modifier_eul_cyclone").DefaultIfEmpty(null).FirstOrDefault(); if (_target == null || !_target.IsAlive || _target.IsIllusion || _target.IsMagicImmune()) { return; } if (Blink != null && Blink.CanBeCasted() && _me.Distance2D(_target) > _slider + 100 && _menuValue.IsEnabled("item_blink") && Utils.SleepCheck("blink")) { Blink.UseAbility(PositionCalc(_me, _target, _slider)); Utils.Sleep(150 + Game.Ping, "blink"); } else if (Eul != null && Eul.CanBeCasted() && Utils.SleepCheck("eul") && _menuValue.IsEnabled("item_cyclone") && Utils.SleepCheck("blink")) { Eul.UseAbility(_target); Utils.Sleep(4000 + Game.Ping, "eul"); } else if (Eul == null || Eul.Cooldown > 0 || !_menuValue.IsEnabled("item_cyclone")) { if (Orchid != null && Orchid.CanBeCasted() && Utils.SleepCheck("orchid") && modifEul == null && _menuValue.IsEnabled("item_orchid")) { Orchid.UseAbility(_target); Utils.Sleep(150 + Game.Ping, "orchid"); } else if (Shiva != null && Shiva.CanBeCasted() && Utils.SleepCheck("shiva") && modifEul == null && _menuValue.IsEnabled("item_shivas_guard")) { Shiva.UseAbility(); Utils.Sleep(150 + Game.Ping, "shiva"); } else if (Veil != null && Veil.CanBeCasted() && Utils.SleepCheck("veil") && modifEul == null && _menuValue.IsEnabled("item_veil_of_discord")) { Veil.UseAbility(_target.Position); Utils.Sleep(150 + Game.Ping, "veil"); } else if (Ethereal != null && Ethereal.CanBeCasted() && Utils.SleepCheck("ethereal") && modifEul == null && _menuValue.IsEnabled("item_ethereal_blade")) { Ethereal.UseAbility(_target); Utils.Sleep(150 + Game.Ping, "ethereal"); } else if (Dagon != null && Dagon.CanBeCasted() && Utils.SleepCheck("dagon") && modifEul == null) { Dagon.UseAbility(_target); Utils.Sleep(150 + Game.Ping, "dagon"); } else if (Hex != null && Hex.CanBeCasted() && Utils.SleepCheck("hex") && !_target.IsStunned() && Utils.SleepCheck("eul") && _menuValue.IsEnabled("item_sheepstick")) { Hex.UseAbility(_target); Utils.Sleep(150 + Game.Ping, "hex"); } else if (W != null && W.CanBeCasted() && Utils.SleepCheck("w") && (modifEul != null && modifEul.RemainingTime <= W.GetCastDelay(_me, _target, true) + 0.5 || modifHex != null && modifHex.RemainingTime <= W.GetCastDelay(_me, _target, true) + 0.5 || (Hex == null || !_menuValue.IsEnabled("item_sheepstick") || Hex.Cooldown > 0) && (Eul == null || !_menuValue.IsEnabled("item_cyclone") || Eul.Cooldown < 20 && Eul.Cooldown > 0))) { W.UseAbility(W.GetPrediction(_target, W.GetCastDelay(_me, _target))); Utils.Sleep(150 + Game.Ping, "w"); } else if (Q != null && Q.CanBeCasted() && Utils.SleepCheck("q") && modifEul == null) { Q.UseAbility(_target); Utils.Sleep(150 + Game.Ping, "q"); } else if (R != null && R.CanBeCasted() && Utils.SleepCheck("r") && modifEul == null) { R.UseAbility(_target); Utils.Sleep(150 + Game.Ping, "r"); } else if (!_me.IsChanneling() && NothingCanCast() && !_target.IsAttackImmune() && Utils.SleepCheck("attack")) { _me.Attack(_target); Utils.Sleep(1000 + Game.Ping, "attack"); } } } }
public override async Task ExecuteAsync(CancellationToken token) { try { _target = _targetSelector.Active.GetTargets().FirstOrDefault(); var blinkPdValue = _configuration.UseBlink.Item.GetValue <Slider>().Value; if (_target == null || _target.IsAttackImmune() || _target.IsInvulnerable()) { Orbwalker.OrbwalkTo(null); return; } if (_configuration.AbilityManager.Value.IsEnabled(Warcry.Ability.Name) && Warcry.CanBeCasted && Owner.IsInRange(_target, 1500)) { Warcry.UseAbility(); await Await.Delay(Warcry.GetCastDelay(Owner), token); } if (_configuration.AbilityManager.Value.IsEnabled(GodsStrength.Ability.Name) && GodsStrength.CanBeCasted && Owner.IsInRange(_target, 1500)) { GodsStrength.UseAbility(); await Await.Delay(GodsStrength.GetCastDelay(Owner), token); } if (Mjollnir != null && Mjollnir.CanBeCasted && !Owner.IsAttacking() && Owner.IsInRange(_target, 1500) && _configuration.ItemManager.Value.IsEnabled(Mjollnir.Ability.Name)) { Mjollnir.UseAbility(Owner); await Await.Delay(Mjollnir.GetCastDelay(Owner), token); } if (Blink != null && Blink.Item.IsValid && Blink.CanBeCasted && _target != null && Owner.Distance2D(_target) <= 1200 + blinkPdValue && !(Owner.Distance2D(_target) <= 150) && _configuration.ItemManager.Value.IsEnabled(Blink.Ability.Name)) { var l = (Owner.Distance2D(_target) - blinkPdValue) / blinkPdValue; var posA = Owner.Position; var posB = _target.Position; var x = (posA.X + (l * posB.X)) / (1 + l); var y = (posA.Y + (l * posB.Y)) / (1 + l); var position = new Vector3((int)x, (int)y, posA.Z); Blink.UseAbility(position); await Await.Delay(Blink.GetCastDelay(position), token); } if (_configuration.AbilityManager.Value.IsEnabled(Bolt.Ability.Name) && Bolt.CanBeCasted && Owner.IsInRange(_target, 600) && !(_target.IsStunned() || _target.IsHexed())) { Bolt.UseAbility(_target); await Await.Delay(Bolt.GetCastDelay(Owner), token); } if (DiffusalBlade != null && DiffusalBlade.CanBeCasted && !Owner.IsAttacking() && !_target.IsEthereal() && _configuration.ItemManager.Value.IsEnabled(DiffusalBlade.Ability.Name) && !_target.IsMagicImmune() && Owner.IsInRange(_target, 600)) { DiffusalBlade.Ability.UseAbility(_target); await Await.Delay(DiffusalBlade.GetCastDelay(_target), token); } if (Bloodthorn != null && Bloodthorn.CanBeCasted && !Owner.IsAttacking() && !_target.IsMagicImmune() && _configuration.ItemManager.Value.IsEnabled(Bloodthorn.Ability.Name) && Owner.IsInRange(_target, 600) && !_target.IsSilenced()) { Bloodthorn.UseAbility(_target); await Await.Delay(Bloodthorn.GetCastDelay(_target), token); } if (Orchid != null && Orchid.CanBeCasted && !Owner.IsAttacking() && !_target.IsMagicImmune() && _configuration.ItemManager.Value.IsEnabled(Orchid.Ability.Name) && Owner.IsInRange(_target, 600) && !_target.IsSilenced()) { Orchid.UseAbility(_target); await Await.Delay(Orchid.GetCastDelay(_target), token); } if (SheepStick != null && SheepStick.CanBeCasted && !Owner.IsAttacking() && !_target.IsMagicImmune() && _configuration.ItemManagerTwo.Value.IsEnabled(SheepStick.Ability.Name) && !(_target.IsStunned() || _target.IsHexed()) && Owner.IsInRange(_target, 600)) { SheepStick.UseAbility(_target); await Await.Delay(SheepStick.GetCastDelay(_target), token); } if (Mjollnir != null && Mjollnir.CanBeCasted && !Owner.IsAttacking() && _target.IsAttacking() && Owner.IsInRange(_target, 600) && _configuration.ItemManagerTwo.Value.IsEnabled(Mjollnir.Ability.Name)) { Mjollnir.UseAbility(Owner); await Await.Delay(Mjollnir.GetCastDelay(Owner), token); } if (Halberd != null && Halberd.CanBeCasted && !Owner.IsAttacking() && _target.IsAttacking() && Owner.IsInRange(_target, 600) && _configuration.ItemManagerTwo.Value.IsEnabled(Halberd.Ability.Name)) { Halberd.UseAbility(_target); await Await.Delay(Halberd.GetCastDelay(_target), token); } if (Abyssal != null && Abyssal.CanBeCasted && !Owner.IsAttacking() && !(_target.IsStunned() || _target.IsHexed()) && Owner.IsInRange(_target, 600) && _configuration.ItemManagerTwo.Value.IsEnabled(Abyssal.Ability.Name)) { Abyssal.Ability.CastStun(_target); await Await.Delay(Abyssal.GetCastDelay(_target), token); } if (Mask != null && Mask.CanBeCasted && !Owner.IsAttacking() && Owner.IsInRange(_target, 600) && _configuration.ItemManager.Value.IsEnabled(Mask.Ability.Name) && !Bolt.CanBeCasted && !Warcry.CanBeCasted && !GodsStrength.CanBeCasted) { Mask.UseAbility(); await Await.Delay(Mask.GetCastDelay(Owner), token); } if (_target != null && (_target.IsInvulnerable() || _target.IsAttackImmune())) { Orbwalker.Move(Game.MousePosition); } else if (_target != null) { Orbwalker.OrbwalkTo(_target); } else { Orbwalker.Move(Game.MousePosition); } } catch (Exception e) { Log.Error(e); } }