/// <summary> /// The check proc. /// </summary> public void CheckProc() { if (this.ability.Level <= 0) { return; } var onCooldown = Orbwalking.AttackOnCooldown(); if (this.attacked && !onCooldown) { this.attacked = false; } var canCancel = Orbwalking.CanCancelAnimation(); if (!canCancel || !onCooldown || this.attacked) { return; } DelayAction.Add( Game.Ping, () => { if (this.ability.Cooldown > 0) { this.unsuccessfulAttackCount = 1; } else { this.unsuccessfulAttackCount += 1; } }); this.attacked = true; }
public static void Game_OnUpdate(EventArgs args) { if (!OnUpdateChecks.CanUpdate()) { return; } MyHeroInfo.UpdatePosition(); var enemyHeroes = EnemyHeroes.UsableHeroes; var allyHeroes = AllyHeroes.UsableHeroes; GankDamage.UpdateDamage(enemyHeroes, allyHeroes); if (!Me.IsAlive || Me.IsChanneling() || Me.HasModifier("modifier_spirit_breaker_charge_of_darkness") || (MyAbilities.ChargeOfDarkness != null && MyAbilities.ChargeOfDarkness.IsValid && MyAbilities.ChargeOfDarkness.IsInAbilityPhase) || !Utils.SleepCheck("Ability#.Sleep")) { return; } var keyDown = Game.IsKeyDown(MainMenu.ComboKeysMenu.Item("abilityKey1").GetValue <KeyBind>().Key); if (Utils.SleepCheck("cancelorder") || !keyDown) { if (lastOrderPosition != Vector3.Zero && lastActivity == NetworkActivity.Move) { var ctarget = TargetSelector.ClosestToMouse(Me, 150); if (ctarget != null && ctarget.IsValid) { Me.Attack(ctarget); } else { Me.Move(lastOrderPosition); } lastOrderPosition = Vector3.Zero; } } else { lastActivity = Me.NetworkActivity; lastOrderPosition = Game.MousePosition; } var ping = Game.Ping; var invisible = Me.IsInvisible() && Me.ClassID != ClassID.CDOTA_Unit_Hero_Riki && (!Me.HasModifier("modifier_templar_assassin_meld") || !Orbwalking.CanCancelAnimation()); if (!invisible && MainMenu.Menu.Item("Ability#.EnableAutoUsage").GetValue <bool>() && MyAbilities.DefensiveAbilities.Any() && Utils.SleepCheck("casting")) { if (Utils.SleepCheck("Orbwalk.Attack") && allyHeroes.Any(allyHero => FullCombo.DeffensiveAutoUsage(allyHero, Me, enemyHeroes, ping))) { return; } } var targetLock = MainMenu.ComboKeysMenu.Item("Ability.KeyCombo.TargetLock").GetValue <StringList>().SelectedIndex; if (!keyDown) { target = null; } if (Game.IsChatOpen) { return; } var meMissingHp = Me.MaximumHealth - Me.Health; var meMana = Me.Mana; ManageAutoAttack.UpdateAutoAttack(); if (keyDown) { if (Utils.SleepCheck("UpdateTarget") && (target == null || !target.IsValid || !target.IsAlive || !target.IsVisible || (target.IsVisible && targetLock <= 1))) { var mode = MainMenu.ComboKeysMenu.Item("Ability.KeyCombo.Target").GetValue <StringList>().SelectedIndex; target = mode == 0 ? TargetSelector.ClosestToMouse(Me, 2000) : EnemyHeroes.UsableHeroes.Where(x => x.Distance2D(Me) < 2000) .MaxOrDefault(x => x.GetDoableDamage()); Utils.Sleep(250, "UpdateTarget"); } var selectedCombo = MainMenu.ComboKeysMenu.Item("abilityComboType").GetValue <StringList>().SelectedIndex; var combo = false; if (!invisible && target != null && Orbwalking.CanCancelAnimation() && Utils.SleepCheck("Orbwalk.Attack")) { combo = FullCombo.Execute( target, enemyHeroes, ping, selectedCombo == 2, selectedCombo == 1, Me, meMana, selectedCombo == 3); } if (!combo && (target == null || (target.Distance2D(MyHeroInfo.Position) > 500 && Me.HasModifier("modifier_pudge_rot") && !target.HasModifier("modifier_pudge_meat_hook"))) && AllyHeroes.AbilityDictionary.ContainsKey(Me.StoredName())) { foreach (var ability in AllyHeroes.AbilityDictionary[Me.StoredName()].Where(x => x.IsToggled)) { var handle = ability.Handle.ToString(); if (!Utils.SleepCheck(handle)) { continue; } ability.ToggleAbility(); Utils.Sleep(500 + Game.Ping, handle); return; } } if (Me.ClassID == ClassID.CDOTA_Unit_Hero_TemplarAssassin && target != null && target.IsVisible) { var meld = Me.Spellbook.SpellW; if (meld.ManaCost <= meMana && meld.Cooldown >= 0 && meld.Cooldown < UnitDatabase.GetAttackRate(Me) && target.Health > Dictionaries.HitDamageDictionary[target.Handle] * 2) { if (!Utils.SleepCheck("Ability.Move")) { return; } Me.Move(Game.MousePosition); Utils.Sleep(100, "Ability.Move"); return; } } if (combo || !Utils.SleepCheck("GlobalCasting") || (!(Game.MousePosition.Distance2D(Me) > MainMenu.ComboKeysMenu.Item("Ability.KeyCombo.NoMoveRange").GetValue <Slider>().Value) && (target == null || !(Me.Distance2D(target) <= MyHeroInfo.AttackRange() + 100)))) { return; } MoveMode(target); } if (!invisible && MainMenu.Menu.Item("Ability#.EnableAutoKillSteal").GetValue <bool>() && Utils.SleepCheck("casting")) { Variables.Killsteal.FindTarget(enemyHeroes, Me); if (Variables.Killsteal.TryKillsteal(Me, ping, enemyHeroes)) { return; } } if (!invisible && MainMenu.Menu.Item("Ability#.EnableAutoUsage").GetValue <bool>() && Utils.SleepCheck("Orbwalk.Attack") && enemyHeroes.Any( enemyHero => Variables.AutoUsage.Try(enemyHero, enemyHeroes, meMissingHp, ping, Me, meMana))) { return; } }
private static void Game_OnUpdate(EventArgs args) { if (!loaded) { //Orbwalking.Load(); me = ObjectMgr.LocalHero; if (!Game.IsInGame || me == null) { return; } loaded = true; } if (me == null || !me.IsValid) { //Orbwalking.Load(); loaded = false; me = ObjectMgr.LocalHero; if (rangeDisplay == null) { return; } rangeDisplay = null; return; } if (Game.IsPaused) { return; } if (rangeDisplay == null) { rangeDisplay = me.AddParticleEffect(@"particles\ui_mouseactions\range_display.vpcf"); lastRange = me.GetAttackRange() + me.HullRadius + 25; rangeDisplay.SetControlPoint(1, new Vector3(lastRange, 0, 0)); } else { if (lastRange != (me.GetAttackRange() + me.HullRadius + 25)) { lastRange = me.GetAttackRange() + me.HullRadius + 25; rangeDisplay.Dispose(); rangeDisplay = me.AddParticleEffect(@"particles\ui_mouseactions\range_display.vpcf"); rangeDisplay.SetControlPoint(1, new Vector3(lastRange, 0, 0)); } } if (target != null && (!target.IsValid || !target.IsVisible || !target.IsAlive || target.Health <= 0)) { target = null; } var canCancel = Orbwalking.CanCancelAnimation(); if (canCancel) { if (target != null && !target.IsVisible && !Orbwalking.AttackOnCooldown(target)) { target = me.ClosestToMouseTarget(128); } else if (target == null || !Orbwalking.AttackOnCooldown(target)) { var bestAa = me.BestAATarget(); if (bestAa != null) { target = me.BestAATarget(); } } if (Game.IsKeyDown(FarmKey) && (creepTarget == null || !creepTarget.IsValid || !creepTarget.IsVisible || !creepTarget.IsAlive || creepTarget.Health <= 0 || !Orbwalking.AttackOnCooldown(creepTarget))) { creepTarget = TargetSelector.GetLowestHPCreep(me); } } if (Game.IsChatOpen) { return; } if (Game.IsKeyDown(FarmKey)) { Orbwalking.Orbwalk(creepTarget); } if (Game.IsKeyDown(ChaseKey)) { Orbwalking.Orbwalk(target, attackmodifiers: true); } if (Game.IsKeyDown(KiteKey)) { Orbwalking.Orbwalk( target, attackmodifiers: true, bonusRange: (float)(UnitDatabase.GetAttackRate(me) * 1000)); } }
private static void Game_OnUpdate(EventArgs args) { if (!loaded) { me = ObjectMgr.LocalHero; if (!Game.IsInGame || me == null || me.ClassID != ClassID.CDOTA_Unit_Hero_Ursa) { return; } earthshock = me.Spellbook.Spell1; overpower = me.Spellbook.SpellW; enrage = me.FindSpell("ursa_enrage"); blink = me.FindItem("item_blink"); abyssalBlade = me.FindItem("item_abyssal_blade"); scytheOfVyse = me.FindItem("item_sheepstick"); loaded = true; Game.PrintMessage( "<font color='#3377ff'>UrsaRage</font>: GL HF <font face='Tahoma' size='9'>(GUYS<font color='#ff9900'></font>)</font>", MessageType.ChatMessage); } if (!Game.IsInGame || me == null) { overpowerCastPoint = 0; earthshockCastPoint = 0; loaded = false; me = null; target = null; earthshock = null; overpower = null; enrage = null; abyssalBlade = null; scytheOfVyse = null; blink = null; return; } if (!menuvalueSet) { menuValue = Menu.Item("enabledAbilities").GetValue <AbilityToggler>(); menuvalueSet = true; //Utils.Sleep(100000, "updateMenuValue"); } if (Game.IsPaused) { return; } if (blink == null) { blink = me.FindItem("item_blink"); } if (abyssalBlade == null) { abyssalBlade = me.FindItem("item_abyssal_blade"); } if (abyssalBlade == null) { abyssalBlade = me.FindItem("item_sheepstick"); } if (earthshock == null) { earthshock = me.Spellbook.Spell1; } else if (earthshockCastPoint == 0) { earthshockCastPoint = 0.3; } if (overpower == null) { overpower = me.Spellbook.SpellW; } else if (overpowerCastPoint == 0) { overpowerCastPoint = 0.3; } if (enrage == null) { enrage = me.FindSpell("ursa_enrage"); } if (!Menu.Item("comboKey").GetValue <KeyBind>().Active || Game.IsChatOpen) { target = null; return; } if (Utils.SleepCheck("blink")) { mePosition = me.Position; } if (earthshock.IsInAbilityPhase && (target == null || !target.IsAlive || target.Distance2D(me) > earthshock.GetAbilityData("shock_radius"))) { me.Stop(); if (target != null) { me.Attack(target); } } if (overpower.IsInAbilityPhase && (target == null || !target.IsAlive)) { me.Stop(); if (target != null) { me.Attack(target); } } var range = 1000f; var mousePosition = Game.MousePosition; if (blink != null) { blinkRange = blink.AbilityData.FirstOrDefault(x => x.Name == "blink_range").GetValue(0); range = blinkRange + me.HullRadius + 500; } var canCancel = (Orbwalking.CanCancelAnimation() && Orbwalking.AttackOnCooldown(target)) || (!Orbwalking.AttackOnCooldown(target) && (targetDistance > 350 || (target != null && !target.IsVisible))) || target == null; if (canCancel) { if (target != null && !target.IsVisible) { if (!Menu.Item("lockTarget").GetValue <bool>()) { var closestToMouse = me.ClosestToMouseTarget(128); if (closestToMouse != null) { target = me.ClosestToMouseTarget(range); } } } else { var index = Menu.Item("targetSelecting").GetValue <StringList>().SelectedIndex; target = index == 0 ? me.BestAATarget(blinkRange) : me.ClosestToMouseTarget(); } } if (target == null || !target.IsAlive || ((!target.IsVisible || target.Distance2D(mousePosition) > target.Distance2D(me) + 1000) && canCancel)) { if (!Utils.SleepCheck("move")) { return; } me.Move(mousePosition); Utils.Sleep(100, "move"); return; } targetDistance = mePosition.Distance2D(target); hullsum = (me.HullRadius + target.HullRadius) * 2; turnTime = me.GetTurnTime(target); var casting = CastCombo(); if (casting) { return; } if (!Utils.SleepCheck("casting")) { return; } OrbWalk(Orbwalking.CanCancelAnimation()); }
public static async void Game_OnUpdate(EventArgs args) { if (!Game.IsInGame || Game.IsPaused || Game.IsWatchingGame) return; me = ObjectManager.LocalHero; if (me == null || me.ClassID != ClassID.CDOTA_Unit_Hero_Slark) return; if (darkPact == null) darkPact = me.Spellbook.SpellQ; if (pounce == null) pounce = me.Spellbook.SpellW; if (shadowDance == null) shadowDance = me.Spellbook.SpellR; if (bkb == null) bkb = me.FindItem("item_black_king_bar"); if (orchid == null) orchid = me.FindItem("item_orchid"); if (abyssalBlade == null) abyssalBlade = me.FindItem("item_abyssal_blade"); var invisModif = me.Modifiers.Any(x => x.Name == "modifier_item_silver_edge_windwalk" || x.Name == "modifier_item_invisibility_edge_windwalk"); if (Menu.Item("sdtog").GetValue<bool>() && me.IsAlive && me.CanCast() && !me.IsChanneling()) { if (shadowDance != null && shadowDance.IsValid && shadowDance.CanBeCasted() && me.Health <= me.MaximumHealth / 100 * Menu.Item("sdhealth").GetValue<Slider>().Value && Utils.SleepCheck("shadowDance")) { shadowDance.UseAbility(); Utils.Sleep(200, "shadowDance"); } } if (autoKillz && Menu.Item("enable").GetValue<bool>()) { target = me.ClosestToMouseTarget(1001); if (target != null && (!target.IsValid || !target.IsVisible || !target.IsAlive || target.Health <= 0)) { target = null; } var canCancel = Orbwalking.CanCancelAnimation(); if (canCancel) { if (target != null && !target.IsVisible && !Orbwalking.AttackOnCooldown(target)) { target = me.ClosestToMouseTarget(); } else if (target == null || !Orbwalking.AttackOnCooldown(target) && target.HasModifiers(new[] { "modifier_dazzle_shallow_grave", "modifier_item_blade_mail_reflect", }, false)) { var bestAa = me.BestAATarget(); if (bestAa != null) { target = me.BestAATarget(); } } } if (target != null && target.IsAlive && !target.IsInvul() && !target.IsIllusion) { if (me.CanCast() && !me.IsChanneling()) { if (!invisModif) { if (!Utils.SleepCheck("attacking")) Orbwalking.Orbwalk(target, Game.Ping); Utils.Sleep(200, "attacking"); } if (pounce != null && pounce.CanBeCasted())//change this to leap name fo cause bcz cus cause. D: { if (target.NetworkActivity == NetworkActivity.Move) { var VectorOfMovement = new Vector2((float)Math.Cos(target.RotationRad) * target.MovementSpeed, (float)Math.Sin(target.RotationRad) * target.MovementSpeed); var HitPosition = Interception(target.Position, VectorOfMovement, me.Position, 933.33f); var HitPosMod = HitPosition + new Vector3(VectorOfMovement.X * (TimeToTurn(me, HitPosition)), VectorOfMovement.Y * (TimeToTurn(me, HitPosition)), 0); var HitPosMod2 = HitPosition + new Vector3(VectorOfMovement.X * (TimeToTurn(me, HitPosMod)), VectorOfMovement.Y * (TimeToTurn(me, HitPosMod)), 0); if (GetDistance2D(me, HitPosMod2) > (755 + target.HullRadius)) { return; } if (IsFacing(me, HitPosMod2)) { pounce.UseAbility(); trying = true; await Task.Delay(400); //Avoid trying to pounce multiple times. trying = false; } else { me.Move((HitPosMod2 - me.Position) * 50 / (float)GetDistance2D(HitPosMod2, me) + me.Position); } } else { if (GetDistance2D(me, target) > (755 + target.HullRadius)) { return; } if (IsFacing(me, target)) { pounce.UseAbility(); trying = true; await Task.Delay(400); trying = false; } else { me.Move((target.Position - me.Position) * 50 / (float)GetDistance2D(target, me) + me.Position); } } } if (darkPact != null && darkPact.CanBeCasted() && darkPact.CanHit(target) && Utils.SleepCheck("darkPact")) { darkPact.UseAbility(); Utils.Sleep(200, "darkPact"); } if (bkb != null && bkb.IsValid && bkb.CanBeCasted() && GetDistance2D(me, target) <= 300 && Utils.SleepCheck("bkb")) { bkb.UseAbility(); Utils.Sleep(150 + Game.Ping, "bkb"); } if (abyssalBlade != null && abyssalBlade.IsValid && abyssalBlade.CanBeCasted() && Utils.SleepCheck("abyssalBlade")) { abyssalBlade.CastStun(target); Utils.Sleep(250 + Game.Ping, "abyssalBlade"); } if (orchid != null && orchid.IsValid && orchid.CanBeCasted() && Utils.SleepCheck("orchid")) { orchid.CastStun(target); Utils.Sleep(250 + Game.Ping, "orchid"); } } } } }
private static void Game_OnUpdate(EventArgs args) { if (!loaded) { me = ObjectMgr.LocalHero; if (!Game.IsInGame || Game.IsWatchingGame || me == null || me.ClassID != ClassID.CDOTA_Unit_Hero_Huskar) { return; } loaded = true; // Spells spellQ = me.Spellbook.SpellQ; spellR = me.Spellbook.SpellR; //Aghs = me.FindItem("item_ultimate_scepter"); } if (me == null || !me.IsValid) { loaded = false; me = ObjectMgr.LocalHero; if (rangeDisplay == null) { return; } rangeDisplay = null; return; } if (Game.IsPaused) { return; } // Items Urn = me.FindItem("item_urn_of_shadows"); Abyssal = me.FindItem("item_abyssal_blade"); Blademail = me.FindItem("item_blade_mail"); Mjollnir = me.FindItem("item_mjollnir"); Orchid = me.FindItem("item_orchid"); Halberd = me.FindItem("item_heavens_halberd"); Satanic = me.FindItem("item_satanic"); Hex = me.FindItem("item_sheepstick"); Medallion = me.FindItem("item_medallion_of_courage"); SolarCrest = me.FindItem("item_solar_crest"); Blink = me.FindItem("item_blink"); Armlet = me.FindItem("item_armlet"); if (rangeDisplay == null) { rangeDisplay = me.AddParticleEffect(@"particles\ui_mouseactions\range_display.vpcf"); lastRange = me.GetAttackRange() + me.HullRadius + 25; rangeDisplay.SetControlPoint(1, new Vector3(lastRange, 0, 0)); } else { if (lastRange != (me.GetAttackRange() + me.HullRadius + 25)) { lastRange = me.GetAttackRange() + me.HullRadius + 25; rangeDisplay.Dispose(); rangeDisplay = me.AddParticleEffect(@"particles\ui_mouseactions\range_display.vpcf"); rangeDisplay.SetControlPoint(1, new Vector3(lastRange, 0, 0)); } } if (target != null && (!target.IsValid || !target.IsVisible || !target.IsAlive || target.Health <= 0)) { target = null; } var canCancel = Orbwalking.CanCancelAnimation(); if (canCancel) { if (target != null && !target.IsVisible && !Orbwalking.AttackOnCooldown(target)) { target = me.ClosestToMouseTarget(); } else if (target == null || !Orbwalking.AttackOnCooldown(target)) { var bestAa = me.BestAATarget(); if (bestAa != null) { target = me.BestAATarget(); } } } if (Game.IsChatOpen) { return; } if (Game.IsKeyDown(ComboKey)) { if (Armlet != null && me.CanUseItems()) { var enemiesInRange = ObjectMgr.GetEntities <Hero>() .Where(x => me.Distance2D(x) <= lastRange && x.IsAlive && x.Team != me.Team).ToList(); var projectiles = ObjectMgr.Projectiles.Where( x => x.Target != null && x.Target == me && (me.Distance2D(x.Position) / x.Speed) * 1000 < 600 / 2.5) .ToList(); if (me.Health > 250 && enemiesInRange.Count > 0) { if (!me.IsStunned() && me.IsAlive && !Armlet.IsToggled && !me.Modifiers.Any(x => x.Name == "modifier_item_armlet_unholy_strength") && Utils.SleepCheck("Armlet")) { // Console.WriteLine("Activating Armlet!"); Armlet.ToggleAbility(); Utils.Sleep(100 + Game.Ping, "Armlet"); } } else if (me.Health > 250 && enemiesInRange.Count < 1 && !me.IsStunned() && Armlet.IsToggled && Utils.SleepCheck("Armlet") && me.Modifiers.Any(x => x.Name == "modifier_item_armlet_unholy_strength")) { // Console.WriteLine("Deactivating Armlet!"); Armlet.ToggleAbility(); Utils.Sleep(100 + Game.Ping, "Armlet"); } else if (me.Health < 250 && projectiles.Any() && Armlet.IsToggled && !me.IsStunned() && Utils.SleepCheck("Armlet")) { // Console.WriteLine("Toggling armlet!"); Armlet.ToggleAbility(); Armlet.ToggleAbility(); Utils.Sleep(100 + Game.Ping, "Armlet"); } } if (target != null) { turnTime = me.GetTurnTime(target); if (Blink != null && Blink.CanBeCasted() && me.Distance2D(target) <= Blink.CastRange && Utils.SleepCheck("Blink") && target != null) { Blink.UseAbility(target.Position); Utils.Sleep(turnTime * 1000 + 100 + Game.Ping, "Blink"); } if (spellR.CanBeCasted(target) && me.Distance2D(target) <= spellR.CastRange && Utils.SleepCheck("R") && target != null && target.Health > (target.MaximumHealth * 0.5) && !target.IsMagicImmune()) { spellR.UseAbility(target); Utils.Sleep(LifebreakCastTime + Game.Ping, "R"); } if (Abyssal != null && Abyssal.CanBeCasted(target) && me.Distance2D(target) <= Abyssal.CastRange && Utils.SleepCheck("abyssal") && target != null) { var canUse = Utils.ChainStun(target, turnTime + 0.1 + Game.Ping / 1000, null, false); if (canUse) { Abyssal.UseAbility(target); Utils.Sleep(turnTime * 1000 + 100 + Game.Ping, "abyssal"); } } if (Hex != null && Hex.CanBeCasted(target) && me.Distance2D(target) <= (Hex.CastRange) && Utils.SleepCheck("hex") && target != null) { var canUse = Utils.ChainStun(target, turnTime + 0.1 + Game.Ping / 1000, null, false); if (canUse) { Hex.UseAbility(target); Utils.Sleep(turnTime * 1000 + 100 + Game.Ping, "hex"); } } if (Urn != null && Urn.CanBeCasted(target) && me.Distance2D(target) <= Urn.CastRange && Urn.CurrentCharges >= 1 && Utils.SleepCheck("Urn") && target != null && target.Modifiers.All(x => x.Name != "modifier_item_urn_heal")) { Urn.UseAbility(target); Utils.Sleep(turnTime * 1000 + 100 + Game.Ping, "Urn"); } if (Medallion != null && Medallion.CanBeCasted(target) && me.Distance2D(target) <= Medallion.CastRange && Utils.SleepCheck("Medallion") && target != null) { Medallion.UseAbility(target); Utils.Sleep(turnTime * 1000 + 100 + Game.Ping, "Medallion"); } if (SolarCrest != null && SolarCrest.CanBeCasted(target) && me.Distance2D(target) <= SolarCrest.CastRange && Utils.SleepCheck("SolarCrest") && target != null) { SolarCrest.UseAbility(target); Utils.Sleep(turnTime * 1000 + 100 + Game.Ping, "SolarCrest"); } if (Blademail != null && Blademail.CanBeCasted() && me.Distance2D(target) < target.AttackRange && Utils.SleepCheck("Blademail") && target != null) { Blademail.UseAbility(); Utils.Sleep(turnTime * 1000 + 100 + Game.Ping, "Blademail"); } if (Mjollnir != null && Mjollnir.CanBeCasted(me) && target.IsValid && me.Distance2D(target) <= spellR.CastRange && Utils.SleepCheck("Mjollnir") && target != null) { Mjollnir.UseAbility(me); Utils.Sleep(turnTime * 1000 + 100 + Game.Ping, "Mjollnir"); } if (Orchid != null && Orchid.CanBeCasted(target) && me.Distance2D(target) <= Orchid.CastRange && Utils.SleepCheck("Orchid") && target != null) { Orchid.UseAbility(target); Utils.Sleep(turnTime * 1000 + 100 + Game.Ping, "Orchid"); } if (Halberd != null && Halberd.CanBeCasted(target) && me.Distance2D(target) <= Halberd.CastRange && (!target.IsHexed() && !target.IsStunned() && !target.IsDisarmed()) && Utils.SleepCheck("Halberd") && target != null) { Halberd.UseAbility(target); Utils.Sleep(turnTime * 1000 + 100 + Game.Ping, "Halberd"); } if (Satanic != null && Satanic.CanBeCasted() && me.Health <= (me.MaximumHealth * 0.20) && me.Distance2D(target) <= lastRange) { Satanic.UseAbility(); } if (spellQ.CanBeCasted() && me.Health <= (me.MaximumHealth * 0.4) && Utils.SleepCheck("Q")) { spellQ.UseAbility(me); Utils.Sleep(InnervitalityCastTime + Game.Ping, "Q"); } } if (target != null && target.IsMagicImmune()) { Orbwalking.Orbwalk(target, Game.Ping); } else if (target == null || !target.IsMagicImmune()) { Orbwalking.Orbwalk(target, Game.Ping, attackmodifiers: true); } } }
public static void Game_OnUpdate(EventArgs args) { if (!Game.IsInGame || Game.IsPaused || Game.IsWatchingGame) { return; } me = ObjectMgr.LocalHero; if (me == null || me.ClassID != ClassID.CDOTA_Unit_Hero_Obsidian_Destroyer) { return; } if (astral == null) { astral = me.Spellbook.SpellW; } if (eclipse == null) { eclipse = me.Spellbook.SpellR; } if (bkb == null) { bkb = me.FindItem("item_black_king_bar"); } if (orb == null) { orb = me.Spellbook.Spell1; } if (hex == null) { hex = me.FindItem("item_sheepstick"); } if (orchid == null) { orchid = me.FindItem("item_orchid"); } if (shiva == null) { shiva = me.FindItem("item_shivas_guard"); } if (atos == null) { atos = me.FindItem("item_rod_of_atos"); } if (atos == null) { atos = me.FindItem("item_bloodthorn"); } if (!menuvalueSet) { menuValue = Menu.Item("Items").GetValue <AbilityToggler>(); menuvalueSet = true; } if (Combo) { var ctm = Targeting.SelectedIndex != 2 || Targeting.SelectedIndex != 1 || Targeting.SelectedIndex != 3; var hhp = Targeting.SelectedIndex != 0 || Targeting.SelectedIndex != 2 || Targeting.SelectedIndex != 3; var hi = Targeting.SelectedIndex != 1 || Targeting.SelectedIndex != 0 || Targeting.SelectedIndex != 3; var baat = Targeting.SelectedIndex != 0 || Targeting.SelectedIndex != 1 || Targeting.SelectedIndex != 2; if (ctm) { target = me.ClosestToMouseTarget(1000); } else if (hhp) { target = TargetSelector.HighestHealthPointsTarget(me, 600); } else if (hi) { target = HighestInt(me); } else if (baat) { target = me.BestAATarget(); } //orbwalk if (target != null && (!target.IsValid || !target.IsVisible || !target.IsAlive || target.Health <= 0)) { target = null; } var canCancel = Orbwalking.CanCancelAnimation(); if (canCancel) { if (target != null && !target.IsVisible && !Orbwalking.AttackOnCooldown(target)) { target = me.ClosestToMouseTarget(); } } if (target != null && target.IsAlive && !target.IsInvul() && !target.IsIllusion) { var targetDistance = me.Distance2D(target); if (me.CanAttack() && me.CanCast()) { if (orb != null && orb.IsValid && orb.CanBeCasted() && me.CanCast() && Utils.SleepCheck("orb") && !target.UnitState.HasFlag(UnitState.MagicImmune)) { orb.UseAbility(target); Utils.Sleep(50, "orb"); } } if (atos != null && atos.IsValid && atos.CanBeCasted() && Utils.SleepCheck("atos") && menuValue.IsEnabled(atos.Name)) { atos.UseAbility(target); Utils.Sleep(50 + Game.Ping, "atos"); } if (shiva != null && shiva.IsValid && shiva.CanBeCasted() && Utils.SleepCheck("shiva") && menuValue.IsEnabled(shiva.Name)) { atos.UseAbility(target); Utils.Sleep(50 + Game.Ping, "shiva"); } if (!(targetDistance <= me.AttackRange)) { return; } if (bkb != null && bkb.IsValid && bkb.CanBeCasted() && Utils.SleepCheck("bkb") && menuValue.IsEnabled(bkb.Name)) { bkb.UseAbility(); Utils.Sleep(150 + Game.Ping, "bkb"); } if (hex != null && hex.IsValid && hex.CanBeCasted() && Utils.SleepCheck("hex") && menuValue.IsEnabled(hex.Name)) { hex.CastStun(target); Utils.Sleep(250 + Game.Ping, "hex"); return; } if (orchid != null && orchid.IsValid && orchid.CanBeCasted() && Utils.SleepCheck("orchid") && menuValue.IsEnabled(orchid.Name)) { orchid.CastStun(target); Utils.Sleep(250 + Game.Ping, "orchid"); return; } if (bloodthorn != null && bloodthorn.IsValid && bloodthorn.CanBeCasted() && Utils.SleepCheck("bloodthorn") && menuValue.IsEnabled(bloodthorn.Name)) { bloodthorn.CastStun(target); Utils.Sleep(250 + Game.Ping, "bloodthorn"); return; } if (orb == null || orb.CanBeCasted() || !Utils.SleepCheck("orb") || !Menu.Item("orbwalkk").GetValue <bool>() || !(targetDistance <= me.AttackRange)) { } else { Orbwalking.Orbwalk(target); Utils.Sleep(Game.Ping + 150, "orb"); } if (me.IsAttacking() || !(targetDistance >= me.AttackRange) || !Utils.SleepCheck("follow")) { return; } me.Move(Game.MousePosition); Utils.Sleep(150 + Game.Ping, "follow"); } else if (!orb.CanBeCasted() && Utils.SleepCheck("orb") && target != null && target.UnitState.HasFlag(UnitState.MagicImmune)) { me.Attack(target); Utils.Sleep(150, "noorb"); } else { me.Move(Game.MousePosition); } } }
public static void Game_OnUpdate(EventArgs args) { if (!OnUpdateChecks.CanUpdate()) { return; } MyHeroInfo.UpdatePosition(); ManageAutoAttack.UpdateAutoAttack(); var enemyHeroes = EnemyHeroes.UsableHeroes; var allyHeroes = AllyHeroes.UsableHeroes; GankDamage.UpdateDamage(enemyHeroes, allyHeroes); if (!Me.IsAlive || (Me.IsInvisible() && !Me.IsVisibleToEnemies && Me.ClassID != ClassID.CDOTA_Unit_Hero_Riki && (!Me.HasModifier("modifier_templar_assassin_meld") || !Orbwalking.CanCancelAnimation())) || Me.IsChanneling()) { return; } if (Utils.SleepCheck("cancelorder")) { if (lastOrderPosition != Vector3.Zero && lastActivity == NetworkActivity.Move) { var ctarget = TargetSelector.ClosestToMouse(Me, 150); if (ctarget != null && ctarget.IsValid) { Me.Attack(ctarget); } else { Me.Move(lastOrderPosition); } lastOrderPosition = Vector3.Zero; } } else { lastActivity = Me.NetworkActivity; lastOrderPosition = Game.MousePosition; } var ping = Game.Ping; if (MyAbilities.DeffensiveAbilities.Any() && Utils.SleepCheck("casting")) { if (Utils.SleepCheck("Orbwalk.Attack") && allyHeroes.Any(allyHero => FullCombo.DeffensiveAutoUsage(allyHero, Me, enemyHeroes, ping))) { return; } } var targetLock = MainMenu.ComboKeysMenu.Item("Ability.KeyCombo.TargetLock").GetValue <StringList>().SelectedIndex; var keyDown = Game.IsKeyDown(MainMenu.ComboKeysMenu.Item("abilityKey1").GetValue <KeyBind>().Key); if (!keyDown) { target = null; } if (!MyAbilities.OffensiveAbilities.Any()) { if (Game.IsChatOpen) { return; } if (keyDown) { if (Utils.SleepCheck("UpdateTarget") && (target == null || !target.IsValid || !target.IsAlive || (!target.IsVisible && targetLock == 0))) { var mode = MainMenu.ComboKeysMenu.Item("Ability.KeyCombo.Target").GetValue <StringList>().SelectedIndex; target = mode == 0 ? TargetSelector.ClosestToMouse(Me, 2000) : EnemyHeroes.UsableHeroes.Where(x => x.Distance2D(Me) < 2000) .MaxOrDefault(x => x.GetDoableDamage()); Utils.Sleep(250, "UpdateTarget"); } if (target != null && !target.IsValid) { target = null; } if (Utils.SleepCheck("GlobalCasting") && (Game.MousePosition.Distance2D(Me) > MainMenu.ComboKeysMenu.Item("Ability.KeyCombo.NoMoveRange").GetValue <Slider>().Value || (target != null && Me.Distance2D(target) <= MainMenu.ComboKeysMenu.Item("Ability.KeyCombo.NoMoveRange").GetValue <Slider>().Value))) { var mode = MainMenu.ComboKeysMenu.Item("Ability.KeyCombo.Mode").GetValue <StringList>().SelectedIndex; switch (mode) { case 0: Orbwalking.Orbwalk(target, attackmodifiers: true); break; case 1: if (!Utils.SleepCheck("Ability.Move")) { return; } Me.Move(Game.MousePosition); Utils.Sleep(100, "Ability.Move"); break; case 2: if (!Utils.SleepCheck("Ability.Move") || target == null) { return; } Me.Attack(target); Utils.Sleep(100, "Ability.Move"); break; case 3: return; } } } } var meMissingHp = Me.MaximumHealth - Me.Health; var meMana = Me.Mana; if (Utils.SleepCheck("Orbwalk.Attack") && enemyHeroes.Any( enemyHero => FullCombo.AutoUsage(enemyHero, enemyHeroes, meMissingHp, ping, Me, meMana))) { return; } if (Utils.SleepCheck("casting")) { if (FullCombo.KillSteal(enemyHeroes, ping, Me)) { return; } } if (Game.IsChatOpen) { return; } if (keyDown) { if (Utils.SleepCheck("UpdateTarget") && (target == null || !target.IsValid || !target.IsAlive || (!target.IsVisible && targetLock == 0))) { var mode = MainMenu.ComboKeysMenu.Item("Ability.KeyCombo.Target").GetValue <StringList>().SelectedIndex; target = mode == 0 ? TargetSelector.ClosestToMouse(Me, 2000) : EnemyHeroes.UsableHeroes.Where(x => x.Distance2D(Me) < 2000) .MaxOrDefault(x => x.GetDoableDamage()); Utils.Sleep(250, "UpdateTarget"); } var selectedCombo = MainMenu.ComboKeysMenu.Item("abilityComboType").GetValue <StringList>().SelectedIndex; if (target != null && Utils.SleepCheck("Orbwalk.Attack")) { var combo = FullCombo.Execute( target, enemyHeroes, ping, selectedCombo == 2, selectedCombo == 1, Me, meMana); } if (Me.ClassID == ClassID.CDOTA_Unit_Hero_TemplarAssassin && target != null && target.IsVisible) { var meld = Me.Spellbook.SpellW; if (meld.ManaCost <= meMana && meld.Cooldown >= 0 && meld.Cooldown < UnitDatabase.GetAttackRate(Me) && target.Health > Dictionaries.HitDamageDictionary[target.Handle] * 2) { if (!Utils.SleepCheck("Ability.Move")) { return; } Me.Move(Game.MousePosition); Utils.Sleep(100, "Ability.Move"); return; } } if (Utils.SleepCheck("GlobalCasting") && (Game.MousePosition.Distance2D(Me) > MainMenu.ComboKeysMenu.Item("Ability.KeyCombo.NoMoveRange").GetValue <Slider>().Value || (target != null && Me.Distance2D(target) <= MainMenu.ComboKeysMenu.Item("Ability.KeyCombo.NoMoveRange").GetValue <Slider>().Value))) { var mode = MainMenu.ComboKeysMenu.Item("Ability.KeyCombo.Mode").GetValue <StringList>().SelectedIndex; switch (mode) { case 0: Orbwalking.Orbwalk(target, attackmodifiers: true); break; case 1: if (!Utils.SleepCheck("Ability.Move")) { return; } Me.Move(Game.MousePosition); Utils.Sleep(100, "Ability.Move"); break; case 2: if (!Utils.SleepCheck("Ability.Move") || target == null) { return; } Me.Attack(target); Utils.Sleep(100, "Ability.Move"); break; case 3: return; } } } }
/// <summary> /// The on update. /// </summary> public void OnUpdate() { if (!this.pause) { this.pause = Game.IsPaused; } if (this.pause || Variables.Hero == null || !Variables.Hero.IsValid || !Variables.Hero.IsAlive) { this.pause = Game.IsPaused; return; } var canAutoUse = !Me.IsInvisible() && !Me.IsChanneling(); if (Variables.ArmletToggler != null && Variables.ArmletToggler.CanToggle && canAutoUse) { Variables.ArmletToggler.Toggle(); this.comboSleeper.Sleep(Game.Ping + 100); return; } if (Variables.ChargeAway) { Variables.ChargeOfDarkness.ChargeAway(); return; } this.targetFind.Find(); if (Variables.Combo) { if (this.comboSleeper.Sleeping) { return; } if (Variables.ChargeOfDarkness.IsCharging) { this.itemCombo.UseInvis(false); return; } if (this.Target == null || !this.Target.IsVisible || !this.Target.IsAlive) { this.move.ToPosition(Game.MousePosition); return; } var canDoCombo = Orbwalking.CanCancelAnimation() && Utils.SleepCheck("Orbwalk.Attack") && Utils.SleepCheck("GlobalCasting") && (this.Target.Health > this.Target.DamageTaken(Me.DamageAverage, DamageType.Physical, Me) * 2 || this.Target.Distance2D(Me) > Me.GetAttackRange() + 100); if (Variables.MenuManager.AbilityEnabled("spirit_breaker_charge_of_darkness") && canDoCombo && Variables.ChargeOfDarkness.ChargeTo(this.Target)) { this.itemCombo.UseInvis(true); var delay = (float) ((Variables.ChargeOfDarkness.CastPoint * 1000) + (Game.Ping * 2) + 300 + (Variables.Hero.GetTurnTime(this.Target) * 1000)); this.comboSleeper.Sleep(delay); Utils.Sleep(delay + 300, "GlobalCasting"); Utils.Sleep(delay + 300, "Orbwalk.Attack"); Utils.Sleep(delay + 300, "Orbwalk.Move"); Utils.Sleep(delay + 300, "cancelorder"); Utils.Sleep(delay + 300, "casting"); Utils.Sleep(delay + 300, "Ability#.Sleep"); return; } if (canDoCombo && this.itemCombo.ExecuteCombo(this.Target)) { this.comboSleeper.Sleep((float)(Game.Ping + Me.GetTurnTime(this.Target.Position))); return; } if (Variables.MenuManager.AbilityEnabled("spirit_breaker_nether_strike") && canDoCombo && this.Target.Health > Variables.MenuManager.MinHpKillsteal && Variables.NetherStrike.UseOn(this.Target)) { this.comboSleeper.Sleep((float)(Variables.NetherStrike.CastPoint * 1000)); return; } if (Variables.MenuManager.AbilityEnabled("spirit_breaker_empowering_haste") && canDoCombo && this.empoweringHaste.CanBeCasted() && Variables.Hero.CanCast()) { this.empoweringHaste.UseAbility(); this.comboSleeper.Sleep(300 + Game.Ping); return; } Orbwalking.Orbwalk(this.Target, followTarget: Variables.MenuManager.MoveMode == 1); return; } if (this.comboSleeper.Sleeping || Variables.ChargeOfDarkness.IsCharging) { return; } foreach (var hero in Heroes.GetByTeam(Variables.EnemyTeam).Where(x => x.IsValid && x.IsAlive && x.IsVisible) ) { if (canAutoUse && Variables.MenuManager.KillSteal && Variables.NetherStrike.KillSteal(hero, Variables.MenuManager.MinHpKillsteal)) { this.comboSleeper.Sleep((float)(Game.Ping + (Variables.NetherStrike.CastPoint * 1000))); } if (!Variables.MenuManager.DrawNotification) { continue; } Variables.ChargeOfDarkness.CheckHpAndAlert(hero, Variables.MenuManager.NotificationHealth); } }
private static void Game_OnUpdate(EventArgs args) { if (!loaded) { me = ObjectMgr.LocalHero; if (!Game.IsInGame || Game.IsWatchingGame || me == null || Game.IsChatOpen) { return; } loaded = true; } if (me == null || !me.IsValid) { loaded = false; me = ObjectMgr.LocalHero; supportActive = false; includeSaveSelf = false; shouldCastLotusOrb = false; shouldCastGlimmerCape = false; return; } if (Game.IsPaused) { return; } Urn = me.FindItem("item_urn_of_shadows"); Meka = me.FindItem("item_mekansm"); Guardian = me.FindItem("item_guardian_greaves"); Arcane = me.FindItem("item_arcane_boots"); LotusOrb = me.FindItem("item_lotus_orb"); Medallion = me.FindItem("item_medallion_of_courage"); SolarCrest = me.FindItem("item_solar_crest"); GlimmerCape = me.FindItem("item_glimmer_cape"); Pipe = me.FindItem("item_pipe"); CrimsonGuard = me.FindItem("item_crimson_guard"); needMana = null; needMeka = null; shouldCastLotusOrb = false; shouldCastGlimmerCape = false; if (!Game.IsChatOpen) { if (Game.IsKeyDown(toggleKey) && Utils.SleepCheck("togglingoption")) { if (!supportActive) { supportActive = true; } else { supportActive = false; } Utils.Sleep(100 + Game.Ping, "togglingoption"); } if (Game.IsKeyDown(saveSelfKey) && Utils.SleepCheck("togglingoption")) { if (!includeSaveSelf) { includeSaveSelf = true; } else { includeSaveSelf = false; } Utils.Sleep(100 + Game.Ping, "togglingoption"); } } if (supportActive) { var allies = ObjectMgr.GetEntities <Hero>() .Where( ally => ally.Team == me.Team && ally.IsAlive && !ally.IsIllusion && me.Distance2D(ally) <= 1500) .ToList(); fountain = ObjectMgr.GetEntities <Entity>() .First(entity => entity.ClassID == ClassID.CDOTA_Unit_Fountain && entity.Team == me.Team); if (allies.Any()) { foreach (var ally in allies) { if (!ally.IsIllusion() && ally.IsAlive && ally.Health > 0 && me.IsAlive && !me.IsChanneling() && me.Distance2D(fountain) > 2000 && !me.IsInvisible()) { if ((ally.MaximumHealth - ally.Health) > (450 + ally.HealthRegeneration * 10) && me.Distance2D(ally) <= 2000 && (me.Mana >= 225 || Guardian != null)) { if (needMeka == null || (needMeka != null && me.Distance2D(needMeka) <= 750)) { needMeka = ally; } } var enemyTowers = ObjectMgr.GetEntities <Entity>() .Any( x => x.ClassID == ClassID.CDOTA_BaseNPC_Tower && x.Team != me.Team && x.IsAlive && ally.Distance2D(x) <= 750); if (me.CanUseItems()) { if (Urn != null && Urn.CanBeCasted() && Urn.CurrentCharges > 0 && !ally.Modifiers.Any(x => x.Name == "modifier_item_urn_heal") && !enemyTowers) { if (me.Distance2D(ally) <= 950 && !IsInDanger(ally) && Utils.SleepCheck("Urn") && ally.Health <= (ally.MaximumHealth * 0.7)) { Urn.UseAbility(ally); Utils.Sleep(100 + Game.Ping, "Urn"); } if (ally.Modifiers.Any(x => x.Name == "modifier_wisp_tether") && (ally.MaximumHealth - ally.Health) >= 600 && Utils.SleepCheck("Urn")) { Urn.UseAbility(me); Utils.Sleep(100 + Game.Ping, "Urn"); } } if (Arcane != null && Arcane.Cooldown == 0) { if ((ally.MaximumMana - ally.Mana) >= 135 && me.Distance2D(ally) < 2000 && me.Mana >= 35) { if (needMana == null || (needMana != null && me.Distance2D(needMana) <= 600)) { needMana = ally; } } } /*Pipe and Crimson Guard*/ if (((Pipe != null && Pipe.CanBeCasted()) || (CrimsonGuard != null && CrimsonGuard.CanBeCasted())) && me.CanUseItems()) { var enemiesInRadius = ObjectMgr.GetEntities <Hero>() .Where( x => x.Team != me.Team && x.IsAlive && me.Distance2D(x) <= 1500 && !x.IsIllusion).ToList(); var alliesInRadius = ObjectMgr.GetEntities <Hero>() .Where( x => x.Team == me.Team && x.IsAlive && me.Distance2D(x) <= 900 && !x.IsIllusion).ToList(); if (enemiesInRadius.Any() && alliesInRadius.Any()) { if (enemiesInRadius.Count >= 2 && alliesInRadius.Count >= 2) { if (Pipe != null && Pipe.CanBeCasted() && Utils.SleepCheck("Pipe")) { Pipe.UseAbility(); Utils.Sleep(100 + Game.Ping, "Pipe"); } if (CrimsonGuard != null && CrimsonGuard.CanBeCasted() && Utils.SleepCheck("CrimsonGuard")) { CrimsonGuard.UseAbility(); Utils.Sleep(100 + Game.Ping, "CrimsonGuard"); } } } } var enemyList = ObjectMgr.GetEntities <Hero>() .Where( x => x.Team != me.Team && !x.IsIllusion && x.IsAlive && x.CanCast() && ally.Distance2D(x) <= 1000) .ToList(); if (enemyList.Any()) { foreach (var enemy in enemyList) { var targettedSpell = enemy.Spellbook.Spells.Any( x => x.TargetTeamType == TargetTeamType.Enemy && x.AbilityState == AbilityState.Ready && ally.Distance2D(enemy) <= x.CastRange + 50 && x.AbilityBehavior == AbilityBehavior.UnitTarget); var targettedItem = enemy.Inventory.Items.Any( x => x.TargetTeamType == TargetTeamType.Enemy && x.AbilityState == AbilityState.Ready && x.AbilityBehavior == AbilityBehavior.UnitTarget && ally.Distance2D(enemy) <= x.CastRange + 50); var enemySkill = enemy.Spellbook.Spells.Any( x => x.DamageType == DamageType.Magical && x.TargetTeamType == TargetTeamType.Enemy && x.AbilityState == AbilityState.Ready && ally.Distance2D(enemy) <= x.CastRange + 50); if (enemySkill) { shouldCastGlimmerCape = true; } if (targettedSpell || targettedItem) { shouldCastLotusOrb = true; } } } if (LotusOrb != null && LotusOrb.Cooldown == 0 && Utils.SleepCheck("LotusOrb") && me.Distance2D(ally) <= LotusOrb.CastRange + 50 && (shouldCastLotusOrb || IsInDanger(ally))) { LotusOrb.UseAbility(ally); Utils.Sleep(100 + Game.Ping, "LotusOrb"); } if (Medallion != null && Medallion.Cooldown == 0 && me.Distance2D(ally) <= Medallion.CastRange + 50 && Utils.SleepCheck("Medallion") && ally != me && IsInDanger(ally)) { Medallion.UseAbility(ally); Utils.Sleep(100 + Game.Ping, "Medallion"); } if (SolarCrest != null && SolarCrest.Cooldown == 0 && me.Distance2D(ally) <= SolarCrest.CastRange + 50 && Utils.SleepCheck("SolarCrest") && ally != me && IsInDanger(ally)) { SolarCrest.UseAbility(ally); Utils.Sleep(100 + Game.Ping, "SolarCrest"); } if (GlimmerCape != null && GlimmerCape.Cooldown == 0 && me.Distance2D(ally) <= GlimmerCape.CastRange + 50 && Utils.SleepCheck("GlimmerCape") && (shouldCastGlimmerCape || IsInDanger(ally))) { GlimmerCape.UseAbility(ally); Utils.Sleep(100 + Game.Ping, "GlimmerCape"); } } } } } if (needMeka != null && ((Guardian != null && Guardian.CanBeCasted()) || (Meka != null && Meka.CanBeCasted())) && me.Distance2D(needMeka) <= 750) { if (Meka != null) { Meka.UseAbility(); } else { Guardian.UseAbility(); } } if (needMana != null && Arcane != null && Arcane.CanBeCasted() && me.Distance2D(needMana) <= 600) { Arcane.UseAbility(); } if (Support(me.ClassID)) { switch (me.ClassID) { case ClassID.CDOTA_Unit_Hero_Abaddon: Save(me, me.Spellbook.SpellW, 1000, me.Spellbook.SpellW.CastRange); Heal(me, me.Spellbook.SpellQ, new float[] { 100, 150, 200, 250 }, 800, 1, false); break; case ClassID.CDOTA_Unit_Hero_Chen: Save(me, me.Spellbook.SpellE, 1000, me.Spellbook.SpellE.CastRange); Heal(me, me.Spellbook.SpellR, new float[] { 200, 300, 400 }, 2200000, 2); break; case ClassID.CDOTA_Unit_Hero_Dazzle: Save(me, me.Spellbook.SpellW, 300, me.Spellbook.SpellW.CastRange); Heal(me, me.Spellbook.SpellE, new float[] { 80, 100, 120, 140 }, 750, 1); break; case ClassID.CDOTA_Unit_Hero_Enchantress: Heal(me, me.Spellbook.SpellE, new float[] { 400, 600, 800, 1000 }, 275, 2); break; case ClassID.CDOTA_Unit_Hero_Legion_Commander: Heal(me, me.Spellbook.SpellW, new float[] { 150, 200, 250, 300 }, 800, 1); break; case ClassID.CDOTA_Unit_Hero_Necrolyte: Heal(me, me.Spellbook.SpellQ, new float[] { 70, 90, 110, 130 }, 475, 2); break; case ClassID.CDOTA_Unit_Hero_Omniknight: Heal(me, me.Spellbook.SpellQ, new float[] { 90, 180, 270, 360 }, 950, 1); Save(me, me.Spellbook.SpellW, 1570, me.Spellbook.SpellW.CastRange); break; case ClassID.CDOTA_Unit_Hero_Oracle: Save(me, me.Spellbook.SpellR, 1270, me.Spellbook.SpellR.CastRange); Heal(me, me.Spellbook.SpellE, new float[] { 99, 198, 297, 396 }, 750, 1); break; case ClassID.CDOTA_Unit_Hero_Shadow_Demon: Save(me, me.Spellbook.SpellQ, 900, me.Spellbook.SpellQ.CastRange); break; case ClassID.CDOTA_Unit_Hero_Treant: Heal(me, me.Spellbook.SpellE, new float[] { 60, 105, 150, 195 }, 2200000, 1); break; case ClassID.CDOTA_Unit_Hero_Undying: var unitsAround = ObjectMgr.GetEntities <Entity>() .Where(entity => entity.IsAlive && me.Distance2D(entity) <= 1300).ToList(); if (unitsAround.Any()) { var unitCount = unitsAround.Count; var healperUnit = new[] { 18, 22, 36, 30 }; Heal(me, me.Spellbook.SpellW, new float[] { unitCount *healperUnit[me.Spellbook.SpellW.Level - 1], unitCount *healperUnit[me.Spellbook.SpellW.Level - 1], unitCount *healperUnit[me.Spellbook.SpellW.Level - 1], unitCount *healperUnit[me.Spellbook.SpellW.Level - 1] }, 750, 1); } break; case ClassID.CDOTA_Unit_Hero_Warlock: Heal(me, me.Spellbook.SpellW, new float[] { 165, 275, 385, 495 }, me.Spellbook.SpellW.CastRange, 1); break; case ClassID.CDOTA_Unit_Hero_Winter_Wyvern: Save(me, me.Spellbook.SpellE, 930, me.Spellbook.SpellE.CastRange); break; case ClassID.CDOTA_Unit_Hero_WitchDoctor: Heal(me, me.Spellbook.SpellW, new float[] { 16, 24, 32, 40 }, 500, 3); break; } } } if (Game.IsKeyDown(orbwalkKey)) { if (target != null && (!target.IsValid || !target.IsVisible || !target.IsAlive || target.Health <= 0)) { target = null; } var canCancel = Orbwalking.CanCancelAnimation(); if (canCancel) { if (target != null && !target.IsVisible && !Orbwalking.AttackOnCooldown(target)) { target = me.ClosestToMouseTarget(); } else if (target == null || !Orbwalking.AttackOnCooldown(target)) { var bestAa = me.BestAATarget(); if (bestAa != null) { target = me.BestAATarget(); } } } Orbwalking.Orbwalk(target, Game.Ping, attackmodifiers: true); } }
/// <summary> /// The game_ on update. /// </summary> /// <param name="args"> /// The args. /// </param> private static void Game_OnUpdate(EventArgs args) { RangeDisplay.Me(); if (Game.IsPaused) { return; } if (RangeDisplay.IsDisposed()) { if (me.IsAlive) { RangeDisplay.Create(); } } else { if (!me.IsAlive) { RangeDisplay.Dispose(); } else if (!RangeDisplay.IsUpdated()) { RangeDisplay.Update(); } } if (target != null && (!target.IsValid || !target.IsVisible || !target.IsAlive || target.Health <= 0)) { target = null; } var canCancel = Orbwalking.CanCancelAnimation(); var isFarmKeyDown = Game.IsKeyDown(Menu.Item("farmKey").GetValue <KeyBind>().Key); var allUnitsKeyDown = Game.IsKeyDown(Menu.Item("allUnitsChaseKey").GetValue <KeyBind>().Key); if (canCancel) { if (Utils.SleepCheck("Orbwalker.Update.Target")) { if (allUnitsKeyDown) { target = me.ClosestToMouseTarget(500); } else if (target != null && !target.IsVisible) { target = me.ClosestToMouseTarget(128); } else { var bestAa = me.BestAATarget(); if (bestAa != null) { target = me.BestAATarget(); } } Utils.Sleep(500, "Orbwalker.Update.Target"); } } if (canCancel && creepTarget != null && (!creepTarget.IsValid || !creepTarget.IsSpawned || creepTarget.Health <= 0 || !creepTarget.IsAlive || !creepTarget.IsVisible)) { creepTarget = null; } if (Utils.SleepCheck("Orbwalker.Update.Creep") && !Game.IsChatOpen && isFarmKeyDown && (canCancel || creepTarget == null || !creepTarget.IsValid || !creepTarget.IsSpawned || creepTarget.Health <= 0 || !creepTarget.IsAlive || !creepTarget.IsVisible)) { creepTarget = ObjectManager.GetEntitiesParallel <Creep>() .Where( x => x.IsSpawned && x.IsValid && x.IsAlive && x.Team != me.Team && x.Distance2D(me) < me.GetAttackRange() + 150) .MinOrDefault(x => x.Health + x.Distance2D(me) * 1.5); Utils.Sleep(230, "Orbwalker.Update.Creep"); } if (Game.IsChatOpen) { return; } if (allUnitsKeyDown) { Orbwalking.Orbwalk(target, attackmodifiers: true); foreach (var unit in controllableUnits.Units.Where(x => !x.Equals(me) && x.IsValid && x.IsAlive)) { orb unitOrbwalker; if (!orbwalkerDictionary.TryGetValue(unit.Handle, out unitOrbwalker)) { unitOrbwalker = new orb(unit); orbwalkerDictionary.Add(unit.Handle, unitOrbwalker); } var position = Game.MousePosition; if (target != null) { position = Game.MousePosition.Extend( target.Position, (float)(Game.MousePosition.Distance2D(target) * 0.7)); } unitOrbwalker.OrbwalkOn(target, position); } return; } if (isFarmKeyDown) { Orbwalking.Orbwalk(creepTarget); return; } if (Game.IsKeyDown(Menu.Item("chaseKey").GetValue <KeyBind>().Key)) { Orbwalking.Orbwalk(target, attackmodifiers: true); return; } if (Game.IsKeyDown(Menu.Item("kiteKey").GetValue <KeyBind>().Key)) { Orbwalking.Orbwalk( target, attackmodifiers: true, bonusWindupMs: Menu.Item("bonusWindup").GetValue <Slider>().Value); } }
private static void Game_OnUpdate(EventArgs args) { if (!loaded) { me = ObjectMgr.LocalHero; if (!Game.IsInGame || me == null) { return; } loaded = true; } if (!Game.IsInGame || me == null) { loaded = false; me = null; if (rangeDisplay == null) { return; } rangeDisplay.Dispose(); rangeDisplay = null; return; } if (Game.IsPaused) { return; } if (rangeDisplay == null) { rangeDisplay = me.AddParticleEffect(@"particles\ui_mouseactions\range_display.vpcf"); // rangeDisplay.SetControlPointEntity(1, me); } rangeDisplay.SetControlPoint(1, new Vector3(me.GetAttackRange() + me.HullRadius + 25, 0, 0)); //rangeDisplay.SetControlPoint(1, new Vector3(me.GetAttackRange() + me.HullRadius, 0, 0)); //rangeDisplay.SetControlPointEntity(1,me); var canCancel = Orbwalking.CanCancelAnimation(); if (canCancel) { if (Game.IsChatOpen) { return; } if (Game.IsKeyDown(ChaseKey)) { if (target != null && !target.IsVisible) { var closestToMouse = me.ClosestToMouseTarget(128); if (closestToMouse != null) { target = closestToMouse; } } else { target = me.BestAATarget(); } Orbwalking.Orbwalk(target, 500); } if (Game.IsKeyDown(FarmKey)) { Creep creep = KillableCreep(true); if (creep == null) { //Console.WriteLine("null "); if (target != null && !target.IsVisible) { var closestToMouse = me.ClosestToMouseTarget(128); if (closestToMouse != null) { target = closestToMouse; } } else { target = me.BestAATarget(); } Orbwalking.Orbwalk(target, 500); } else { //Console.WriteLine("found creep "); Orbwalking.Orbwalk(creep, 500); } } } if (Game.IsKeyDown(LastHitKey)) { Creep creep = KillableCreep(false); if (creep == null) { //Console.WriteLine("null "); if (target != null && !target.IsVisible) { var closestToMouse = me.ClosestToMouseTarget(128); if (closestToMouse != null) { target = closestToMouse; } } else { target = me.BestAATarget(); } Orbwalking.Orbwalk(target, 500); } else { //Console.WriteLine("found creep "); Orbwalking.Orbwalk(creep, 500); } } }
public static void Game_OnUpdate(EventArgs args) { if (!OnUpdateChecks.CanUpdate()) { return; } MyHeroInfo.UpdatePosition(); ManageAutoAttack.UpdateAutoAttack(); var enemyHeroes = EnemyHeroes.UsableHeroes; var allyHeroes = AllyHeroes.UsableHeroes; GankDamage.UpdateDamage(enemyHeroes, allyHeroes); if (!Me.IsAlive || (Me.IsInvisible() && !Me.IsVisibleToEnemies && Me.ClassID != ClassID.CDOTA_Unit_Hero_Riki && (Me.Modifiers.All(x => x.Name != "modifier_templar_assassin_meld") || !Orbwalking.CanCancelAnimation())) || Me.IsChanneling()) { return; } if (Utils.SleepCheck("cancelorder")) { if (lastOrderPosition != Vector3.Zero) { var ctarget = TargetSelector.ClosestToMouse(Me, 150); if (ctarget != null) { Me.Attack(ctarget); } else { Me.Attack(lastOrderPosition); } lastOrderPosition = Vector3.Zero; } } else { lastOrderPosition = Game.MousePosition; } var meModifiers = Me.Modifiers.ToList(); var ping = Game.Ping; if (LaunchSnowball(meModifiers)) { return; } if (MyAbilities.DeffensiveAbilities.Any() && Utils.SleepCheck("casting")) { if (allyHeroes.Any(allyHero => FullCombo.DeffensiveAutoUsage(allyHero, Me, enemyHeroes, ping))) { return; } } if (!MyAbilities.OffensiveAbilities.Any()) { if (Game.IsChatOpen) { return; } if (Game.IsKeyDown(MainMenu.ComboKeysMenu.Item("abilityKey1").GetValue <KeyBind>().Key)) { if (Utils.SleepCheck("UpdateTarget")) { target = TargetSelector.ClosestToMouse(Me, 2000); Utils.Sleep(250, "UpdateTarget"); } if (target != null && !target.IsValid) { target = null; } if (Utils.SleepCheck("GlobalCasting")) { Orbwalking.Orbwalk(target, attackmodifiers: true); } } } if (Utils.SleepCheck("casting")) { if (FullCombo.KillSteal(enemyHeroes, ping, Me)) { return; } } var meMissingHp = Me.MaximumHealth - Me.Health; var meMana = Me.Mana; if ( enemyHeroes.Any( enemyHero => FullCombo.AutoUsage(enemyHero, enemyHeroes, meMissingHp, meModifiers, ping, Me, meMana))) { return; } if (Game.IsChatOpen) { return; } if (Game.IsKeyDown(MainMenu.ComboKeysMenu.Item("abilityKey1").GetValue <KeyBind>().Key)) { if (Utils.SleepCheck("UpdateTarget")) { target = TargetSelector.ClosestToMouse(Me, 2000); Utils.Sleep(250, "UpdateTarget"); } if (target != null && !target.IsValid) { target = null; } var selectedCombo = MainMenu.ComboKeysMenu.Item("abilityComboType").GetValue <StringList>().SelectedIndex; if (target != null && Utils.SleepCheck("Orbwalk.Attack")) { FullCombo.Execute( target, enemyHeroes, ping, selectedCombo == 2, selectedCombo == 1, Me, meModifiers, meMana); } if (Me.ClassID == ClassID.CDOTA_Unit_Hero_TemplarAssassin && target != null && target.IsVisible) { var meld = Me.Spellbook.SpellW; if (meld.ManaCost <= meMana && meld.Cooldown >= 0 && meld.Cooldown < UnitDatabase.GetAttackRate(Me) && target.Health > Dictionaries.HitDamageDictionary[target.Handle] * 2) { if (!Utils.SleepCheck("Ability.Move")) { return; } Me.Move(Game.MousePosition); Utils.Sleep(100, "Ability.Move"); return; } } if (Utils.SleepCheck("GlobalCasting")) { Orbwalking.Orbwalk(target, attackmodifiers: true); } } }
public static void Game_OnUpdate(EventArgs args) { if (!Game.IsInGame || Game.IsPaused || Game.IsWatchingGame) { return; } me = ObjectManager.LocalHero; if (me == null || me.ClassID != ClassID.CDOTA_Unit_Hero_Clinkz) { return; } if (strafe == null) { strafe = me.Spellbook.SpellQ; } if (arrows == null) { arrows = me.Spellbook.SpellW; } if (dpAbility == null) { dpAbility = me.Spellbook.SpellR; } if (bkb == null) { bkb = me.FindItem("item_black_king_bar"); } if (hex == null) { hex = me.FindItem("item_sheepstick"); } if (orchid == null) { orchid = me.FindItem("item_orchid"); } if (bloodthorn == null) { bloodthorn = me.FindItem("item_bloodthorn"); } if (medallion == null) { medallion = me.FindItem("item_medallion_of_courage"); } if (bladeMail == null) { bladeMail = me.FindItem("item_blade_mail"); } if (solar == null) { solar = me.FindItem("item_solar_crest"); } if (powerTreads == null) { powerTreads = me.FindItem("item_power_treads") as PowerTreads; } dragonLance = me.HasModifier("modifier_item_dragon_lance"); attackRange = dragonLance ? 760 : 630; if (!itemTogglerSet) { itemToggler = Menu.Item("Items").GetValue <AbilityToggler>(); itemTogglerSet = true; } if (!menuSkillSet) { skillToggler = Menu.Item("Skills").GetValue <AbilityToggler>(); menuSkillSet = true; } ultBool = dpAbility != null && skillToggler.IsEnabled("clinkz_death_pact"); const int DPrange = 0x190; if (powerTreads != null) { lastAttribute = powerTreads.ActiveAttribute; } var creepR = ObjectManager.GetEntities <Unit>() .Where( creep => (creep.ClassID == ClassID.CDOTA_BaseNPC_Creep_Lane || creep.ClassID == ClassID.CDOTA_BaseNPC_Creep_Neutral) && creep.IsAlive && creep.IsVisible && creep.IsSpawned && creep.Team != me.Team && creep.Position.Distance2D(me.Position) <= DPrange && me.Spellbook.SpellR.CanBeCasted()).ToList(); var enemies = ObjectManager.GetEntities <Hero>().Where(x => x.IsAlive && x.Team != me.Team && !x.IsIllusion).ToList(); if (autoKillz && Menu.Item("enable").GetValue <bool>()) { target = me.ClosestToMouseTarget(1001); //orbwalk if (target != null && (!target.IsValid || !target.IsVisible || !target.IsAlive || target.Health <= 0)) { target = null; } var canCancel = Orbwalking.CanCancelAnimation(); if (canCancel) { if (target != null && !target.IsVisible && !Orbwalking.AttackOnCooldown(target)) { target = me.ClosestToMouseTarget(); } else if (target == null || !Orbwalking.AttackOnCooldown(target) && target.HasModifiers(new[] { "modifier_dazzle_shallow_grave", "modifier_item_blade_mail_reflect", }, false)) { var bestAa = me.BestAATarget(); if (bestAa != null) { target = me.BestAATarget(); } } } if (target != null && target.IsAlive && !target.IsInvul() && !target.IsIllusion) { if (me.CanAttack() && me.CanCast() && !me.IsChanneling()) { TargetDistance = me.Position.Distance2D(target); if (Menu.Item("orbwalk").GetValue <bool>()) { if (!Utils.SleepCheck("attacking")) { if (lastAttribute != Attribute.Agility && Utils.SleepCheck("powerTreadsSwitch")) { SwitchTo(Attribute.Agility); Utils.Sleep(400, "powerTreadsSwitch"); } } Orbwalking.Orbwalk(target, Game.Ping, attackmodifiers: true); Utils.Sleep(400, "attacking"); } else if (!Menu.Item("orbwalk").GetValue <bool>()) { if (arrows != null && arrows.IsValid && arrows.CanBeCasted() && !Utils.SleepCheck("attacking")) { arrows.UseAbility(target); } Utils.Sleep(200, "attacking"); } if (creepR.Count > 0 && !me.Modifiers.ToList().Exists(x => x.Name == "modifier_clinkz_death_pact") && skillToggler.IsEnabled(dpAbility.Name)) { var creepmax = creepR.MaxOrDefault(x => x.Health); if (lastAttribute != Attribute.Intelligence && Utils.SleepCheck("powerTreadsSwitch")) { SwitchTo(Attribute.Intelligence); Utils.Sleep(400, "powerTreadsSwitch"); } dpAbility.UseAbility(creepmax); } if (strafe != null && strafe.IsValid && strafe.CanBeCasted() && me.CanCast() && me.Distance2D(target) <= attackRange + 90 && Utils.SleepCheck("strafe") && skillToggler.IsEnabled(strafe.Name)) { if (lastAttribute != Attribute.Intelligence && Utils.SleepCheck("powerTreadsSwitch")) { SwitchTo(Attribute.Intelligence); Utils.Sleep(400, "powerTreadsSwitch"); } strafe.UseAbility(); Utils.Sleep(100 + Game.Ping, "strafe"); } if (bladeMail != null && bladeMail.IsValid && Utils.SleepCheck("blademail") && itemToggler.IsEnabled(bladeMail.Name) && me.Distance2D(target) <= attackRange + 90) { bladeMail.UseAbility(); Utils.Sleep(50 + Game.Ping, "blademail"); } if (medallion != null && medallion.IsValid && medallion.CanBeCasted() && Utils.SleepCheck("medallion") && itemToggler.IsEnabled(medallion.Name) && me.Distance2D(target) <= attackRange + 90) { medallion.UseAbility(target); Utils.Sleep(50 + Game.Ping, "medallion"); } if (solar != null && solar.IsValid && solar.CanBeCasted() && Utils.SleepCheck("solar") && itemToggler.IsEnabled(solar.Name)) { solar.UseAbility(target); Utils.Sleep(50 + Game.Ping, "solar"); } if (bkb != null && bkb.IsValid && bkb.CanBeCasted() && Utils.SleepCheck("bkb") && itemToggler.IsEnabled(bkb.Name) && (enemies.Count(x => x.Distance2D(me) <= 650) >= (Menu.Item("bkblogic").GetValue <Slider>().Value))) { bkb.UseAbility(); Utils.Sleep(150 + Game.Ping, "bkb"); } if (hex != null && hex.IsValid && hex.CanBeCasted() && Utils.SleepCheck("hex") && itemToggler.IsEnabled(hex.Name)) { hex.CastStun(target); Utils.Sleep(250 + Game.Ping, "hex"); return; } if (orchid != null && orchid.IsValid && orchid.CanBeCasted() && Utils.SleepCheck("orchid") && itemToggler.IsEnabled(orchid.Name)) { orchid.CastStun(target); Utils.Sleep(250 + Game.Ping, "orchid"); return; } if (bloodthorn != null && bloodthorn.IsValid && bloodthorn.CanBeCasted() && Utils.SleepCheck("bloodthorn") && itemToggler.IsEnabled(bloodthorn.Name)) { bloodthorn.CastStun(target); Utils.Sleep(250 + Game.Ping, "orchid"); return; } if (!me.IsAttacking() && me.Distance2D(target) >= attackRange && Utils.SleepCheck("follow")) { me.Move(Game.MousePosition); Utils.Sleep(150 + Game.Ping, "follow"); } } } else { me.Move(Game.MousePosition); } } }//gameOnUpdate Close.
private static void Game_OnUpdate(EventArgs args) { if (!loaded) { me = ObjectMgr.LocalHero; if (!Game.IsInGame || me == null || me.ClassID != ClassID.CDOTA_Unit_Hero_Ursa) { return; } earthshock = me.Spellbook.Spell1; overpower = me.Spellbook.SpellW; enrage = me.FindSpell("ursa_enrage"); blink = me.FindItem("item_blink"); abyssalBlade = me.FindItem("item_abyssal_blade"); scytheOfVyse = me.FindItem("item_sheepstick"); loaded = true; } if (!Game.IsInGame || me == null) { overpowerCastPoint = 0; earthshockCastPoint = 0; loaded = false; me = null; target = null; earthshock = null; overpower = null; enrage = null; abyssalBlade = null; scytheOfVyse = null; blink = null; return; } if (Game.IsPaused) { return; } if (blink == null) { blink = me.FindItem("item_blink"); } if (abyssalBlade == null) { abyssalBlade = me.FindItem("item_abyssal_blade"); } if (abyssalBlade == null) { abyssalBlade = me.FindItem("item_sheepstick"); } if (earthshock == null) { earthshock = me.Spellbook.Spell1; } else if (earthshockCastPoint == 0) { earthshockCastPoint = 0.3; } if (overpower == null) { overpower = me.Spellbook.SpellW; } else if (overpowerCastPoint == 0) { overpowerCastPoint = 0.3; } if (enrage == null) { enrage = me.FindSpell("ursa_enrage"); } if (!Game.IsKeyDown(Key.Space) || Game.IsChatOpen) { target = null; return; } if (Utils.SleepCheck("blink")) { mePosition = me.Position; } if (earthshock.IsInAbilityPhase && (target == null || !target.IsAlive || target.Distance2D(me) > earthshock.AbilityData.FirstOrDefault(x => x.Name == "shock_radius").GetValue(0))) { me.Stop(); if (target != null) { me.Attack(target); } } if (overpower.IsInAbilityPhase && (target == null || !target.IsAlive)) { me.Stop(); if (target != null) { me.Attack(target); } } var range = 1000f; var mousePosition = Game.MousePosition; if (blink != null) { blinkRange = blink.AbilityData.FirstOrDefault(x => x.Name == "blink_range").GetValue(0); range = blinkRange + me.HullRadius + 500; } var canCancel = (Orbwalking.CanCancelAnimation() && Orbwalking.AttackOnCooldown(target)) || (!Orbwalking.AttackOnCooldown(target) && (targetDistance > 350 || (target != null && !target.IsVisible))) || target == null; if (canCancel) { if (target != null && !target.IsVisible) { var closestToMouse = me.ClosestToMouseTarget(128); if (closestToMouse != null) { target = me.ClosestToMouseTarget(range); } } else { target = me.ClosestToMouseTarget(range); } } if (target == null || !target.IsAlive || ((!target.IsVisible || target.Distance2D(mousePosition) > target.Distance2D(me) + 1000) && canCancel)) { if (!Utils.SleepCheck("move")) { return; } me.Move(mousePosition); Utils.Sleep(100, "move"); return; } targetDistance = mePosition.Distance2D(target); hullsum = (me.HullRadius + target.HullRadius) * 2; turnTime = me.GetTurnTime(target); var casting = CastCombo(); if (casting) { return; } if (!Utils.SleepCheck("casting")) { return; } OrbWalk(Orbwalking.CanCancelAnimation()); }
private static void Game_OnUpdate(EventArgs args) { if (!loaded) { //Orbwalking.Load(); me = ObjectMgr.LocalHero; if (!Game.IsInGame || me == null) { return; } loaded = true; Game.PrintMessage( "<font face='Tahoma'><font color='#000000'>[--</font> <font color='#33ff66'>Orbwalker</font> by <font color='#999999'>MOON</font><font color='#ff9900'>ES</font> loaded! <font color='#000000'>--]</font></font>", MessageType.LogMessage); } if (me == null || !me.IsValid) { //Orbwalking.Load(); loaded = false; me = ObjectMgr.LocalHero; if (rangeDisplay == null) { return; } rangeDisplay = null; return; } if (Game.IsPaused) { return; } if (rangeDisplay == null) { rangeDisplay = me.AddParticleEffect(@"particles\ui_mouseactions\range_display.vpcf"); lastRange = me.GetAttackRange() + me.HullRadius + 25; rangeDisplay.SetControlPoint(1, new Vector3(lastRange, 0, 0)); } else { if (lastRange != (me.GetAttackRange() + me.HullRadius + 25)) { lastRange = me.GetAttackRange() + me.HullRadius + 25; rangeDisplay.Dispose(); rangeDisplay = me.AddParticleEffect(@"particles\ui_mouseactions\range_display.vpcf"); rangeDisplay.SetControlPoint(1, new Vector3(lastRange, 0, 0)); } } if (target != null && (!target.IsValid || !target.IsVisible || !target.IsAlive || target.Health <= 0)) { target = null; } var canCancel = Orbwalking.CanCancelAnimation(); if (canCancel) { if (target != null && !target.IsVisible && !Orbwalking.AttackOnCooldown(target)) { target = me.ClosestToMouseTarget(128); } else if (target == null || !Orbwalking.AttackOnCooldown(target)) { var bestAa = me.BestAATarget(); if (bestAa != null) { target = me.BestAATarget(); } } if (Game.IsKeyDown(Menu.Item("farmKey").GetValue <KeyBind>().Key) && (creepTarget == null || !creepTarget.IsValid || !creepTarget.IsVisible || !creepTarget.IsAlive || creepTarget.Health <= 0 || !Orbwalking.AttackOnCooldown(creepTarget))) { creepTarget = TargetSelector.GetLowestHPCreep(me); } } if (Game.IsChatOpen) { return; } if (Game.IsKeyDown(Menu.Item("farmKey").GetValue <KeyBind>().Key)) { Orbwalking.Orbwalk(creepTarget); } if (Game.IsKeyDown(Menu.Item("chaseKey").GetValue <KeyBind>().Key)) { Orbwalking.Orbwalk(target, attackmodifiers: true); } if (Game.IsKeyDown(Menu.Item("kiteKey").GetValue <KeyBind>().Key)) { Orbwalking.Orbwalk( target, attackmodifiers: true, bonusWindupMs: Menu.Item("bonusWindup").GetValue <Slider>().Value); } }
private static bool CastCombo() { var canCancel = (Orbwalking.CanCancelAnimation() && (Orbwalking.AttackOnCooldown(target) || !me.IsAttacking())) || (!Orbwalking.AttackOnCooldown(target) && targetDistance > 250); if (!Utils.SleepCheck("casting") || !me.CanCast() || !target.IsVisible || !canCancel) { return(false); } if (abyssalBlade != null && abyssalBlade.CanBeCasted() && targetDistance <= (350 + hullsum) && Utils.SleepCheck("abyssal")) { var canUse = Utils.ChainStun(target, turnTime + 0.1 + Game.Ping / 1000, null, false); if (canUse) { abyssalBlade.UseAbility(target); Utils.Sleep(turnTime * 1000 + 100 + Game.Ping, "abyssal"); Utils.Sleep(turnTime * 1000 + 50, "move"); Utils.Sleep( turnTime * 1000 + 100 + (Math.Max(targetDistance - hullsum - abyssalBlade.CastRange, 0) / me.MovementSpeed) * 1000, "casting"); Utils.Sleep(turnTime * 1000 + 200, "CHAINSTUN_SLEEP"); return(true); } } if (scytheOfVyse != null && scytheOfVyse.CanBeCasted() && targetDistance <= (scytheOfVyse.CastRange + hullsum) && Utils.SleepCheck("hex")) { var canUse = Utils.ChainStun(target, turnTime + 0.1 + Game.Ping / 1000, null, false); if (canUse) { scytheOfVyse.UseAbility(target); Utils.Sleep(turnTime * 1000 + 100 + Game.Ping, "hex"); Utils.Sleep(turnTime * 1000 + 50, "move"); Utils.Sleep( turnTime * 1000 + 100 + (Math.Max(targetDistance - hullsum - scytheOfVyse.CastRange, 0) / me.MovementSpeed) * 1000, "casting"); Utils.Sleep(turnTime * 1000 + 200, "CHAINSTUN_SLEEP"); return(true); } } if (earthshock.CanBeCasted() && Utils.SleepCheck("Q") && enableQ && ((me.Mana - earthshock.ManaCost) > overpower.ManaCost || !overpower.CanBeCasted())) { var radius = earthshock.AbilityData.FirstOrDefault(x => x.Name == "shock_radius").GetValue(0); var pos = target.Position + target.Vector3FromPolarAngle() * ((Game.Ping / 1000 + 0.3f) * target.MovementSpeed); if (mePosition.Distance(pos) < targetDistance) { pos = target.Position; } if (mePosition.Distance2D(pos) <= (radius) && (abyssalBlade == null || !abyssalBlade.CanBeCasted() || mePosition.Distance2D(pos) > 200) && (scytheOfVyse == null || !scytheOfVyse.CanBeCasted() || mePosition.Distance2D(pos) > 200)) { var canUse = Utils.ChainStun(target, 0.3 + Game.Ping / 1000, null, false); if (canUse) { earthshock.UseAbility(); Utils.Sleep(earthshockCastPoint * 1000 + Game.Ping, "Q"); Utils.Sleep(earthshockCastPoint * 1000, "casting"); return(true); } } else if (Utils.SleepCheck("moveCloser")) { me.Move(pos); Utils.Sleep(200, "moveCloser"); return(true); } } if (blink != null && blink.CanBeCasted() && targetDistance > 400 && targetDistance < (blinkRange + hullsum * 2 + me.AttackRange) && Utils.SleepCheck("blink")) { var position = target.Position; if (target.NetworkActivity != NetworkActivity.Idle) { position = target.Position + target.Vector3FromPolarAngle() * (hullsum + me.AttackRange); if (mePosition.Distance(position) < targetDistance) { position = target.Position; } } var dist = position.Distance2D(mePosition); if (dist > blinkRange) { position = (position - mePosition) * (blinkRange - 1) / position.Distance2D(me) + mePosition; } blink.UseAbility(position); mePosition = position; Utils.Sleep(turnTime * 1000 + 100 + Game.Ping, "blink"); Utils.Sleep(turnTime * 1000 + 50, "move"); Utils.Sleep(turnTime * 1000, "casting"); return(true); } const int Radius = 300; var canAttack = !target.IsInvul() && !target.IsAttackImmune() && me.CanAttack(); if (!canAttack) { return(false); } if (overpower.CanBeCasted() && Utils.SleepCheck("W") && !(earthshock.CanBeCasted() && enableQ && Utils.ChainStun(target, 0.3 + Game.Ping / 1000, null, false))) { if (mePosition.Distance2D(target) <= (Radius + hullsum)) { overpower.UseAbility(); Utils.Sleep(overpowerCastPoint * 1000 + Game.Ping, "W"); Utils.Sleep(overpowerCastPoint * 1000, "casting"); return(true); } } if (!enrage.CanBeCasted() || !Utils.SleepCheck("R")) { return(false); } if (!(mePosition.Distance2D(target) <= (Radius + hullsum))) { return(false); } enrage.UseAbility(); Utils.Sleep(100 + Game.Ping, "R"); Utils.Sleep(100, "casting"); return(true); }
/// <summary> /// The game_ on update. /// </summary> /// <param name="args"> /// The args. /// </param> private static void Game_OnUpdate(EventArgs args) { if (!loaded) { me = ObjectMgr.LocalHero; if (!Game.IsInGame || me == null) { return; } loaded = true; target = null; RangeDisplay.Dispose(); Game.PrintMessage( "<font face='Tahoma'><font color='#000000'>[--</font> <font color='#33ff66'>Orbwalker</font> by <font color='#999999'>MOON</font><font color='#ff9900'>ES</font> loaded! <font color='#000000'>--]</font></font>", MessageType.LogMessage); } if (me == null || !me.IsValid) { loaded = false; me = ObjectMgr.LocalHero; target = null; RangeDisplay.Dispose(); return; } RangeDisplay.Me(); if (Game.IsPaused) { return; } if (RangeDisplay.IsDisposed()) { if (me.IsAlive) { RangeDisplay.Create(); } } else { if (!me.IsAlive) { RangeDisplay.Dispose(); } else if (!RangeDisplay.IsUpdated()) { RangeDisplay.Update(); } } if (target != null && (!target.IsValid || !target.IsVisible || !target.IsAlive || target.Health <= 0)) { target = null; } var canCancel = Orbwalking.CanCancelAnimation(); var cd = Orbwalking.AttackOnCooldown(creepTarget); if ((canCancel || !cd) && Utils.SleepCheck("Orbwalk.Attack")) { if (Utils.SleepCheck("Orbwalker.Update.Target")) { if (target != null && !target.IsVisible) { target = me.ClosestToMouseTarget(128); } else if (target == null) { var bestAa = me.BestAATarget(); if (bestAa != null) { target = me.BestAATarget(); } } Utils.Sleep(500, "Orbwalker.Update.Target"); } if (!Game.IsChatOpen && Game.IsKeyDown(Menu.Item("farmKey").GetValue <KeyBind>().Key) && (creepTarget == null || !creepTarget.IsValid || !creepTarget.IsAlive || !creepTarget.IsVisible || Utils.SleepCheck("Orbwalker.Update.Creep"))) { creepTarget = TargetSelector.GetLowestHPCreep(me, 200); Utils.Sleep(500, "Orbwalker.Update.Creep"); } } if (Game.IsChatOpen) { return; } if (Game.IsKeyDown(Menu.Item("farmKey").GetValue <KeyBind>().Key)) { Orbwalking.Orbwalk(creepTarget); return; } if (Game.IsKeyDown(Menu.Item("chaseKey").GetValue <KeyBind>().Key)) { Orbwalking.Orbwalk(target, attackmodifiers: true); return; } if (Game.IsKeyDown(Menu.Item("kiteKey").GetValue <KeyBind>().Key)) { Orbwalking.Orbwalk( target, attackmodifiers: true, bonusWindupMs: Menu.Item("bonusWindup").GetValue <Slider>().Value); } }