Ejemplo n.º 1
0
        public static int CalculateMaximumDamageOutput(Hero me, Hero enemy)
        {
            try
            {
                var hook            = me.Spellbook.Spell1;
                var rot             = me.Spellbook.SpellW;
                var dismember       = me.Spellbook.SpellR;
                var urn             = me.FindItem("item_urn_of_shadows");
                var dagon           = me.GetDagon();
                var eblade          = me.FindItem("item_ethereal_blade");
                var Damage          = 0;
                var theoreticalMana = me.Mana;
                var resis           = 1 - enemy.MagicDamageResist;

                if (hook != null)
                {
                    if (hook.Level > 0 && theoreticalMana - hook.ManaCost >= 0 && hook.AbilityState == AbilityState.Ready)
                    {
                        if (me.AghanimState())
                        {
                            Damage += (int)hook.AbilityData.FirstOrDefault(x => x.Name == "damage_scepter").GetValue(hook.Level - 1);
                        }
                        else
                        {
                            Damage += (int)hook.AbilityData.FirstOrDefault(x => x.Name == "#AbilityDamage").GetValue(hook.Level - 1);
                        }
                        theoreticalMana -= hook.ManaCost;
                    }
                }
                if (eblade != null)
                {
                    int dmg = (int)(((me.TotalStrength + 75) * 2) * resis);
                    if (Variables.AetherLens)
                    {
                        dmg = (int)(dmg * 1.08);
                    }
                    theoreticalMana -= eblade.ManaCost;
                    Damage          += dmg;
                    // Print.Info(dmg.ToString());
                }
                if (dismember != null && rot != null)
                {
                    if (dismember.Level > 0 && theoreticalMana - dismember.ManaCost >= 0 && dismember.AbilityState == AbilityState.Ready)
                    {
                        if (rot.Level > 0)
                        {
                            var rotDPS             = (int)rot.AbilityData.FirstOrDefault(x => x.Name == "#AbilityDamage").GetValue(rot.Level - 1);
                            var totalDmgAfterResis = (rotDPS * 3) * resis;
                            if (Variables.AetherLens)
                            {
                                totalDmgAfterResis = (float)(totalDmgAfterResis * 1.08);
                            }
                            Damage += (int)totalDmgAfterResis;
                        }
                        var ultiDamage = dismember.AbilityData.FirstOrDefault(x => x.Name == "dismember_damage").GetValue(dismember.Level - 1);
                        if (me.AghanimState())
                        {
                            //ultiDamage += (float)(me.TotalStrength * (0.2 + (dismember.Level * 0.10)));

                            var scepterDamage         = ultiDamage + (me.TotalStrength * (0.2 + (dismember.Level * 0.10)));//ultiDamage + (me.TotalStrength * dismember.AbilityData.FirstOrDefault(x => x.Name == "strength_damage_scepter").GetValue(dismember.Level - 1));
                            var totalDamageAfterResis = scepterDamage * resis;
                            if (Variables.AetherLens)
                            {
                                totalDamageAfterResis = (float)(totalDamageAfterResis * 1.08);
                            }
                            ultiDamage = (float)totalDamageAfterResis * 3;
                        }
                        else
                        {
                            var damagePerTickAfterResis = ultiDamage * resis;
                            if (Variables.AetherLens)
                            {
                                damagePerTickAfterResis = (float)(damagePerTickAfterResis * 1.08);
                            }
                            ultiDamage = damagePerTickAfterResis * 3;
                        }
                        Damage          += (int)ultiDamage;
                        theoreticalMana -= dismember.ManaCost;
                    }
                    if (urn != null)
                    {
                        if (urn.CurrentCharges > 0)
                        {
                            Damage += 100;
                        }
                    }
                    if (dagon != null)
                    {
                        if (dagon != null && theoreticalMana - dagon.ManaCost >= 0 && dagon.AbilityState == AbilityState.Ready)
                        {
                            var dagonDamageAfterResis = (int)dagon.AbilityData.FirstOrDefault(x => x.Name == "damage").GetValue(dagon.Level - 1) * resis;
                            if (Variables.AetherLens)
                            {
                                dagonDamageAfterResis = (float)(dagonDamageAfterResis * 1.08);
                            }
                            Damage += (int)dagonDamageAfterResis;

                            theoreticalMana -= dagon.ManaCost;
                        }
                    }
                }
                if (eblade != null)
                {
                    return((int)(Damage * 1.4));
                }
                else
                {
                    return(Damage);
                }
            }
            catch (Exception ex)
            {
                Print.Error("DAMAGE: " + ex.Message);
                return(0);
            }
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
0
        public static void MakeConfig()
        {
            if (File.Exists(Variables.Settings.FilePath))
            {
                Print.Success("Config Found");
            }
            else
            {
                Print.Error("Creating Config");
                if (!Directory.Exists(Variables.Settings.Directory))
                {
                    Directory.CreateDirectory(Variables.Settings.Directory);
                }
                File.WriteAllLines(Variables.Settings.FilePath, Variables.Settings.DefaultConfig);
                Print.Success("done");
            }
            foreach (var line in File.ReadAllLines(Variables.Settings.FilePath))
            {
                string name  = GetAttribute("Name", line);
                int    value = int.Parse(GetAttribute("Value", line));
                switch (name)
                {
                case "Basic ESP": Variables.Settings.Basic_ESP_Value.val = value; break;

                case "Combo Status": Variables.Settings.Combo_Status_Value.val = value; break;

                case "Maximum Damage Output": Variables.Settings.Maximum_Damage_Output_Value.val = value; break;

                case "Mana Required": Variables.Settings.Mana_Required_Value.val = value; break;

                case "Auto Hook": Variables.Settings.Auto_Hook_Value.val = value; break;

                case "Auto Combo": Variables.Settings.Auto_Combo_Value.val = value; break;

                case "Prediction Box": Variables.Settings.Prediction_Box_Value.val = value; break;

                case "Enemy Skills": Variables.Settings.Enemy_Skills_Value.val = value; break;

                case "Enemy Tracker": Variables.Settings.Enemy_Tracker_Value.val = value; break;

                case "Inventory Tracker": Variables.Settings.Inventory_Tracker_Value.val = value; break;

                case "Rune Tracker": Variables.Settings.Rune_Tracker_Value.val = value; break;

                case "Eul's Timer": Variables.Settings.Euls_Timer_Value.val = value; break;

                case "Last Hit Notifier": Variables.Settings.Last_Hit_Notifier_Value.val = value; break;

                case "Visible By Enemy": Variables.Settings.Visisble_By_Enemy_Value.val = value; break;

                case "Spirit Breaker Charge": Variables.Settings.Spirit_Breaker_Charge_Value.val = value; break;

                case "Skill Shot Notifier": Variables.Settings.Skill_Shot_Notifier_Value.val = value; break;

                case "Hook Lines": Variables.Settings.Hook_Lines_value.val = value; break;

                case "Teleport Timer": Variables.Settings.Teleport_Timer_Value.val = value; break;
                }
            }
            Print.Success("Config Loaded");
        }