Ejemplo n.º 1
0
        public void Events_OnUpdate()
        {
            if (this.pause || Variable.Hero == null || !Variable.Hero.IsValid || !Variable.Hero.IsAlive)
            {
                return;
            }


            if (!Variable.BearChaseModeOn)
            {
                return;
            }
            if (Bear == null)
            {
                return;
            }
            this.targetFind.Find();
            if (this.Target == null || !this.Target.IsValid)
            {
                return;
            }
            this.targetFind.LockTarget();
            if (this.Target == null || !this.Target.IsValid)
            {
                return;
            }
            Features.Orbwalk.Orbwalker orbwalker = new Features.Orbwalk.Orbwalker(Bear);
            if (!orbwalkerDictionary.TryGetValue(Bear.Handle, out orbwalker))
            {
                orbwalker = new Features.Orbwalk.Orbwalker(Bear);
                orbwalkerDictionary.Add(Bear.Handle, orbwalker);
            }
            orbwalker.OrbwalkOn(this.Target, 0, 0, false, true);
            if (Me.IsRanged)
            {
                Orbwalking.Orbwalk(this.Target, 0, 0, false, true);
            }
            else
            {
                if (Bear.Distance2D(Me) > 900)
                {
                    if (Utils.SleepCheck("Move"))
                    {
                        Me.Move(Bear.Position);
                        Utils.Sleep(500, "Move");
                    }
                }
                else
                {
                    if (Utils.SleepCheck("Hold"))
                    {
                        Me.Hold();
                        Utils.Sleep(1000, "Hold");
                    }
                }
            }
            if (Utils.SleepCheck("attack"))
            {
                Bear.Attack(this.Target);
                Utils.Sleep(300, "attack");
            }
        }
Ejemplo n.º 2
0
        public void CombinedLastHitExecute()
        {
            this.Update();
            this.setAutoAttackMode();
            if (!Variable.CombinedLastHitActive)
            {
                return;
            }
            if (!this.anyCreepsAround(this.Me))
            {
                return;
            }
            double meleedmg;
            double rangeddmg;
            int    rangedCreepProjectilesInAir;

            this.getLowestHpCreep(Bear, 1000);
            if (this._LowestHpCreep == null)
            {
                return;
            }
            this.getKillableCreep(this._LowestHpCreep, false);
            if (this._creepTarget == null)
            {
                return;
            }
            var MeleeCreep = ObjectManager.GetEntities <Unit>().Where(_x => _x.ClassId == ClassId.CDOTA_BaseNPC_Creep_Lane &&
                                                                      _x.Distance2D(Me) <= 1000 &&
                                                                      _x.Name.Equals("npc_dota_creep_badguys_melee")).FirstOrDefault();

            if (MeleeCreep == null)
            {
                meleedmg = 0;
            }
            else
            {
                meleedmg = GetDmanageOnTargetFromSource(MeleeCreep, _creepTarget, 0);
            }

            bool anyOneHitBear = ObjectManager.TrackingProjectiles.Any(x => x.Target.Name.Equals(Bear.Name));
            //Console.WriteLine("someone hitting bear" + anyOneHitBear);
            var RangedCreep = ObjectManager.GetEntities <Unit>().Where(_x => _x.ClassId == ClassId.CDOTA_BaseNPC_Creep_Lane &&
                                                                       _x.Name.Equals("npc_dota_creep_badguys_ranged")).FirstOrDefault();

            if (RangedCreep == null)
            {
                rangeddmg = 0;
            }
            else
            {
                rangeddmg = GetDmanageOnTargetFromSource(RangedCreep, _creepTarget, 0);
            }
            var RangedCreepProjectilesToKillableCreeps = ObjectManager.TrackingProjectiles.Where(x => x.Source.Name.Equals("npc_dota_creep_badguys_ranged") && x.Target.Name == _creepTarget.Name);

            if (RangedCreepProjectilesToKillableCreeps == null)
            {
                rangedCreepProjectilesInAir = 0;
            }
            else
            {
                rangedCreepProjectilesInAir = RangedCreepProjectilesToKillableCreeps.Count();
            }
            if (this._creepTarget.IsValid && this._creepTarget.IsVisible && this._creepTarget.IsAlive)
            {
                var getDamageFromBear = GetDamangeOnUnit(Bear, _creepTarget, 0);
                var getDamageFromMe   = GetDamangeOnUnit(this.Me, _creepTarget, 0);
                //Console.WriteLine("bear Dmg " + getDamageFromBear);
                //Console.WriteLine("my dmg " + getDamageFromMe);
                var numOfMeleeOnKillable  = MeleeCreepsAttackKillableTarget(_creepTarget);
                var numOfRangedOnKillable = RangedCreepsAttackKillableTarget(_creepTarget);
                if (numOfMeleeOnKillable + numOfRangedOnKillable != 0)
                {
                    if ((_creepTarget.Health < (Bear.Distance2D(_creepTarget) < 150 ? getDamageFromBear : 0) + getDamageFromMe + (numOfMeleeOnKillable * 10) + numOfRangedOnKillable * rangeddmg && rangedCreepProjectilesInAir >= numOfRangedOnKillable - 1 && Me.Distance2D(_creepTarget) >= 400) ||
                        (_creepTarget.Health < (Bear.Distance2D(_creepTarget) < 150 ? getDamageFromBear : 0) + getDamageFromMe + (numOfMeleeOnKillable >= 2 ? 20 : 0) && Me.Distance2D(_creepTarget) > 200 && Me.Distance2D(_creepTarget) <= 400) ||
                        (_creepTarget.Health < (Bear.Distance2D(_creepTarget) < 150 ? getDamageFromBear : 0) + getDamageFromMe - 5)
                        )
                    {
                        if (!Me.IsAttacking())
                        {
                            Me.Attack(_creepTarget);
                        }
                        if (Bear != null)
                        {
                            if (!Bear.IsAttacking())
                            {
                                Bear.Attack(_creepTarget);
                            }
                        }
                    }
                    else if (_creepTarget.Health < 2 * (getDamageFromBear + getDamageFromMe) && _creepTarget.Health > getDamageFromBear + getDamageFromMe)
                    {
                        if (Utils.SleepCheck("A-stop"))
                        {
                            Me.Attack(_creepTarget);
                            Me.Hold();
                            if (Bear != null)
                            {
                                Bear.Hold();
                                Bear.Attack(_creepTarget);
                            }
                            Utils.Sleep(50, "A-stop");
                        }
                    }
                    else
                    {
                        if (Bear != null)
                        {
                            if (Utils.SleepCheck("Follow"))
                            {
                                Bear.Move(this._LowestHpCreep.Position);
                                Utils.Sleep(100, "Follow");
                            }
                        }
                    }
                }
                else
                {
                }
            }
        }
Ejemplo n.º 3
0
        public void OnlyBearLastHitExecute()
        {
            Update();
            setAutoAttackMode();
            if (!Variable.OnlyBearLastHitActive)
            {
                return;
            }
            if (!anyCreepsAround(Bear))
            {
                return;
            }
            //Hero Control

            if (Bear.Distance2D(Me) > 1100)
            {
                if (Utils.SleepCheck("Move"))
                {
                    Me.Move(Bear.Position);
                    Utils.Sleep(100, "Move");
                }
            }
            else
            {
                if (Utils.SleepCheck("Hold"))
                {
                    Me.Hold();
                    Utils.Sleep(100, "Hold");
                }
            }
            //Bear Control
            getLowestHpCreep(Bear, 1000);
            if (_LowestHpCreep == null)
            {
                return;
            }
            getKillableCreep(_LowestHpCreep, true);
            if (_creepTarget == null)
            {
                return;
            }


            if (_creepTarget.IsValid && _creepTarget.IsVisible && _creepTarget.IsAlive)
            {
                var damageThreshold       = GetDamangeOnUnit(Bear, _creepTarget, 0);
                var numOfMeleeOnKillable  = MeleeCreepsAttackKillableTarget(_creepTarget);
                var numOfRangedOnKillable = RangedCreepsAttackKillableTarget(_creepTarget);
                if (numOfMeleeOnKillable + numOfRangedOnKillable != 0)
                {
                    if (_creepTarget.Distance2D(Bear) <= Bear.AttackRange)
                    {     //bear can attack
                        if (_creepTarget.Health < damageThreshold)
                        { // if attack below killable dmg, instant attack it
                            if (Bear.CanAttack())
                            {
                                Bear.Attack(_creepTarget);
                            }
                        }
                        else if (_creepTarget.Health < damageThreshold * 2.5 && _creepTarget.Health > damageThreshold && Utils.SleepCheck("A-Stop"))
                        {  // Attack-Hold
                            Bear.Attack(_creepTarget);
                            Bear.Hold();
                            Utils.Sleep(100, "A-Stop");
                        }
                    }
                    else
                    {
                        if (Utils.SleepCheck("Follow"))
                        {
                            Bear.Follow(_LowestHpCreep);
                            Utils.Sleep(100, "Follow");
                        }
                    }
                }
                else
                {
                    Console.WriteLine("no one is attacking");
                    //no one is hitting that creeps, go ahead and kill it
                    if (Bear.CanAttack() && _creepTarget.Health <= 1.5 * damageThreshold)
                    {
                        Bear.Attack(_creepTarget);
                        bearAttackSleeper.Sleep(100);
                    }
                }
            }
        }