Ejemplo n.º 1
0
        public float GetTargetHealth(EnemyInfo playerInfo, int additionalTime)
        {
            if (playerInfo.Player.IsVisible)
            {
                return(playerInfo.Player.Health);
            }

            var predictedhealth = playerInfo.Player.Health + playerInfo.Player.HPRegenRate * ((Environment.TickCount - playerInfo.LastSeen + additionalTime) / 1000f);

            return(predictedhealth > playerInfo.Player.MaxHealth ? playerInfo.Player.MaxHealth : predictedhealth);
        }
Ejemplo n.º 2
0
 public RecallInfo(EnemyInfo enemyInfo)
 {
     EnemyInfo      = enemyInfo;
     Recall         = new Packet.S2C.Recall.Struct(EnemyInfo.Player.NetworkId, Packet.S2C.Recall.RecallStatus.Unknown, Packet.S2C.Recall.ObjectType.Player, 0);
     IncomingDamage = new Dictionary <int, float>();
 }
Ejemplo n.º 3
0
        private static void HandleRecallShot(EnemyInfo playerInfo)
        {
            bool shoot = false;

            foreach (Obj_AI_Hero champ in Program.Helper.OwnTeam.Where(x =>
                                                                       x.IsValid && (x.IsMe || Helper.GetSafeMenuItem <bool>(_menu.Item(x.ChampionName))) &&
                                                                       !x.IsDead && !x.IsStunned &&
                                                                       (x.Spellbook.CanUseSpell(SpellSlot.R) == SpellState.Ready ||
                                                                        (x.Spellbook.GetSpell(SpellSlot.R).Level > 0 &&
                                                                         x.Spellbook.CanUseSpell(SpellSlot.R) == SpellState.Surpressed &&
                                                                         x.Mana >= x.Spellbook.GetSpell(SpellSlot.R).ManaCost)))) //use when fixed: champ.Spellbook.GetSpell(SpellSlot.R) = Ready or champ.Spellbook.GetSpell(SpellSlot.R).ManaCost)
            {
                if (UltInfo[champ.ChampionName].Collision && IsCollidingWithChamps(champ, _enemySpawnPos, UltInfo[champ.ChampionName].Width))
                {
                    continue;
                }

                //increase timeneeded if it should arrive earlier, decrease if later
                float timeneeded = GetSpellTravelTime(champ, UltInfo[champ.ChampionName].Speed, UltInfo[champ.ChampionName].Delay, _enemySpawnPos) - (_menu.Item("extraDelay").GetValue <Slider>().Value + 65);

                if (timeneeded - playerInfo.RecallInfo.GetRecallCountdown() > 60)
                {
                    continue;
                }

                playerInfo.RecallInfo.IncomingDamage[champ.NetworkId] = (float)GetUltDamage(champ, playerInfo.Player) * UltInfo[champ.ChampionName].DamageMultiplicator;

                if (playerInfo.RecallInfo.GetRecallCountdown() <= timeneeded)
                {
                    if (champ.IsMe)
                    {
                        shoot = true;
                    }
                }
            }

            float totalUltDamage = playerInfo.RecallInfo.IncomingDamage.Values.Sum();

            float targetHealth = Program.Helper.GetTargetHealth(playerInfo, playerInfo.RecallInfo.GetRecallCountdown());

            if (!shoot || _menu.Item("panicKey").GetValue <KeyBind>().Active)
            {
                return;
            }

            playerInfo.RecallInfo.IncomingDamage.Clear(); //wrong placement?

            int time = Environment.TickCount;

            if (time - playerInfo.LastSeen > 20000 && !_menu.Item("regardlessKey").GetValue <KeyBind>().Active)
            {
                if (totalUltDamage < playerInfo.Player.MaxHealth)
                {
                    return;
                }
            }
            else if (totalUltDamage < targetHealth)
            {
                return;
            }

            _ult.Cast(_enemySpawnPos, true);
            _ultCasted = time;
        }