Example #1
0
 public RecallInfo(EnemyInfo enemyInfo)
 {
     EnemyInfo = enemyInfo;
     #pragma warning disable 618
     Recall = new Packet.S2C.Teleport.Struct(EnemyInfo.Player.NetworkId, Packet.S2C.Teleport.Status.Unknown, Packet.S2C.Teleport.Type.Unknown, 0);
     #pragma warning restore 618
     IncomingDamage = new Dictionary <int, float>();
 }
Example #2
0
        static float GetTargetHealth(EnemyInfo enemyInfo, int additionalTime)
        {
            if (enemyInfo.Player.IsVisible)
            {
                return(enemyInfo.Player.Health);
            }

            float predictedHealth = enemyInfo.Player.Health +
                                    enemyInfo.Player.HPRegenRate *
                                    ((Utils.TickCount - enemyInfo.LastSeen + additionalTime) / 1000f);

            return(predictedHealth > enemyInfo.Player.MaxHealth ? enemyInfo.Player.MaxHealth : predictedHealth);
        }
Example #3
0
        static bool IsTargetKillable(EnemyInfo enemyInfo)
        {
            float totalUltDamage = enemyInfo.RecallInfo.IncomingDamage.Values.Sum();

            float targetHealth = GetTargetHealth(enemyInfo, enemyInfo.RecallInfo.GetRecallCountdown());

            if (Utils.TickCount - enemyInfo.LastSeen > 20000 &&
                !MenuLocal.Item("regardlessKey").GetValue <KeyBind>().Active)
            {
                if (totalUltDamage < enemyInfo.Player.MaxHealth)
                {
                    return(false);
                }
            }
            else if (totalUltDamage < targetHealth)
            {
                return(false);
            }

            return(true);
        }
Example #4
0
        static void HandleUltTarget(EnemyInfo enemyInfo)
        {
            bool ultNow = false;
            bool me     = false;

            foreach (
                AIHeroClient champ in
                Allies.Where(x =>     // gathering the damage from allies should probably be done once only with timers
                             x.IsValid <AIHeroClient>() &&
                             !x.IsDead &&
                             ((x.IsMe && !x.IsStunned) ||
                              TeamUlt.Items.Any(item => item.GetValue <bool>() && item.Name == x.ChampionName)) &&
                             CanUseUlt(x)))
            {
                if (MenuLocal.Item("checkCollision").GetValue <bool>() && UltSpellData[champ.ChampionName].Collision &&
                    IsCollidingWithChamps(champ, EnemySpawnPos, UltSpellData[champ.ChampionName].Width))
                {
                    enemyInfo.RecallInfo.IncomingDamage[champ.NetworkId] = 0;
                    continue;
                }

                // increase timeneeded if it should arrive earlier, decrease if later
                var timeneeded =
                    GetUltTravelTime(champ, UltSpellData[champ.ChampionName].Speed,
                                     UltSpellData[champ.ChampionName].Delay, EnemySpawnPos) - 65;

                if (enemyInfo.RecallInfo.GetRecallCountdown() >= timeneeded)
                {
                    enemyInfo.RecallInfo.IncomingDamage[champ.NetworkId] =
                        (float)
                        champ.GetSpellDamage(enemyInfo.Player, SpellSlot.R,
                                             UltSpellData[champ.ChampionName].SpellStage) *
                        UltSpellData[champ.ChampionName].DamageMultiplicator;
                }
                else if (enemyInfo.RecallInfo.GetRecallCountdown() < timeneeded - (champ.IsMe ? 0 : 125))
                // some buffer for allies so their damage isnt getting reset
                {
                    enemyInfo.RecallInfo.IncomingDamage[champ.NetworkId] = 0;
                    continue;
                }

                if (champ.IsMe)
                {
                    me = true;

                    enemyInfo.RecallInfo.EstimatedShootT = timeneeded;

                    if (enemyInfo.RecallInfo.GetRecallCountdown() - timeneeded < 60)
                    {
                        ultNow = true;
                    }
                }
            }

            if (me)
            {
                if (!IsTargetKillable(enemyInfo))
                {
                    enemyInfo.RecallInfo.LockedTarget = false;
                    return;
                }

                enemyInfo.RecallInfo.LockedTarget = true;

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

                Ultimate.Cast(EnemySpawnPos, true);
                LastUltCastT = Utils.TickCount;
            }
            else
            {
                enemyInfo.RecallInfo.LockedTarget    = false;
                enemyInfo.RecallInfo.EstimatedShootT = 0;
            }
        }