Exemple #1
0
        public void Riki()
        {
            var     me   = ObjectManager.LocalHero;
            Ability zip  = me.Spellbook.Spell4;
            Hero    Riki = ObjectManager.GetEntities <Hero>().Where(x => x.ClassID == ClassID.CDOTA_Unit_Hero_Riki).FirstOrDefault();

            if (Riki != null)
            {
                var Smoke         = Riki.Spellbook.Spell1;
                var SmokePosition = me.Position;
                var Smokelvl      = Smoke.Level;
                SmokePosition.X = Riki.Position.X + Convert.ToSingle(200 * Math.Cos(Riki.Rotation));
                SmokePosition.Y = Riki.Position.Y + Convert.ToSingle(200 * Math.Sin(Riki.Rotation));
                var zipTarget = ZipZap.ZipFacingDirection(me, (350 + 25 * Smokelvl));
                if (//
                    IsFacing(Riki, me) &&
                    Riki.IsAttacking() &&
                    Smoke.Cooldown == 0 &&
                    Distance2D(Riki, SmokePosition) <= 250 + 25 * Smokelvl + 50
                    )
                {
                    if (Utils.SleepCheck("RikiDodge"))
                    {
                        me.Stop();
                        PowerTread.changePowerTread();
                        zip.UseAbility(zipTarget);
                        Utils.Sleep(700, "RikiDodge");
                    }
                }
            }
        }
Exemple #2
0
        public void DeathProphet()
        {
            var     me  = ObjectManager.LocalHero;
            Ability zip = me.Spellbook.Spell4;
            Hero    DP  = ObjectManager.GetEntities <Hero>().Where(x => x.ClassID == ClassID.CDOTA_Unit_Hero_DeathProphet).FirstOrDefault();

            if (DP != null)
            {
                var Silence     = DP.Spellbook.SpellW;
                var CirclePoint = me.Position;
                CirclePoint.X = DP.Position.X + Convert.ToSingle(450 * Math.Cos(DP.RotationRad));
                CirclePoint.Y = DP.Position.Y + Convert.ToSingle(450 * Math.Sin(DP.RotationRad));
                var zipTarget = ZipZap.ZipFacingDirection(me, 150);
                if (Silence.IsInAbilityPhase &&
                    me.Distance2D(DP) < 1000 &&
                    Distance2D(me.Position, CirclePoint) <= 500 && // slightly inaccurate, but should be ok
                    Utils.SleepCheck("DPDodge")
                    )
                {
                    me.Stop();
                    PowerTread.changePowerTread();
                    zip.UseAbility(zipTarget);
                    Utils.Sleep(700, "DPDodge");
                }
            }
        }
Exemple #3
0
        public void Centaur()
        {
            var     me      = ObjectManager.LocalHero;
            Ability zip     = me.Spellbook.Spell4;
            Hero    Centaur = ObjectManager.GetEntities <Hero>().Where(x => x.ClassID == ClassID.CDOTA_Unit_Hero_Centaur).FirstOrDefault();

            if (
                Centaur != null)
            {
                Ability HoofStomp  = Centaur.Spellbook.Spell1;
                Ability DoubleEdge = Centaur.Spellbook.Spell2;
                try
                {
                    var zipTarget = ZipZap.ZipFacingDirection(me, 200);
                    if (Utils.SleepCheck("HoofDodge") && HoofStomp.IsInAbilityPhase && Distance2D(Centaur, me) <= 350 - me.HullRadius)
                    {
                        PowerTread.changePowerTread();
                        zip.UseAbility(zipTarget);
                        Utils.Sleep(1000, "HoofDodge");
                    }
                }
                catch
                {
                }
            }
        }
Exemple #4
0
        public static Vector3 ChaseToEnemy(Hero me, Hero EnemyTargetHero)
        {
            var zipTarget = ZipZap.ZipFacingMouse(me, (!me.NetworkActivity.Equals(NetworkActivity.Idle)) ? (Convert.ToSingle(me.Distance2D(Game.MousePosition) > 300 ? 100 : 50)) : 10);
            //var zipTarget = ZipZap.ZipFacingEnemy(me, EnemyTargetHero, 100);
            var attackRange    = 550;
            var TargetDistance = me.Distance2D(EnemyTargetHero);

            if (TargetDistance > attackRange && TargetDistance < 2000)
            {
                //Console.WriteLine("Distance > 650");
                //zipTarget.X = me.Position.X + (EnemyTargetHero.Position.X - me.Position.X) * (TargetDistance - attackRange + 450) / TargetDistance;
                //zipTarget.Y = me.Position.Y + (EnemyTargetHero.Position.Y - me.Position.Y) * (TargetDistance - attackRange + 450) / TargetDistance;
                zipTarget = me.Spellbook.SpellR.GetPrediction(EnemyTargetHero);


                //zipTarget.X = EnemyTargetHero.Position.X;
                //zipTarget.Y = EnemyTargetHero.Position.Y;
                //zipTarget.Z = me.Position.Z;
            }
            else if (TargetDistance < 300)
            {
                {
                    //Console.WriteLine("Distance < 300");
                    zipTarget = ZipZap.ZipFacingDirection(me, 50);
                }
            }
            else // 300 < D < attackrange + 100
            {
                //Console.WriteLine("300 < Distance < 650");
                zipTarget = ZipZap.ZipFacingDirection(me, 50);
            }
            return(zipTarget);
        }
Exemple #5
0
        public void Lion()
        {
            var     me  = ObjectManager.LocalHero;
            Ability zip = me.Spellbook.Spell4;

            #region Lion; finger of death
            try
            {
                Hero Lion = ObjectManager.GetEntities <Hero>().Where(x => x.ClassID == ClassID.CDOTA_Unit_Hero_Lion).FirstOrDefault();

                if (Lion != null)
                {
                    if (!FingerOnMe && Lion.Spellbook.SpellR.IsInAbilityPhase)
                    {
                        if (ObjectManager.GetEntities <Hero>()
                            .Where(x => Distance2D(x, Lion) < 1500 && x.Team == me.Team) // Valid targets within range (slightly over, to account for movement during abilityphase)
                            .OrderBy(x => RadiansToFace(Lion, x))                        // Ordering targets based on rads, facing exactly towards me
                            .FirstOrDefault() == me)                                     //facing towards me when casting spells
                        {
                            if (!FingerOnMe)
                            {
                                stopwatch.Start();
                            }
                            FingerOnMe = true;
                        }
                    }
                    float distance = (float)SharpDX.Vector3.Distance(Lion.Position, me.Position);
                    var   myHero   = ObjectManager.LocalHero;
                    var   zipTarget_FingerDodge = ZipZap.ZipFacingDirection(me, 200);
                    if (IsFacing(Lion, me) && FingerOnMe && stopwatch.ElapsedMilliseconds >= (90 - (me.GetTurnTime(zipTarget_FingerDodge) * 1000) - 2 * Game.Ping))
                    {
                        stopwatch.Restart();
                        stopwatch.Stop();
                        if (FingerOnMe && Utils.SleepCheck("FingerDodge"))
                        {
                            me.Stop();
                            PowerTread.changePowerTread();
                            zip.UseAbility(zipTarget_FingerDodge);
                            Utils.Sleep(1000, "FingerDodge");
                        }
                        FingerOnMe = false;
                    }
                }
            }
            catch
            {
            }
            #endregion
        }
Exemple #6
0
        private static void AutoAttackDodge(Hero enemy, Hero me, int ZipDistance, int DistanceInPosition, int projectileDistanceThreshold, TrackingProjectile attackProjectile, bool projectileInAir)
        {
            var zip = me.Spellbook.SpellR;

            if (enemy.IsAttacking() && ObjectManager.GetEntities <Hero>()
                .Where(x => Distance2D(x, enemy) < enemy.AttackRange + 150 && x.Team == me.Team) // Valid targets within range (over slightly to account for movement during abilityphase)
                .OrderBy(x => RadiansToFace(enemy, x))                                           // Orders targets based on radians required to be facing exactly
                .FirstOrDefault() == me &&
                Distance2D(enemy, me) > DistanceInPosition &&
                (!projectileInAir)
                // || (projectileInAir && Distance2D(attackProjectile.Position, me.Position) > projectileDistanceThreshold))
                )
            {
                var zipTarget = ZipZap.ZipFacingDirection(me, ZipDistance);
                if (Utils.SleepCheck("AutoAttackDodge"))
                {
                    me.Stop();
                    PowerTread.changePowerTread();
                    zip.UseAbility(zipTarget);
                    Utils.Sleep(1000, "AutoAttackDodge");
                }
            }
        }
Exemple #7
0
        public void ShadowFiend()
        {
            var     me  = ObjectManager.LocalHero;
            Ability zip = me.Spellbook.Spell4;
            Hero    SF  = ObjectManager.GetEntities <Hero>().Where(x => x.ClassID == ClassID.CDOTA_Unit_Hero_Nevermore).FirstOrDefault();

            if (SF != null)
            {
                Ability ZRaze = SF.Spellbook.Spell1;
                Ability XRaze = SF.Spellbook.Spell2;
                Ability CRaze = SF.Spellbook.Spell3;
                // ZRaze situation

                if (!ZRazeOnMe && ZRaze.IsInAbilityPhase)
                {
                    if (!ZRazeOnMe)
                    {
                        stopwatch.Start();
                    }
                    ZRazeOnMe = true;
                }
                var myHero      = ObjectManager.LocalHero;
                var zipTarget   = ZipZap.ZipFacingDirection(me, 150);
                var ZRazeTarget = new Vector3(Convert.ToSingle(SF.Position.X + Math.Cos(SF.RotationRad) * (200 + SF.HullRadius)), Convert.ToSingle(SF.Position.Y + Math.Sin(SF.RotationRad) * (200 + SF.HullRadius)), Convert.ToSingle(SF.Position.Z));
                if (ZRazeOnMe &&
                    stopwatch.ElapsedMilliseconds >= 250 - 2 * Game.Ping &&
                    Distance2D(ZRazeTarget, me) < 270)
                {
                    stopwatch.Restart();
                    stopwatch.Stop();
                    if (ZRazeOnMe && Utils.SleepCheck("ZRazeDodge"))
                    {
                        me.Stop();
                        PowerTread.changePowerTread();
                        zip.UseAbility(zipTarget);
                        Utils.Sleep(1000, "ZRazeDodge");
                    }
                    ZRazeOnMe = false;
                }

                if (stopwatch.ElapsedMilliseconds >= 1300)
                {
                    stopwatch.Restart();
                    stopwatch.Stop();
                    ZRazeOnMe = false;
                }
                //XRaze
                if (!XRazeOnMe && XRaze.IsInAbilityPhase)
                {
                    if (!XRazeOnMe)
                    {
                        stopwatch1.Start();
                    }
                    XRazeOnMe = true;
                }
                zipTarget = ZipZap.ZipFacingDirection(me, 150);
                var XRazeTarget = new Vector3(Convert.ToSingle(SF.Position.X + Math.Cos(SF.RotationRad) * (450 + SF.HullRadius)), Convert.ToSingle(SF.Position.Y + Math.Sin(SF.RotationRad) * (450 + SF.HullRadius)), Convert.ToSingle(SF.Position.Z));
                if (XRazeOnMe &&
                    stopwatch1.ElapsedMilliseconds >= 250 - 2 * Game.Ping &&
                    Distance2D(XRazeTarget, me) < 270)
                {
                    stopwatch1.Restart();
                    stopwatch1.Stop();
                    if (XRazeOnMe && Utils.SleepCheck("XRazeDodge"))
                    {
                        PowerTread.changePowerTread();
                        zip.UseAbility(zipTarget);
                        Utils.Sleep(1000, "XRazeDodge");
                    }
                    XRazeOnMe = false;
                }
                if (stopwatch1.ElapsedMilliseconds >= 1300)
                {
                    stopwatch1.Restart();
                    stopwatch1.Stop();
                    XRazeOnMe = false;
                }

                //CRaze
                if (!CRazeOnMe && CRaze.IsInAbilityPhase)
                {
                    if (!CRazeOnMe)
                    {
                        stopwatch2.Start();
                    }
                    CRazeOnMe = true;
                }

                zipTarget = ZipZap.ZipFacingDirection(me, 150);
                var CRazeTarget = new Vector3(Convert.ToSingle(SF.Position.X + Math.Cos(SF.RotationRad) * (700 + SF.HullRadius)), Convert.ToSingle(SF.Position.Y + Math.Sin(SF.RotationRad) * (700 + SF.HullRadius)), Convert.ToSingle(SF.Position.Z));
                if (CRazeOnMe &&
                    stopwatch2.ElapsedMilliseconds >= 250 - 2 * Game.Ping &&
                    Distance2D(XRazeTarget, me) < 270)
                {
                    stopwatch2.Restart();
                    stopwatch2.Stop();
                    if (CRazeOnMe && Utils.SleepCheck("CRazeDodge"))
                    {
                        PowerTread.changePowerTread();
                        zip.UseAbility(zipTarget);
                        Utils.Sleep(1000, "CRazeDodge");
                    }
                    CRazeOnMe = false;
                }

                if (stopwatch2.ElapsedMilliseconds >= 1300)
                {
                    stopwatch2.Restart();
                    stopwatch2.Stop();
                    CRazeOnMe = false;
                }
            }
        }