Ejemplo n.º 1
0
        public static bool CanBaseUlt(TrackedRecall recall, Baseult spell, AIHeroClient source)
        {
            var visiable = NotVisiableEnemies.FirstOrDefault(e => e.Target.IdEquals(recall.Caster));

            return(!recall.Ulted &&
                   spell.IsReady() &&
                   (FowTolerance == 0 || visiable == null || FowTolerance * 1000 > visiable.TicksPassed - recall.TicksPassed) &&
                   MenuIni.Get <CheckBox>(recall.Caster.BaseSkinName).CurrentValue &&
                   spell.IsInRange(recall.CastPosition(spell, source)) &&
                   recall.TicksLeft > spell.TravelTime(recall.CastPosition(spell, source)) &&
                   Collision.Check(source, recall.CastPosition(spell, source), spell, recall.Caster) &&
                   calculateDamage(recall, source, spell) >= healthAfterTime(recall, spell.TravelTime(recall.CastPosition(spell, source))));
        }
Ejemplo n.º 2
0
        public float CalculateDamage(Obj_AI_Base source, TrackedRecall recall)
        {
            if (recall.Caster == null)
            {
                return(-1f);
            }

            var rawDamage = this.Damage;

            if (source.BaseSkinName.Equals("Jinx"))
            {
                rawDamage += (0.2f + 0.05f * source.Spellbook.GetSpell(this.Slot).Level) * (recall.Caster.MaxHealth - Program.healthAfterTime(recall, TravelTime(recall.CastPosition(this, source))));
            }

            return(source.CalculateDamageOnUnit(recall.Caster, DamageType, rawDamage));
        }
Ejemplo n.º 3
0
        private static void Game_OnUpdate(EventArgs args)
        {
            foreach (var enemy in EntityManager.Heroes.Enemies)
            {
                if (!enemy.IsHPBarRendered && !NotVisiableEnemies.Any(e => e.Target.IdEquals(enemy)))
                {
                    NotVisiableEnemies.Add(new NotVisiable(enemy));
                }

                if (enemy.IsHPBarRendered && NotVisiableEnemies.Any(e => e.Target.IdEquals(enemy)))
                {
                    NotVisiableEnemies.RemoveAll(t => t.Target.IdEquals(enemy));
                }
            }

            if (BaseUltSpell == null || !TrackedRecalls.Any())
            {
                return;
            }

            TrackedRecalls.RemoveAll(t => t.Ended);

            if (!Enabled || DisableKey)
            {
                return;
            }

            TrackedRecall recallTarget = null;

            switch (FocusMode)
            {
            case 0:
                recallTarget = TrackedRecalls.OrderByDescending(t => TargetSelector.GetPriority(t.Caster)).FirstOrDefault(t => CanBaseUlt(t, BaseUltSpell, Player.Instance));
                break;

            case 1:
                recallTarget = TrackedRecalls.OrderBy(t => healthAfterTime(t, BaseUltSpell.TravelTime(t.CastPosition(BaseUltSpell, Player.Instance)))).FirstOrDefault(t => CanBaseUlt(t, BaseUltSpell, Player.Instance));
                break;

            case 2:
                recallTarget = TrackedRecalls.OrderBy(t => t.StartTick).FirstOrDefault(t => CanBaseUlt(t, BaseUltSpell, Player.Instance));
                break;

            case 3:
                recallTarget = TrackedRecalls.OrderByDescending(t => t.StartTick).FirstOrDefault(t => CanBaseUlt(t, BaseUltSpell, Player.Instance));
                break;

            default:
                recallTarget = TrackedRecalls.OrderByDescending(t => TargetSelector.GetPriority(t.Caster)).FirstOrDefault(t => CanBaseUlt(t, BaseUltSpell, Player.Instance));
                break;
            }

            if (recallTarget == null)
            {
                return;
            }

            var travelTime = BaseUltSpell.TravelTime(recallTarget.CastPosition(BaseUltSpell, Player.Instance));
            var offset     = 50 + Game.Ping + Tolerance;
            var mod        = recallTarget.TicksLeft - travelTime;

            if (offset >= mod && BaseUltSpell.Cast(recallTarget.CastPosition(BaseUltSpell, Player.Instance)))
            {
                recallTarget.Ulted = true;
            }
        }