Пример #1
0
 private static void UpdateCreeps()
 {
     try
     {
         Var.Creeps = ObjectManager.GetEntities <Unit>()
                      .Where(
             x =>
             (x.ClassID == ClassID.CDOTA_BaseNPC_Tower ||
              x.ClassID == ClassID.CDOTA_BaseNPC_Creep_Lane ||
              x.ClassID == ClassID.CDOTA_BaseNPC_Creep ||
              x.ClassID == ClassID.CDOTA_BaseNPC_Creep_Neutral ||
              x.ClassID == ClassID.CDOTA_BaseNPC_Creep_Siege ||
              x.ClassID == ClassID.CDOTA_BaseNPC_Additive ||
              x.ClassID == ClassID.CDOTA_BaseNPC_Barracks ||
              x.ClassID == ClassID.CDOTA_BaseNPC_Building ||
              x.ClassID == ClassID.CDOTA_BaseNPC_Creature) && x.IsAlive && x.IsVisible &&
             x.Distance2D(Var.Me) < MenuVar.Outrange + MyHeroInfo.AttackRange()).ToList();
     }
     catch (Exception)
     {
         if (MenuVar.ShowErrors)
         {
             Common.PrintError("Update Creeps Error");
         }
     }
 }
Пример #2
0
        public static bool Attacking(Hero target, Hero me)
        {
            var attacking = me.IsAttacking() && me.Distance2D(target) <= MyHeroInfo.AttackRange() + 150 &&
                            me.GetTurnTime(target.Position) < 0.1;

            return(attacking);
        }
Пример #3
0
 public static void LastHit()
 {
     if (!Utils.SleepCheck("Lasthit.Cast"))
     {
         return;
     }
     if (!Var.DisableAaKeyPressed)
     {
         Common.Autoattack(0);
         Var.DisableAaKeyPressed = true;
         Var.AutoAttackTypeDef   = false;
     }
     Var.CreeptargetH = KillableCreep(Var.Me, false, false, 2);
     if (MenuVar.UseSpell && Utils.SleepCheck("Lasthit.Cooldown"))
     {
         SpellCast();
     }
     if (Var.CreeptargetH != null && Var.CreeptargetH.IsValid &&
         Var.CreeptargetH.IsVisible && Var.CreeptargetH.IsAlive)
     {
         var time = Var.Me.IsRanged == false
             ? Var.HeroAPoint / 1000 + Var.Me.GetTurnTime(Var.CreeptargetH.Position)
             : Var.HeroAPoint / 1000 + Var.Me.GetTurnTime(Var.CreeptargetH.Position) +
                    Var.Me.Distance2D(Var.CreeptargetH) / MyHeroInfo.GetProjectileSpeed(Var.Me);
         var getDamage = GetDamageOnUnit(Var.Me, Var.CreeptargetH, 0);
         if (Var.CreeptargetH.Distance2D(Var.Me) <= MyHeroInfo.AttackRange())
         {
             if (Var.CreeptargetH.Health < getDamage ||
                 Var.CreeptargetH.Health < getDamage && Var.CreeptargetH.Team == Var.Me.Team &&
                 (MenuVar.Denie || MenuVar.Aoc))
             {
                 if (!Var.Me.IsAttacking())
                 {
                     Var.Me.Attack(Var.CreeptargetH);
                 }
             }
             else if (Var.CreeptargetH.Health < getDamage * 2 && Var.CreeptargetH.Health >= getDamage &&
                      Var.CreeptargetH.Team != Var.Me.Team && Utils.SleepCheck("Lasthit.Stop"))
             {
                 Var.Me.Hold();
                 Var.Me.Attack(Var.CreeptargetH);
                 Utils.Sleep((float)Var.HeroAPoint / 2 + Game.Ping, "Lasthit.Stop");
             }
         }
         else if (Var.Me.Distance2D(Var.CreeptargetH) >= MyHeroInfo.AttackRange() && Utils.SleepCheck("Lasthit.Walk"))
         {
             Var.Me.Move(Var.CreeptargetH.Position);
             Utils.Sleep(100 + Game.Ping, "Lasthit.Walk");
         }
     }
     else
     {
         Var.Target = MenuVar.Harass ? Var.Me.BestAATarget() : null;
         Orbwalking.Orbwalk(Var.Target, 500);
     }
 }
Пример #4
0
 public static float GetOutRange(Unit unit)
 {
     if (unit.Handle == Var.Me.Handle)
     {
         return(MyHeroInfo.AttackRange() + MenuVar.Outrange);
     }
     else
     {
         if (unit.IsRanged)
         {
             return(500 + MenuVar.Outrange);
         }
         else
         {
             return(200 + MenuVar.Outrange);
         }
     }
 }
Пример #5
0
        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;
            }
        }
Пример #6
0
 public static bool Cast(
     Ability ability,
     Unit target,
     Unit buffTarget,
     string name,
     List <Modifier> modifiers,
     bool togglearmlet = false)
 {
     if (name == "item_armlet")
     {
         if (buffTarget.Modifiers.Any(x => x.Name == "modifier_ice_blast"))
         {
             return(false);
         }
         if (!togglearmlet && buffTarget.Distance2D(target) > Math.Max(target.GetAttackRange(), 500))
         {
             return(false);
         }
         var armlettoggled = modifiers.Any(x => x.Name == "modifier_item_armlet_unholy_strength") &&
                             ability.IsToggled;
         Game.ExecuteCommand("dota_player_units_auto_attack_after_spell 0");
         ManageAutoAttack.AutoAttackDisabled = true;
         if (armlettoggled)
         {
             ability.ToggleAbility();
             ability.ToggleAbility();
             return(true);
         }
         ability.ToggleAbility();
         return(true);
     }
     if (!(buffTarget.Distance2D(target) < MyHeroInfo.AttackRange() + 150))
     {
         return(false);
     }
     SoulRing.Cast(ability);
     if (ability.Name == "templar_assassin_refraction")
     {
         var meld = AbilityMain.Me.Spellbook.Spell2;
         if (meld != null && meld.CanBeCasted())
         {
             if (
                 !(target.Distance2D(MyHeroInfo.Position)
                   < (AbilityMain.Me.GetAttackRange() + 50 + target.HullRadius + AbilityMain.Me.HullRadius)) ||
                 Orbwalking.AttackOnCooldown(target) || AbilityMain.Me.IsAttacking() ||
                 (target.Predict(Game.Ping).Distance2D(MyHeroInfo.Position)
                  > (AbilityMain.Me.GetAttackRange() + 50 + target.HullRadius + AbilityMain.Me.HullRadius)) ||
                 !Utils.SleepCheck("GlobalCasting"))
             {
                 return(false);
             }
             Game.ExecuteCommand("dota_player_units_auto_attack_after_spell 0");
             ManageAutoAttack.AutoAttackDisabled = true;
             ability.UseAbility();
             if (Nuke.Cast(meld, target, NameManager.Name(meld)))
             {
                 DelayAction.Add(
                     new DelayActionItem(
                         (int)meld.GetCastDelay(AbilityMain.Me, target) * 1000 + 100,
                         () =>
                 {
                     AbilityMain.Me.Attack(target);
                 },
                         CancellationToken.None));
             }
             Utils.Sleep(meld.GetCastDelay(AbilityMain.Me, target) * 1000, "GlobalCasting");
             Utils.Sleep(meld.GetHitDelay(target, name) * 1000 + 200, "casting");
             Utils.Sleep(meld.GetHitDelay(target, name) * 1000 + 200, ability.Handle.ToString());
             return(true);
         }
     }
     if (ability.IsAbilityBehavior(AbilityBehavior.NoTarget, name))
     {
         Game.ExecuteCommand("dota_player_units_auto_attack_after_spell 0");
         ManageAutoAttack.AutoAttackDisabled = true;
         ability.UseAbility();
         return(true);
     }
     Game.ExecuteCommand("dota_player_units_auto_attack_after_spell 0");
     ManageAutoAttack.AutoAttackDisabled = true;
     ability.UseAbility(buffTarget);
     return(true);
 }
Пример #7
0
        public static void Drawing(EventArgs args)
        {
            if (!OnUpdate.CanUpdate())
            {
                return;
            }

            if (MenuVar.Maphack || MenuVar.ShowLastPos)
            {
                foreach (var hero in EnemyHeroes.Heroes)
                {
                    ShowMeMore.DrawLastPosition(hero);
                }
            }

            #region Hero radius

            MyHero.RadiusHeroParticleEffect("ExpRange", 1300, new Color(0, 100, 0), MenuVar.ShowExpRange.GetValue <bool>());
            MyHero.RadiusHeroParticleEffect("AttackRange", Var.Me.IsRanged
                ? MyHeroInfo.AttackRange() + 70
                : MyHeroInfo.AttackRange(), new Color(255, 0, 0), MenuVar.ShowAttackRange.GetValue <bool>());

            #endregion Hero radius

            #region Runes

            if (MenuVar.ShowRunesMinimap)
            {
                RunesOnMinimap.Draw();
            }

            #endregion Runes

            #region Lasthit

            if (MenuVar.LastHitEnable)
            {
                if (MenuVar.ShowHp)
                {
                    Lasthit.Drawhpbar();
                }
            }

            #endregion Lasthit

            #region JungleStack

            if (MenuVar.StackKey && MenuVar.DrawStackLine)
            {
                JungleDraw.DrawLine();
            }
            else
            {
                JungleDraw.Clear();
            }

            #endregion JungleStack

            #region ShowMeMore

            if (MenuVar.ShowIllusions && EnemyHeroes.Illusions.Count > 0)
            {
                ShowMeMore.ShowIllusion();
            }
            else
            {
                ShowMeMore.ClearParticle();
            }

            foreach (var hero in AllyHeroes.Heroes)
            {
                ShowMeMore.DrawShowMeMoreBara(hero);
            }

            #endregion ShowMeMore

            #region Top ovellay

            if (MenuVar.ShowTopOverlayEnemyHp)
            {
                Overlay.DrawTopOverlayHealth(EnemyHeroes.Heroes, MenuVar.HealthHeightEnemy,
                                             new Color(MenuVar.OverlayHealthEnemyRed, MenuVar.OverlayHealthEnemyGreen, MenuVar.OverlayHealthEnemyBlue, MenuVar.OverlayAlpha));
            }
            if (MenuVar.ShowTopOverlayEnemyMp)
            {
                Overlay.DrawTopOverlayMana(EnemyHeroes.Heroes, MenuVar.ManaHeightEnemy,
                                           new Color(MenuVar.OverlayManaEnemyRed, MenuVar.OverlayManaEnemyGreen, MenuVar.OverlayManaEnemyBlue, MenuVar.OverlayAlpha));
            }
            if (MenuVar.ShowTopOverlayEnemyUltLine)
            {
                Overlay.DrawTopOverlayUltimateCooldownLine(EnemyHeroes.Heroes, MenuVar.UltimateHeightEnemy, MenuVar.OverlayAlpha);
            }
            if (MenuVar.ShowTopOverlayEnemyUltText)
            {
                Overlay.DrawTopOverlayUltimateCooldownText(EnemyHeroes.Heroes, MenuVar.OverlayAlpha);
            }
            if (MenuVar.ShowTopOverlayEnemy)
            {
                Overlay.DrawTopOverlay(EnemyHeroes.Heroes);
            }

            if (MenuVar.ShowTopOverlayAllyHp)
            {
                Overlay.DrawTopOverlayHealth(AllyHeroes.Heroes, MenuVar.HealthHeightAlly,
                                             new Color(MenuVar.OverlayHealthAllyRed, MenuVar.OverlayHealthAllyGreen, MenuVar.OverlayHealthAllyBlue, MenuVar.OverlayAlpha));
            }
            if (MenuVar.ShowTopOverlayAllyMp)
            {
                Overlay.DrawTopOverlayMana(AllyHeroes.Heroes, MenuVar.ManaHeightAlly,
                                           new Color(MenuVar.OverlayManaAllyRed, MenuVar.OverlayManaAllyGreen, MenuVar.OverlayManaAllyBlue, MenuVar.OverlayAlpha));
            }
            if (MenuVar.ShowTopOverlayAllyUltLine)
            {
                Overlay.DrawTopOverlayUltimateCooldownLine(AllyHeroes.Heroes, MenuVar.UltimateHeightAlly, MenuVar.OverlayAlpha);
            }
            if (MenuVar.ShowTopOverlayAllyUltText)
            {
                Overlay.DrawTopOverlayUltimateCooldownText(AllyHeroes.Heroes, MenuVar.OverlayAlpha);
            }
            if (MenuVar.ShowTopOverlayAlly)
            {
                Overlay.DrawTopOverlay(AllyHeroes.Heroes);
            }

            Overlay.DrawTopHelpOverlay(EnemyHeroes.Heroes,
                                       new Color(MenuVar.OverlayHealthEnemyRed, MenuVar.OverlayHealthEnemyGreen, MenuVar.OverlayHealthEnemyBlue, MenuVar.OverlayAlpha));
            Overlay.DrawTopHelpOverlay(AllyHeroes.Heroes,
                                       new Color(MenuVar.OverlayHealthAllyRed, MenuVar.OverlayHealthAllyGreen, MenuVar.OverlayHealthAllyBlue, MenuVar.OverlayAlpha));

            #endregion Top ovellay

            #region JungleStack

            if (MenuVar.StackKey)
            {
                JungleDraw.DrawCamp();
            }

            //foreach (var x in ShowMeMore.Courier)
            //{
            //    try
            //    {
            //        var pos = Ensage.Drawing.WorldToScreen(x.Value);
            //        DrawText(x.Key.Name, (int) pos.X, (int) pos.Y, Color.Aqua, Var.VisibleFont);

            //    }
            //    catch (Exception)
            //    {
            //        //
            //    }
            //}

            //if (Utils.SleepCheck("111"))
            //{
            //    ShowMeMore.Courier.Clear();
            //    Utils.Sleep(3000, "111");
            //}

            #endregion JungleStack

            #region CouInfo

            if (MenuVar.CouForced)
            {
                Overlay.DrawCouForce();
            }

            if (MenuVar.CouAbuse)
            {
                Overlay.DrawCouAbuse();
            }

            if (MenuVar.CouLock)
            {
                Overlay.DrawCouLock();
            }

            #endregion CouInfo

            #region DevInfo

            if (MenuVar.ShowInfo)
            {
                Dev.DevInfo();
            }
            else
            {
                Dev.DevInfoDispose();
            }

            #endregion DevInfo
        }
Пример #8
0
        private static double GetDamageOnUnitForDrawhpbar(Unit unit, double bonusdamage)
        {
            var    quellingBlade = Var.Me.FindItem("item_quelling_blade");
            double modif         = 1;
            double magicdamage   = 0;
            double physDamage    = Var.Me.MinimumDamage + Var.Me.BonusDamage;

            if (quellingBlade != null && unit.Team != Var.Me.Team)
            {
                if (Var.Me.IsRanged)
                {
                    physDamage = Var.Me.MinimumDamage * 1.15 + Var.Me.BonusDamage;
                }
                else
                {
                    physDamage = Var.Me.MinimumDamage * 1.4 + Var.Me.BonusDamage;
                }
            }
            double bonusdamage2 = 0;

            switch (Var.Me.ClassID)
            {
            case ClassID.CDOTA_Unit_Hero_AntiMage:
                if (unit.MaximumMana > 0 && unit.Mana > 0 && Var.Q.Level > 0 && unit.Team != Var.Me.Team)
                {
                    bonusdamage2 = (Var.Q.Level - 1) * 12 + 28 * 0.6;
                }
                break;

            case ClassID.CDOTA_Unit_Hero_Viper:
                if (Var.W.Level > 0 && unit.Team != Var.Me.Team)
                {
                    var nethertoxindmg = Var.W.Level * 2.5;
                    //var percent = Math.Floor((double) unit.Health / unit.MaximumHealth * 100);
                    //if (percent > 80 && percent <= 100)
                    //    bonusdamage2 = nethertoxindmg * 0.5;
                    //else if (percent > 60 && percent <= 80)
                    //    bonusdamage2 = nethertoxindmg * 1;
                    //else if (percent > 40 && percent <= 60)
                    //    bonusdamage2 = nethertoxindmg * 2;
                    //else if (percent > 20 && percent <= 40)
                    //    bonusdamage2 = nethertoxindmg * 4;
                    //else if (percent > 0 && percent <= 20)
                    //    bonusdamage2 = nethertoxindmg * 8;
                }
                break;

            case ClassID.CDOTA_Unit_Hero_Ursa:
                var furymodif = 0;
                if (Var.Me.Modifiers.Any(x => x.Name == "modifier_ursa_fury_swipes_damage_increase"))
                {
                    furymodif =
                        unit.Modifiers.Find(x => x.Name == "modifier_ursa_fury_swipes_damage_increase").StackCount;
                }
                if (Var.E.Level > 0)
                {
                    if (furymodif > 0)
                    {
                        bonusdamage2 = furymodif * ((Var.E.Level - 1) * 5 + 15);
                    }
                    else
                    {
                        bonusdamage2 = (Var.E.Level - 1) * 5 + 15;
                    }
                }
                break;

            case ClassID.CDOTA_Unit_Hero_BountyHunter:
                if (Var.W.Level > 0 && Var.W.AbilityState == AbilityState.Ready)
                {
                    bonusdamage2 = physDamage * ((Var.W.Level - 1) * 0.25 + 0.50);
                }
                break;

            case ClassID.CDOTA_Unit_Hero_Weaver:
                if (Var.E.Level > 0 && Var.E.AbilityState == AbilityState.Ready)
                {
                    bonusdamage2 = physDamage;
                }
                break;

            case ClassID.CDOTA_Unit_Hero_Kunkka:
                if (Var.W.Level > 0 && Var.W.AbilityState == AbilityState.Ready && Var.W.IsAutoCastEnabled)
                {
                    bonusdamage2 = (Var.W.Level - 1) * 15 + 25;
                }
                break;

            case ClassID.CDOTA_Unit_Hero_Juggernaut:
                if (Var.E.Level > 0)
                {
                    if (Var.Me.NetworkActivity == NetworkActivity.Crit)
                    {
                        bonusdamage2 = physDamage;
                    }
                }
                break;

            case ClassID.CDOTA_Unit_Hero_Brewmaster:
                if (Var.E.Level > 0)
                {
                    if (Var.Me.NetworkActivity == NetworkActivity.Crit)
                    {
                        bonusdamage2 = physDamage;
                    }
                }
                break;

            case ClassID.CDOTA_Unit_Hero_ChaosKnight:
                if (Var.E.Level > 0)
                {
                    if (Var.Me.NetworkActivity == NetworkActivity.Crit)
                    {
                        bonusdamage2 = physDamage * ((Var.E.Level - 1) * 0.5 + 0.25);
                    }
                }
                break;

            case ClassID.CDOTA_Unit_Hero_Clinkz:
                if (Var.W.Level > 0 && Var.W.IsAutoCastEnabled && unit.Team != Var.Me.Team)
                {
                    bonusdamage2 = (Var.W.Level - 1) * 10 + 30;
                }
                break;

            case ClassID.CDOTA_Unit_Hero_SkeletonKing:
                if (Var.E.Level > 0)
                {
                    if (Var.Me.NetworkActivity == NetworkActivity.Crit)
                    {
                        bonusdamage2 = physDamage * ((Var.E.Level - 1) * 0.5 + 0.5);
                    }
                }
                break;

            case ClassID.CDOTA_Unit_Hero_Life_Stealer:
                if (Var.W.Level > 0)
                {
                    bonusdamage2 = unit.Health * ((Var.W.Level - 1) * 0.01 + 0.045);
                }
                break;

            case ClassID.CDOTA_Unit_Hero_PhantomAssassin:
                if (Var.R.Level > 0)
                {
                    if (Var.Me.NetworkActivity == NetworkActivity.Crit)
                    {
                        bonusdamage2 = physDamage * ((Var.R.Level - 1) * 1.1 + 1.3);
                    }
                }
                break;
            }

            if (Var.Me.Modifiers.Any(x => x.Name == "modifier_bloodseeker_bloodrage"))
            {
                modif = modif *
                        (ObjectManager.GetEntities <Hero>()
                         .First(x => x.ClassID == ClassID.CDOTA_Unit_Hero_Bloodseeker)
                         .Spellbook.Spell1.Level - 1) * 0.05 + 1.25;
            }
            if (Var.Me.Modifiers.Any(x => x.Name == "modifier_storm_spirit_overload"))
            {
                magicdamage = magicdamage + (Var.E.Level - 1) * 20 + 30;
            }
            if (Var.Me.Modifiers.Any(x => x.Name == "modifier_chilling_touch"))
            {
                magicdamage = magicdamage + (Var.E.Level - 1) * 20 + 50;
            }
            if (Var.Me.ClassID == ClassID.CDOTA_Unit_Hero_Pudge && Var.W.Level > 0 && MenuVar.UseSpell &&
                Var.Me.Distance2D(unit) <= MyHeroInfo.AttackRange())
            {
                magicdamage = magicdamage + (Var.W.Level - 1) * 6 + 6;
            }

            bonusdamage = bonusdamage + bonusdamage2;
            var damageMp = 1 - 0.06 * unit.Armor / (1 + 0.06 * Math.Abs(unit.Armor));

            magicdamage = magicdamage * (1 - unit.MagicDamageResist);

            var realDamage = ((bonusdamage + physDamage) * damageMp + magicdamage) * modif;

            if (unit.ClassID == ClassID.CDOTA_BaseNPC_Creep_Siege ||
                unit.ClassID == ClassID.CDOTA_BaseNPC_Tower)
            {
                realDamage = realDamage / 2;
            }
            if (realDamage > unit.MaximumHealth)
            {
                realDamage = unit.Health + 10;
            }

            return(realDamage);
        }
Пример #9
0
        private static double GetDamageOnUnit(Unit unit, Unit minion, double bonusdamage)
        {
            double modif       = 1;
            double magicdamage = 0;
            double physDamage  = unit.MinimumDamage + unit.BonusDamage;

            if (unit.Handle == Var.Me.Handle)
            {
                var quellingBlade = unit.FindItem("item_quelling_blade");
                if (quellingBlade != null && minion.Team != unit.Team)
                {
                    if (unit.IsRanged)
                    {
                        physDamage = unit.MinimumDamage * 1.15 + unit.BonusDamage;
                    }
                    else
                    {
                        physDamage = unit.MinimumDamage * 1.4 + unit.BonusDamage;
                    }
                }
                switch (unit.ClassID)
                {
                case ClassID.CDOTA_Unit_Hero_AntiMage:
                    if (minion.MaximumMana > 0 && minion.Mana > 0 && Var.Q.Level > 0 && minion.Team != unit.Team)
                    {
                        bonusdamage += (Var.Q.Level - 1) * 12 + 28 * 0.6;
                    }
                    break;

                case ClassID.CDOTA_Unit_Hero_Viper:
                    if (Var.W.Level > 0 && minion.Team != unit.Team)
                    {
                        var nethertoxindmg = Var.W.Level * 2.5;
                        //var percent = Math.Floor((double) unit.Health / unit.MaximumHealth * 100);
                        //if (percent > 80 && percent <= 100)
                        //    bonusdamage2 = nethertoxindmg * 0.5;
                        //else if (percent > 60 && percent <= 80)
                        //    bonusdamage2 = nethertoxindmg * 1;
                        //else if (percent > 40 && percent <= 60)
                        //    bonusdamage2 = nethertoxindmg * 2;
                        //else if (percent > 20 && percent <= 40)
                        //    bonusdamage2 = nethertoxindmg * 4;
                        //else if (percent > 0 && percent <= 20)
                        //    bonusdamage2 = nethertoxindmg * 8;
                    }
                    break;

                case ClassID.CDOTA_Unit_Hero_Ursa:
                    var furymodif = 0;
                    if (unit.Modifiers.Any(x => x.Name == "modifier_ursa_fury_swipes_damage_increase"))
                    {
                        furymodif =
                            minion.Modifiers.Find(x => x.Name == "modifier_ursa_fury_swipes_damage_increase")
                            .StackCount;
                    }
                    if (Var.E.Level > 0)
                    {
                        if (furymodif > 0)
                        {
                            bonusdamage += furymodif * ((Var.E.Level - 1) * 5 + 15);
                        }
                        else
                        {
                            bonusdamage += (Var.E.Level - 1) * 5 + 15;
                        }
                    }
                    break;

                case ClassID.CDOTA_Unit_Hero_BountyHunter:
                    if (Var.W.Level > 0 && Var.W.AbilityState == AbilityState.Ready)
                    {
                        bonusdamage += physDamage * ((Var.W.Level - 1) * 0.25 + 0.50);
                    }
                    break;

                case ClassID.CDOTA_Unit_Hero_Weaver:
                    if (Var.E.Level > 0 && Var.E.AbilityState == AbilityState.Ready)
                    {
                        bonusdamage += physDamage;
                    }
                    break;

                case ClassID.CDOTA_Unit_Hero_Kunkka:
                    if (Var.W.Level > 0 && Var.W.AbilityState == AbilityState.Ready && Var.W.IsAutoCastEnabled)
                    {
                        bonusdamage += (Var.W.Level - 1) * 15 + 25;
                    }
                    break;

                case ClassID.CDOTA_Unit_Hero_Juggernaut:
                    if (Var.E.Level > 0)
                    {
                        if (unit.NetworkActivity == NetworkActivity.Crit)
                        {
                            bonusdamage += physDamage;
                        }
                    }
                    break;

                case ClassID.CDOTA_Unit_Hero_Brewmaster:
                    if (Var.E.Level > 0)
                    {
                        if (unit.NetworkActivity == NetworkActivity.Crit)
                        {
                            bonusdamage += physDamage;
                        }
                    }
                    break;

                case ClassID.CDOTA_Unit_Hero_ChaosKnight:
                    if (Var.E.Level > 0)
                    {
                        if (unit.NetworkActivity == NetworkActivity.Crit)
                        {
                            bonusdamage += physDamage * ((Var.E.Level - 1) * 0.5 + 0.25);
                        }
                    }
                    break;

                case ClassID.CDOTA_Unit_Hero_SkeletonKing:
                    if (Var.E.Level > 0)
                    {
                        if (unit.NetworkActivity == NetworkActivity.Crit)
                        {
                            bonusdamage += physDamage * ((Var.E.Level - 1) * 0.5 + 0.5);
                        }
                    }
                    break;

                case ClassID.CDOTA_Unit_Hero_Life_Stealer:
                    if (Var.E.Level > 0)
                    {
                        bonusdamage += minion.Health * ((Var.E.Level - 1) * 0.01 + 0.045);
                    }
                    break;

                case ClassID.CDOTA_Unit_Hero_PhantomAssassin:
                    if (Var.E.Level > 0)
                    {
                        if (unit.NetworkActivity == NetworkActivity.Crit)
                        {
                            bonusdamage += physDamage * ((Var.E.Level - 1) * 1.1 + 1.3);
                        }
                    }
                    break;
                }
                if (unit.Modifiers.Any(x => x.Name == "modifier_storm_spirit_overload"))
                {
                    magicdamage += (Var.E.Level - 1) * 20 + 30;
                }
                if (unit.Modifiers.Any(x => x.Name == "modifier_chilling_touch"))
                {
                    magicdamage += (Var.E.Level - 1) * 20 + 50;
                }
                if (unit.ClassID == ClassID.CDOTA_Unit_Hero_Pudge && Var.W.Level > 0 &&
                    MenuVar.UseSpell &&
                    unit.Distance2D(minion) <= MyHeroInfo.AttackRange())
                {
                    magicdamage += (Var.W.Level - 1) * 6 + 6;
                }
            }
            if (unit.Modifiers.Any(x => x.Name == "modifier_bloodseeker_bloodrage"))
            {
                modif = modif *
                        (ObjectManager.GetEntities <Hero>()
                         .First(x => x.ClassID == ClassID.CDOTA_Unit_Hero_Bloodseeker)
                         .Spellbook.Spell1.Level - 1) * 0.05 + 1.25;
            }
            if (Var.Summons != null && Var.Summons.Count > 1 && Var.Summons.Any(x => x.Key.IsAlive) &&
                Var.Summons.Any(x => x.Key.Handle != unit.Handle) && Var.CreeptargetS != null)
            {
                if (Var.CreeptargetH == null ||
                    (Var.CreeptargetH.Handle != Var.CreeptargetS.Handle && Var.Me.Handle != unit.Handle))
                {
                    bonusdamage =
                        Var.Summons.Where(
                            x =>
                            x.Key.Handle != unit.Handle && x.Key.CanAttack() &&
                            (Math.Abs(x.Key.Distance2D(minion) - x.Key.AttackRange) < 100 ||
                             Math.Abs(x.Key.Distance2D(minion) - unit.Distance2D(minion)) < 100))
                        .Aggregate(bonusdamage, (current, x) => current + x.Key.MinimumDamage + x.Key.BonusDamage);
                }
                else if (Var.CreeptargetH.Handle == Var.CreeptargetS.Handle && Var.Me.Handle != unit.Handle)
                {
                    if (Var.Summons.Any(x => x.Key.Handle != unit.Handle))
                    {
                        bonusdamage +=
                            Var.Summons.Where(
                                x =>
                                x.Key.Handle != unit.Handle && x.Key.CanAttack() &&
                                x.Key.Distance2D(minion) < x.Key.AttackRange)
                            .Aggregate(bonusdamage,
                                       (current, x) => current + x.Key.MinimumDamage + x.Key.BonusDamage);
                    }
                    if (Var.Me.Distance2D(minion) < Var.Me.AttackRange && Var.Me.CanAttack())
                    {
                        bonusdamage += Var.Me.MinimumDamage + Var.Me.BonusDamage;
                    }
                }
                else if (Var.Me.Handle == unit.Handle && Var.CreeptargetH.Handle == Var.CreeptargetS.Handle)
                {
                    bonusdamage +=
                        Var.Summons.Where(x => x.Key.Distance2D(minion) < x.Key.AttackRange && x.Key.CanAttack())
                        .Aggregate(bonusdamage, (current, x) => current + x.Key.MinimumDamage + x.Key.BonusDamage);
                }
            }

            var damageMp = 1 - 0.06 * minion.Armor / (1 + 0.06 * Math.Abs(minion.Armor));

            magicdamage = magicdamage * (1 - minion.MagicDamageResist);

            var realDamage = ((bonusdamage + physDamage) * damageMp + magicdamage) * modif;

            if (minion.ClassID == ClassID.CDOTA_BaseNPC_Creep_Siege ||
                minion.ClassID == ClassID.CDOTA_BaseNPC_Tower)
            {
                realDamage = realDamage / 2;
            }
            if (realDamage > minion.MaximumHealth)
            {
                realDamage = minion.Health + 10;
            }

            return(realDamage);
        }
Пример #10
0
        private static void SpellCast()
        {
            try
            {
                foreach (var creep in Var.Creeps.Where(x => x.Team != Var.Me.Team)
                         .OrderByDescending(creep => creep.Health))
                {
                    double damage = 0;
                    switch (Var.Me.ClassID)
                    {
                    case ClassID.CDOTA_Unit_Hero_Zuus:
                        if (Var.Q.Level > 0 && Var.Q.CanBeCasted() && Var.Me.Distance2D(creep) > MyHeroInfo.AttackRange())
                        {
                            damage = ((Var.Q.Level - 1) * 15 + 85) * (1 - creep.MagicDamageResist);
                            if (damage > creep.Health)
                            {
                                Var.Q.UseAbility(creep);
                                Utils.Sleep(Var.Q.GetCastPoint(Var.Q.Level) * 1000 + 50 + Game.Ping, "Lasthit.Cast");
                                Utils.Sleep(Var.Q.GetCooldown(Var.Q.Level) * 1000 + 50 + Game.Ping, "Lasthit.Cooldown");
                            }
                        }
                        break;

                    case ClassID.CDOTA_Unit_Hero_Bristleback:
                        if (Var.W.Level > 0 && Var.W.CanBeCasted() && Var.Me.Distance2D(creep) > MyHeroInfo.AttackRange())
                        {
                            double quillSprayDmg = 0;
                            if (creep.Modifiers.Any(
                                    x =>
                                    x.Name == "modifier_bristleback_quill_spray_stack" ||
                                    x.Name == "modifier_bristleback_quill_spray"))
                            {
                                quillSprayDmg =
                                    creep.Modifiers.Find(
                                        x =>
                                        x.Name == "modifier_bristleback_quill_spray_stack" ||
                                        x.Name == "modifier_bristleback_quill_spray").StackCount * 30 +
                                    (Var.W.Level - 1) * 2;
                            }
                            damage = ((Var.W.Level - 1) * 20 + 20 + quillSprayDmg) *
                                     (1 - 0.06 * creep.Armor / (1 + 0.06 * creep.Armor));
                            if (damage > creep.Health && Var.W.CastRange > Var.Me.Distance2D(creep))
                            {
                                Var.W.UseAbility();
                                Utils.Sleep(Var.W.GetCastPoint(Var.W.Level) * 1000 + 50 + Game.Ping, "Lasthit.Cast");
                                Utils.Sleep(Var.W.GetCooldown(Var.W.Level) * 1000 + 50 + Game.Ping, "Lasthit.Cooldown");
                            }
                        }
                        break;

                    case ClassID.CDOTA_Unit_Hero_PhantomAssassin:
                        if (Var.Q.Level > 0 && Var.Q.CanBeCasted() && Var.Me.Distance2D(creep) > MyHeroInfo.AttackRange())
                        {
                            var time = 300 + Var.Me.Distance2D(creep) / Var.Q.GetProjectileSpeed();
                            if (time < creep.SecondsPerAttack * 1000)
                            {
                                damage = ((Var.Q.Level - 1) * 40 + 60) * (1 - 0.06 * creep.Armor / (1 + 0.06 * creep.Armor));
                            }
                            if (damage > creep.Health)
                            {
                                Var.Q.UseAbility(creep);
                                Utils.Sleep(Var.Q.GetCastPoint(Var.Q.Level) * 1000 + 50 + Game.Ping, "Lasthit.Cast");
                                Utils.Sleep(6 * 1000 + Game.Ping, "Lasthit.Cooldown");
                            }
                        }
                        break;

                    case ClassID.CDOTA_Unit_Hero_Pudge:
                        if (Var.W.Level > 0)
                        {
                            if (Var.CreeptargetH != null && creep.Handle == Var.CreeptargetH.Handle &&
                                Var.Me.Distance2D(creep) <= MyHeroInfo.AttackRange())
                            {
                                damage = GetDamageOnUnit(Var.Me, creep, 0);
                                if (damage > creep.Health && !Var.W.IsToggled && Var.Me.IsAttacking())
                                {
                                    Var.W.ToggleAbility();
                                    Utils.Sleep(200 + Game.Ping, "Lasthit.Cooldown");
                                }
                            }
                            if (Var.W.IsToggled)
                            {
                                Var.W.ToggleAbility();
                                Utils.Sleep((float)Var.HeroAPoint + Game.Ping, "Lasthit.Cooldown");
                            }
                        }
                        break;
                    }
                }
            }
            catch (Exception)
            {
                //
            }
        }