Esempio n. 1
0
 public static void HeroVisible()
 {
     if (Variables.me.IsVisibleToEnemies)
     {
         // Variables.DrawNotification = true;
         ESP.Draw.Notifier.Info("Enemies can see you", Color.Red, 2);
         if (Utils.SleepCheck("particleEffect"))
         {
             if (Variables.visibleGlow.IsDestroyed)
             {
                 Variables.visibleGlow = new ParticleEffect(Variables.visibleParticleEffect, Variables.me);
             }
             Variables.visibleGlow.Restart();
             if (Variables.DeveloperMode)
             {
                 Print.Info("Particle effect added");
             }
             Utils.Sleep(500, "particleEffect");
         }
     }
     else
     {
         Variables.DrawNotification = false;
         if (!Variables.visibleGlow.IsDestroyed)
         {
             Variables.visibleGlow.Dispose();
         }
         ESP.Draw.Notifier.Info("Hidden from enemies", Color.Orange, 2);
     }
 }
Esempio n. 2
0
        public static void GetRunes()
        {
            bool isRunes = false;

            if (Variables.DeveloperMode)
            {
                Print.Info("Checking for runes");
            }
            foreach (Rune r in ObjectMgr.GetEntities <Rune>().Where(rune => rune.IsVisibleForTeam(Variables.me.Team)).ToList())
            {
                isRunes = true;
                if (Variables.DeveloperMode)
                {
                    Print.Info("Rune found");
                }
                switch (r.Position.X.ToString())
                {
                case "2812.563":                       //Bot Rune
                    if (!Variables.BottomRune.current) //if rune should be updated
                    {
                        if (Variables.DeveloperMode)
                        {
                            Print.Info(r.RuneType.ToString());
                        }
                        Variables.BottomRune.rune    = r;
                        Variables.BottomRune.current = true;
                    }
                    break;

                case "-2237.438":                   //Top Rune
                    if (!Variables.TopRune.current) //if rune should be updated
                    {
                        if (Variables.DeveloperMode)
                        {
                            Print.Info(r.RuneType.ToString());
                        }
                        Variables.TopRune.rune    = r;
                        Variables.TopRune.current = true;
                    }
                    break;
                    //  default: Print.Success(r.Position.X.ToString()); break;
                }
                if (Variables.TopRune.current && Variables.BottomRune.current)
                {
                    Utils.Sleep(Variables.TimeTillNextRune * 1000, "runeCheck");
                    if (Variables.DeveloperMode)
                    {
                        Print.Info(string.Format("runeCheck sleeping for {0} seconds", Variables.TimeTillNextRune));
                    }
                }
                else
                {
                    Utils.Sleep(250, "runeCheck");
                }
            }
            if (!isRunes)
            {
                Utils.Sleep(250, "runeCheck");
            }
        }
Esempio n. 3
0
        public static void QueueCombo(Hero enemy)
        {
            //    for (int i = 0; i != 5; i++)
            //   {
            var rot       = Variables.me.Spellbook.SpellW;
            var dismember = Variables.me.Spellbook.SpellR;
            var urn       = Variables.me.FindItem("item_urn_of_shadows");
            var eblade    = Variables.me.FindItem("item_ethereal_blade");
            var dagon     = Variables.me.GetDagon();

            Print.Error(string.Format("[{0}]", GlobalClasses.GetHeroNameFromLongHeroName(enemy.Name)));
            Variables.HookCounter++;
            if (!rot.IsToggled && rot.Level > 0)     //rot
            {
                rot.ToggleAbility();
                Print.Info("Queued Rot");
            }
            if (urn != null)     //urn
            {
                if (urn.CurrentCharges > 0)
                {
                    urn.UseAbility(enemy, true);
                    Print.Info("Queued Urn");
                }
            }
            if (eblade != null)     //eblade
            {
                eblade.UseAbility(enemy, true);
                Print.Info("Queued Eblade");
            }
            if (dagon != null)     //dagon
            {
                dagon.UseAbility(enemy, true);
                Print.Info("Queued Dagon");
            }
            if (dismember.Level > 0 && dismember.AbilityState == AbilityState.Ready)     //dismember (ulti)
            {
                dismember.UseAbility(enemy, true);
                Print.Info("Queued Dismember");
            }
            Print.Error(string.Format("[{0}]", GlobalClasses.GetHeroNameFromLongHeroName(enemy.Name)));
            // }
        }
Esempio n. 4
0
        public static PredictClass getPrediction(Hero me, Hero enemy, string Method)
        {
            var          Angle = enemy.FindAngleR();
            PredictClass pre   = new PredictClass();

            pre.PredictedLocation = Vector2.Zero;
            pre.closest           = false;
            switch (Method)
            {
            case "one":
                Vector2 StraightDis = /*enemy.Position;*/ Drawing.WorldToScreen(enemy.Position);    //Facing position line
                StraightDis.X += (float)Math.Cos(Angle) * 100;
                StraightDis.Y += (float)Math.Sin(Angle) * 100;
                //
                Vector2 me2D                      = Drawing.WorldToScreen(Variables.me.Position);
                Vector2 enemy2D                   = Drawing.WorldToScreen(enemy.Position);
                Vector2 enemyDirection2D          = StraightDis;
                var     alpha1                    = Math.Atan((me2D.Y - enemy2D.Y) / (me2D.X - enemy2D.X));
                var     alpha2                    = Math.Atan((enemyDirection2D.Y - enemy2D.Y) / (enemyDirection2D.X - enemy2D.X));
                var     alpha                     = Math.Abs(alpha2 - alpha1);
                var     beta                      = Math.Asin((enemy.MovementSpeed / Variables.HookSpeed) * Math.Sin(alpha));
                var     distanceBetweenMeandEnemy = Variables.me.Distance2D(enemy.Position);
                var     time                      = (distanceBetweenMeandEnemy) / ((enemy.MovementSpeed * Math.Cos(alpha)) + (Variables.HookSpeed * Math.Cos(beta)));

                // Print.Info(time.ToString());
                var     predictedDistance = enemy.MovementSpeed * time;
                Vector2 StraightDis2D     = Drawing.WorldToScreen(enemy.Position); //Facing position line
                StraightDis2D.X += (float)Math.Cos(Angle) * (float)predictedDistance + (float)(enemy.MovementSpeed * Variables.me.Spellbook.Spell1.GetCastDelay(Variables.me, enemy));
                StraightDis2D.Y += (float)Math.Sin(Angle) * ((float)predictedDistance + (float)(enemy.MovementSpeed * Variables.me.Spellbook.Spell1.GetCastDelay(Variables.me, enemy)));
                // ESP.Draw.Enemy.PredictionBox(StraightDis2D, Color.Black);
                pre.PredictedLocation = StraightDis2D;
                return(pre);

                break;

            case "two":

                //Previous prediction method
                var tBase              = 0.1;
                var tIncrement         = 0.1;
                var enemyMovementSpeed = enemy.MovementSpeed;
                if (enemy.Name == "npc_dota_hero_spirit_breaker")
                {
                    foreach (var mod in enemy.Modifiers)
                    {
                        if (mod.Name.Contains("charge"))
                        {
                            tBase              = 0.05;
                            tIncrement         = 0.05;
                            enemyMovementSpeed = 550 + ((int)enemy.Spellbook.Spell1.Level * 50);
                        }
                    }
                }
                for (double t = tBase; t <= 1; t += tIncrement)
                {
                    var     dis          = enemyMovementSpeed * t;
                    Vector2 StraightDis1 = /*enemy.Position;*/ Drawing.WorldToScreen(enemy.Position);    //Facing position line
                    StraightDis1.X += (float)Math.Cos(Angle) * (float)dis;
                    StraightDis1.Y += (float)Math.Sin(Angle) * (float)dis;
                    //
                    Vector3 StraightDis3D1 = enemy.Position;     //Facing position line
                    StraightDis3D1.X += (float)Math.Cos(enemy.RotationRad) * ((float)dis + 120);
                    StraightDis3D1.Y += (float)Math.Sin(enemy.RotationRad) * ((float)dis + 120);
                    if (Variables.DeveloperMode)
                    {
                        Drawing.DrawText("***", Drawing.WorldToScreen(StraightDis3D1), Color.Red, FontFlags.None);
                    }
                    var DistanceFromMeToPredict = Variables.me.Distance2D(StraightDis3D1);

                    if (Variables.me.Spellbook.Spell1.AbilityState == AbilityState.Ready)
                    {
                        var foobar1 = DistanceFromMeToPredict / Variables.HookSpeed;
                        if (foobar1 >= t * .8 && foobar1 <= t * 1.2)
                        {
                            //  Print.Info(Drawing.WorldToScreen(StraightDis3D1).ToString() + " | " + StraightDis1.ToString());
                            if (Variables.Settings.Auto_Hook_Value.val == 0)
                            {
                                if (Utils.SleepCheck("hook") && (Variables.HookForMe))
                                {
                                    Print.Info("casting hook");
                                    Variables.HookLocationDrawer = true;
                                    Variables.EnemyLocation      = Drawing.WorldToScreen(enemy.Position);
                                    Variables.AutoHookLocation   = Drawing.WorldToScreen(StraightDis3D1);
                                    Variables.PredictionLocation = StraightDis1;
                                    //Variables.me.Spellbook.Spell1.UseAbility(StraightDis3D1); //Hook based on prediction location (buggy)
                                    Variables.me.Spellbook.Spell1.CastSkillShot(enemy);     //Ensage skill shot caster (temp solution untill fix)
                                    Utils.Sleep(1000, "hook");
                                    Variables.HookForMe = false;
                                }
                                if (ESP.Calculate.Enemy.ClosestToMouse(me).Player.Name == enemy.Player.Name)
                                {
                                    pre.closest = true;
                                }
                            }
                            pre.PredictedLocation = StraightDis1;
                            return(pre);

                            break;
                        }
                    }
                }
                return(pre);

                break;
            }
            return(pre);
        }