Esempio n. 1
0
        protected override void LaneClear()
        {
            var useQ = Menu.Item(Menu.Name + ".lane-clear.q").GetValue <bool>() && Q.IsReady() && !Player.IsWindingUp &&
                       ResourceManager.Check("lane-clear");

            if (useQ)
            {
                var minion =
                    MinionManager.GetMinions(Q.Range)
                    .Where(
                        m =>
                        Q.GetDamage(m) > m.Health ||
                        HealthPrediction.LaneClearHealthPrediction(
                            m, (int)(Player.AttackDelay * 1000), (int)(Q.Delay * 1000)) >
                        Player.GetAutoAttackDamage(m) * 1.5f)
                    .OrderBy(m => !Orbwalking.InAutoAttackRange(m))
                    .ThenBy(m => m.Health)
                    .FirstOrDefault();
                if (minion != null)
                {
                    Q.Cast(minion);
                    if (Q.GetDamage(minion) > minion.Health)
                    {
                        _lastFarmQKill = minion.NetworkId;
                    }
                }
            }
        }
Esempio n. 2
0
        private void QLogic(HitChance hitChance)
        {
            var target = TargetSelector.GetTarget(Q);

            if (target != null)
            {
                var prediction = CPrediction.Line(Q, target, hitChance);
                if (prediction.TotalHits <= 0 || prediction.CastPosition.Equals(Vector3.Zero) ||
                    SpellCollision(Q, target) && !Orbwalking.InAutoAttackRange(target))
                {
                    var newTarget = TargetSelector.GetTarget(
                        Q, true, default(Vector3), new List <Obj_AI_Hero> {
                        target
                    });
                    if (newTarget != null && !SpellCollision(Q, newTarget))
                    {
                        prediction = CPrediction.Line(Q, newTarget, hitChance);
                    }
                }
                if (prediction.TotalHits > 0 && !prediction.CastPosition.Equals(Vector3.Zero))
                {
                    Q.Cast(prediction.CastPosition);
                }
            }
        }
        private void OnCoreBoot(EventArgs args)
        {
            try
            {
                OnLoad();
                SetupSpells();
                SetupMenu();

                _minionSearchRange = Math.Min(
                    2000,
                    Math.Max(
                        ObjectManager.Player.AttackRange + ObjectManager.Player.BoundingRadius * 2,
                        Spells.Select(spell => spell.IsChargedSpell ? spell.ChargedMaxRange : spell.Range)
                        .Concat(new[] { _minionSearchRange })
                        .Max()));

                TargetSelector.Weights.Range = Math.Max(
                    TargetSelector.Weights.Range,
                    Spells.Select(e => e.Range).DefaultIfEmpty(Orbwalking.GetRealAutoAttackRange(null) * 1.2f).Max());

                Core.OnPreUpdate  += OnCorePreUpdate;
                Core.OnPostUpdate += OnCorePostUpdate;

                Orbwalking.BeforeAttack        += OnOrbwalkingBeforeAttack;
                Orbwalking.AfterAttack         += OnOrbwalkingAfterAttack;
                Obj_AI_Base.OnProcessSpellCast += OnObjAiBaseProcessSpellCast;

                Drawing.OnDraw += OnDrawingDraw;
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
        }
 void IChampion.Flee()
 {
     try
     {
         Orbwalker.SetAttack(false);
         Orbwalking.MoveTo(Game.CursorPos, Orbwalker.HoldAreaRadius);
         Flee();
         Utility.DelayAction.Add(
             750, delegate
         {
             if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Flee)
             {
                 ItemManager.UseFleeItems();
             }
         });
         Utility.DelayAction.Add(
             125, delegate
         {
             if (Orbwalker.ActiveMode != Orbwalking.OrbwalkingMode.Flee)
             {
                 Orbwalker.SetAttack(true);
             }
         });
     }
     catch (Exception ex)
     {
         Global.Logger.AddItem(new LogItem(ex));
     }
 }
Esempio n. 5
0
        protected override void OnPostUpdate()
        {
            if (Ultimate.IsActive(UltimateModeType.Assisted) && R.IsReady())
            {
                if (Ultimate.ShouldMove(UltimateModeType.Assisted))
                {
                    Orbwalking.MoveTo(Game.CursorPos, Orbwalker.HoldAreaRadius);
                }

                if (!RLogic(UltimateModeType.Assisted, TargetSelector.GetTarget(R)))
                {
                    RLogicSingle(UltimateModeType.Assisted);
                }
            }

            if (Ultimate.IsActive(UltimateModeType.Auto) && R.IsReady())
            {
                if (!RLogic(UltimateModeType.Auto, TargetSelector.GetTarget(R)))
                {
                    RLogicSingle(UltimateModeType.Auto);
                }
            }
        }
 public static void Muramana(Obj_AI_Hero target, bool activate, float overrideRange = -1f)
 {
     try
     {
         var muramana = ObjectManager.Player.GetSpellSlot("Muramana");
         if (muramana == SpellSlot.Unknown || !muramana.IsReady())
         {
             return;
         }
         var hasBuff = ObjectManager.Player.HasBuff("Muramana");
         if ((activate && !hasBuff &&
              (_menu == null ||
               _menu.Item(_menu.Name + ".muramana.combo").GetValue <bool>() &&
               ObjectManager.Player.CountEnemiesInRange(
                   overrideRange > 0 ? overrideRange : Orbwalking.GetRealAutoAttackRange(ObjectManager.Player)) >=
               _menu.Item(_menu.Name + ".muramana.min-enemies-range").GetValue <Slider>().Value&&
               ObjectManager.Player.ManaPercent >=
               _menu.Item(_menu.Name + ".muramana.player-mana-above").GetValue <Slider>().Value&&
               ObjectManager.Player.HealthPercent <=
               _menu.Item(_menu.Name + ".muramana.player-health-below").GetValue <Slider>().Value&&
               ObjectManager.Player.HealthPercent >=
               _menu.Item(_menu.Name + ".muramana.player-health-above").GetValue <Slider>().Value&&
               (target == null ||
                target.HealthPercent <=
                _menu.Item(_menu.Name + ".muramana.target-health-below").GetValue <Slider>().Value&&
                target.HealthPercent >=
                _menu.Item(_menu.Name + ".muramana.target-health-above").GetValue <Slider>().Value))) ||
             !activate && hasBuff)
         {
             ObjectManager.Player.Spellbook.CastSpell(muramana);
         }
     }
     catch (Exception ex)
     {
         Global.Logger.AddItem(new LogItem(ex));
     }
 }
Esempio n. 7
0
        private float CalcComboDamage(Obj_AI_Hero target, float resMulti, bool rangeCheck, bool q, bool w, bool r)
        {
            try
            {
                if (target == null)
                {
                    return(0);
                }

                var damage    = 0f;
                var totalMana = 0f;

                var pred     = R.GetPrediction(target);
                var position = target.Position;
                if (!pred.UnitPosition.Equals(Vector3.Zero))
                {
                    position = pred.UnitPosition;
                }

                if (r && R.IsReady() && (!rangeCheck || R.IsInRange(target)))
                {
                    var rMana = R.ManaCost * resMulti;
                    if (totalMana + rMana <= Player.Mana)
                    {
                        totalMana += rMana;
                        damage    += GetRDamage(target);
                    }
                }
                var qMana = Q.ManaCost * resMulti;
                if (totalMana + qMana <= Player.Mana && q && (!rangeCheck || Q.IsInRange(position)))
                {
                    totalMana += qMana;
                    damage    += Q.GetDamage(target);
                    if (totalMana + qMana <= Player.Mana)
                    {
                        totalMana += qMana;
                        damage    += Q.GetDamage(target);
                    }
                }
                if (w && W.IsReady() && (!rangeCheck || W.IsInRange(position)))
                {
                    var wMana = W.ManaCost * resMulti;
                    if (totalMana + wMana <= Player.Mana)
                    {
                        damage += W.GetDamage(target);
                    }
                }
                if (!rangeCheck ||
                    position.Distance(Player.Position) <= Orbwalking.GetRealAutoAttackRange(target) * 0.9f)
                {
                    damage += 2 * (float)Player.GetAutoAttackDamage(target, true);
                }
                damage += ItemManager.CalculateComboDamage(target, rangeCheck);
                damage += SummonerManager.CalculateComboDamage(target, rangeCheck);
                return(damage);
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
            return(0);
        }
 private void OnOrbwalkingBeforeAttack(Orbwalking.BeforeAttackEventArgs args)
 {
     try
     {
         if (args.Unit.IsMe)
         {
             if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo)
             {
                 var enemy = args.Target as Obj_AI_Hero;
                 if (enemy != null)
                 {
                     ItemManager.Muramana(enemy, true);
                 }
             }
             else
             {
                 ItemManager.Muramana(null, false);
             }
         }
     }
     catch (Exception ex)
     {
         Global.Logger.AddItem(new LogItem(ex));
     }
 }
        static ItemManager()
        {
            try
            {
                // Speed + Atk Speed
                Youmuu = new CustomItem
                {
                    Name        = "youmuus-ghostblade",
                    DisplayName = "Youmuu's Ghostblade",
                    Item        = ItemData.Youmuus_Ghostblade.GetItem(),
                    Flags       = ItemFlags.Offensive | ItemFlags.Flee,
                    CombatFlags = CombatFlags.Melee | CombatFlags.Ranged,
                    EffectFlags = EffectFlags.AttackSpeed | EffectFlags.MovementSpeed,
                    CastType    = CastType.None,
                    Range       =
                        ObjectManager.Player.IsMelee
                            ? ObjectManager.Player.AttackRange * 3
                            : Orbwalking.GetRealAutoAttackRange(ObjectManager.Player)
                };

                // AOE damage, only melee
                Hydra = new CustomItem
                {
                    Name        = "hydra",
                    DisplayName = "Hydra",
                    Item        = ItemData.Ravenous_Hydra_Melee_Only.GetItem(),
                    Flags       = ItemFlags.Offensive,
                    CombatFlags = CombatFlags.Melee,
                    EffectFlags = EffectFlags.Damage,
                    CastType    = CastType.None,
                    Damage      = Damage.DamageItems.Hydra,
                    Range       = ItemData.Ravenous_Hydra_Melee_Only.GetItem().Range
                };

                // Slow + Damage
                BilgewaterCutlass = new CustomItem
                {
                    Name        = "bilgewater-cutlass",
                    DisplayName = "Bilgewater Cutlass",
                    Item        = ItemData.Bilgewater_Cutlass.GetItem(),
                    Flags       = ItemFlags.Offensive | ItemFlags.Flee,
                    CombatFlags = CombatFlags.Melee | CombatFlags.Ranged,
                    EffectFlags = EffectFlags.Damage | EffectFlags.MovementSlow,
                    CastType    = CastType.Target,
                    Damage      = Damage.DamageItems.Bilgewater,
                    Range       = ItemData.Bilgewater_Cutlass.GetItem().Range
                };

                // Slow + Damage
                BladeRuinedKing = new CustomItem
                {
                    Name        = "blade-ruined-king",
                    DisplayName = "Blade of the Ruined King",
                    Item        = ItemData.Blade_of_the_Ruined_King.GetItem(),
                    Flags       = ItemFlags.Offensive | ItemFlags.Flee,
                    CombatFlags = CombatFlags.Melee | CombatFlags.Ranged,
                    EffectFlags = EffectFlags.Damage | EffectFlags.MovementSlow,
                    CastType    = CastType.Target,
                    Damage      = Damage.DamageItems.Botrk,
                    Range       = ItemData.Blade_of_the_Ruined_King.GetItem().Range
                };

                // Damage + Slow
                HextechGunblade = new CustomItem
                {
                    Name        = "hextech-gunblade",
                    DisplayName = "Hextech Gunblade",
                    Item        = ItemData.Hextech_Gunblade.GetItem(),
                    Flags       = ItemFlags.Offensive | ItemFlags.Flee,
                    CombatFlags = CombatFlags.Melee | CombatFlags.Ranged,
                    EffectFlags = EffectFlags.Damage | EffectFlags.MovementSlow,
                    CastType    = CastType.Target,
                    Damage      = Damage.DamageItems.Hexgun,
                    Range       = ItemData.Hextech_Gunblade.GetItem().Range
                };

                // AOE Shield
                LocketIronSolari = new CustomItem
                {
                    Name        = "locket-iron-solari",
                    DisplayName = "Locket of the Iron Solari",
                    Item        = ItemData.Locket_of_the_Iron_Solari.GetItem(),
                    Flags       = ItemFlags.Supportive | ItemFlags.Defensive,
                    CombatFlags = CombatFlags.Melee | CombatFlags.Ranged,
                    EffectFlags = EffectFlags.Shield,
                    CastType    = CastType.None,
                    Range       = ItemData.Locket_of_the_Iron_Solari.GetItem().Range
                };

                // Remove stun + heal
                MikaelsCrucible = new CustomItem
                {
                    Name        = "mikaels-crucible",
                    DisplayName = "Mikael's Crucible",
                    Item        = ItemData.Mikaels_Crucible.GetItem(),
                    Flags       = ItemFlags.Supportive,
                    CombatFlags = CombatFlags.Melee | CombatFlags.Ranged,
                    EffectFlags = EffectFlags.RemoveStun | EffectFlags.Heal,
                    CastType    = CastType.Target,
                    Range       = ItemData.Mikaels_Crucible.GetItem().Range
                };


                // Slow
                FrostQueensClaim = new CustomItem
                {
                    Name        = "frost-queens-claim",
                    DisplayName = "Frost Queen's Claim",
                    Item        = ItemData.Frost_Queens_Claim.GetItem(),
                    Flags       = ItemFlags.Supportive | ItemFlags.Flee,
                    CombatFlags = CombatFlags.Melee | CombatFlags.Ranged,
                    EffectFlags = EffectFlags.MovementSlow,
                    CastType    = CastType.None,
                    Range       = ItemData.Frost_Queens_Claim.GetItem().Range
                };

                // Speed
                TalismanOfAscension = new CustomItem
                {
                    Name        = "talisman-of-ascension",
                    DisplayName = "Talisman of Ascension",
                    Item        = ItemData.Talisman_of_Ascension.GetItem(),
                    Flags       = ItemFlags.Supportive | ItemFlags.Flee,
                    CombatFlags = CombatFlags.Melee | CombatFlags.Ranged,
                    EffectFlags = EffectFlags.MovementSpeed,
                    CastType    = CastType.None,
                    Range       = ItemData.Talisman_of_Ascension.GetItem().Range
                };

                // Shield
                FaceOfTheMountain = new CustomItem
                {
                    Name        = "face-of-the-mountain",
                    DisplayName = "Face of the Mountain",
                    Item        = ItemData.Face_of_the_Mountain.GetItem(),
                    Flags       = ItemFlags.Supportive | ItemFlags.Flee | ItemFlags.Defensive,
                    CombatFlags = CombatFlags.Melee | CombatFlags.Ranged,
                    EffectFlags = EffectFlags.Shield,
                    CastType    = CastType.Self,
                    Range       = ItemData.Face_of_the_Mountain.GetItem().Range
                };

                // Place wards
                Sightstone = new CustomItem
                {
                    Name        = "sightstone",
                    DisplayName = "Sightstone",
                    Item        = ItemData.Sightstone.GetItem(),
                    Flags       = ItemFlags.Supportive,
                    CombatFlags = CombatFlags.Melee | CombatFlags.Ranged,
                    CastType    = CastType.Position,
                    Range       = ItemData.Sightstone.GetItem().Range
                };

                // Place wards
                RubySightstone = new CustomItem
                {
                    Name        = "ruby-sightstone",
                    DisplayName = "Ruby Sightstone",
                    Item        = ItemData.Ruby_Sightstone.GetItem(),
                    Flags       = ItemFlags.Supportive,
                    CombatFlags = CombatFlags.Melee | CombatFlags.Ranged,
                    CastType    = CastType.Position,
                    Range       = ItemData.Ruby_Sightstone.GetItem().Range
                };

                // Place wards
                EyeOfTheWatchers = new CustomItem
                {
                    Name        = "eye-of-the-watchers",
                    DisplayName = "Eye of the Watchers",
                    Item        = ItemData.Eye_of_the_Watchers.GetItem(),
                    Flags       = ItemFlags.Supportive,
                    CombatFlags = CombatFlags.Melee | CombatFlags.Ranged,
                    CastType    = CastType.Position,
                    Range       = ItemData.Eye_of_the_Watchers.GetItem().Range
                };

                // Place wards
                EyeOfTheEquinox = new CustomItem
                {
                    Name        = "eye-of-the-equinox",
                    DisplayName = "Eye of the Equinox",
                    Item        = ItemData.Eye_of_the_Equinox.GetItem(),
                    Flags       = ItemFlags.Supportive,
                    CombatFlags = CombatFlags.Melee | CombatFlags.Ranged,
                    CastType    = CastType.Position,
                    Range       = ItemData.Eye_of_the_Equinox.GetItem().Range
                };

                // Place wards
                EyeOfTheOasis = new CustomItem
                {
                    Name        = "eye-of-the-oasis",
                    DisplayName = "Eye of the Oasis",
                    Item        = ItemData.Eye_of_the_Oasis.GetItem(),
                    Flags       = ItemFlags.Supportive,
                    CombatFlags = CombatFlags.Melee | CombatFlags.Ranged,
                    CastType    = CastType.Position,
                    Range       = ItemData.Eye_of_the_Oasis.GetItem().Range
                };

                // Place wards
                TrackersKnife = new CustomItem
                {
                    Name        = "trackers-knife",
                    DisplayName = "Tracker's Knife",
                    Item        = ItemData.Trackers_Knife.GetItem(),
                    Flags       = ItemFlags.Supportive,
                    CombatFlags = CombatFlags.Melee | CombatFlags.Ranged,
                    CastType    = CastType.Position,
                    Range       = ItemData.Trackers_Knife.GetItem().Range
                };

                Items = new List <CustomItem>
                {
                    Youmuu,
                    Hydra,
                    BilgewaterCutlass,
                    BladeRuinedKing,
                    HextechGunblade,
                    MikaelsCrucible,
                    LocketIronSolari,
                    FrostQueensClaim,
                    TalismanOfAscension,
                    FaceOfTheMountain,
                    Sightstone,
                    RubySightstone,
                    EyeOfTheWatchers,
                    EyeOfTheEquinox,
                    EyeOfTheOasis,
                    TrackersKnife
                };

                MaxRange = Items.Max(s => s.Range);
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
        }
Esempio n. 10
0
        private void OnOrbwalkingBeforeAttack(Orbwalking.BeforeAttackEventArgs args)
        {
            try
            {
                if (!args.Unit.IsMe)
                {
                    return;
                }

                if ((Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LaneClear ||
                     Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LastHit) && args.Target is Obj_AI_Minion)
                {
                    args.Process = args.Target.NetworkId != _lastFarmQKill;
                }
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
        }