Ejemplo n.º 1
0
 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));
     }
 }
Ejemplo n.º 2
0
 public static IOrderedEnumerable <Obj_AI_Base> GetDashObjects()
 {
     try
     {
         var objects =
             GameObjects.EnemyMinions.Concat(GameObjects.Jungle)
             .Where(o => o.IsValidTarget(Orbwalking.GetRealAutoAttackRange(o)))
             .Select(o => o as Obj_AI_Base)
             .ToList();
         var apexPoint = ObjectManager.Player.ServerPosition.To2D() +
                         (ObjectManager.Player.ServerPosition.To2D() - Game.CursorPos.To2D()).Normalized() *
                         Orbwalking.GetRealAutoAttackRange(ObjectManager.Player);
         return
             (objects.Where(
                  o =>
                  Utils.IsLyingInCone(
                      o.ServerPosition.To2D(), apexPoint, ObjectManager.Player.ServerPosition.To2D(), Math.PI))
              .OrderBy(o => o.Distance(apexPoint, true)));
     }
     catch (Exception ex)
     {
         Global.Logger.AddItem(new LogItem(ex));
     }
     return(null);
 }
Ejemplo n.º 3
0
        private void OnCoreBoot(EventArgs args)
        {
            try
            {
                OnLoad();
                SetupSpells();
                SetupMenu();

                Weights.Range = Math.Max(
                    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));
            }
        }
Ejemplo n.º 4
0
 private void OnObjAiBaseProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
 {
     try
     {
         if (sender.IsMe)
         {
             if (args.SData.Name == "KalistaExpungeWrapper")
             {
                 Orbwalking.ResetAutoAttackTimer();
             }
         }
         if (!sender.IsEnemy || SoulBound.Unit == null || R.Level == 0 ||
             !Menu.Item(Menu.Name + ".ultimate.save").GetValue <bool>())
         {
             return;
         }
         if (args.Target != null && args.Target.NetworkId == SoulBound.Unit.NetworkId &&
             (!(sender is Obj_AI_Hero) || args.SData.IsAutoAttack()))
         {
             SoulBound.Add(
                 SoulBound.Unit.ServerPosition.Distance(sender.ServerPosition) / args.SData.MissileSpeed +
                 Game.Time, (float)sender.GetAutoAttackDamage(SoulBound.Unit));
         }
         else
         {
             var hero = sender as Obj_AI_Hero;
             if (hero != null)
             {
                 var slot = hero.GetSpellSlot(args.SData.Name);
                 if (slot != SpellSlot.Unknown)
                 {
                     var damage = 0f;
                     if (args.Target != null && args.Target.NetworkId == SoulBound.Unit.NetworkId &&
                         slot == hero.GetSpellSlot("SummonerDot"))
                     {
                         damage =
                             (float)hero.GetSummonerSpellDamage(SoulBound.Unit, Damage.SummonerSpell.Ignite);
                     }
                     else if ((slot == SpellSlot.Q || slot == SpellSlot.W || slot == SpellSlot.E ||
                               slot == SpellSlot.R) &&
                              ((args.Target != null && args.Target.NetworkId == SoulBound.Unit.NetworkId) ||
                               args.End.Distance(SoulBound.Unit.ServerPosition, true) <
                               Math.Pow(args.SData.LineWidth, 2)))
                     {
                         damage = (float)hero.GetSpellDamage(SoulBound.Unit, slot);
                     }
                     if (damage > 0)
                     {
                         SoulBound.Add(Game.Time + 2, damage);
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Global.Logger.AddItem(new LogItem(ex));
     }
 }
Ejemplo n.º 5
0
        protected override void Flee()
        {
            Orbwalker.SetAttack(true);
            var dashObjects = GetDashObjects();

            if (dashObjects != null && dashObjects.Any())
            {
                Orbwalking.Orbwalk(dashObjects.First(), Game.CursorPos);
            }
        }
Ejemplo n.º 6
0
        public static List <Obj_AI_Base> GetDashObjects(List <Obj_AI_Base> targets)
        {
            try
            {
                var apexPoint = ObjectManager.Player.ServerPosition.To2D() +
                                (ObjectManager.Player.ServerPosition.To2D() - Game.CursorPos.To2D()).Normalized() *
                                Orbwalking.GetRealAutoAttackRange(ObjectManager.Player);

                return
                    (targets.Where(
                         o =>
                         Utils.IsLyingInCone(
                             o.ServerPosition.To2D(), apexPoint, ObjectManager.Player.ServerPosition.To2D(), Math.PI))
                     .OrderBy(o => o.Distance(apexPoint, true))
                     .ToList());
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
            return(null);
        }
 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));
     }
 }
        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.Self,
                    Range       =
                        ObjectManager.Player.IsMelee
                            ? ObjectManager.Player.AttackRange * 3
                            : Orbwalking.GetRealAutoAttackRange(ObjectManager.Player)
                };

                // AOE damage, only melee
                Tiamat = new CustomItem
                {
                    Name        = "tiamat",
                    DisplayName = "Tiamat",
                    Item        = ItemData.Tiamat_Melee_Only.GetItem(),
                    Flags       = ItemFlags.Offensive,
                    CombatFlags = CombatFlags.Melee,
                    EffectFlags = EffectFlags.Damage,
                    CastType    = CastType.Self,
                    Damage      = Damage.DamageItems.Tiamat,
                    Range       = ItemData.Tiamat_Melee_Only.GetItem().Range
                };

                // 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.Self,
                    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.Self,
                    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
                };

                // 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
                };

                Items = new List <CustomItem>
                {
                    Youmuu,
                    Tiamat,
                    Hydra,
                    BilgewaterCutlass,
                    BladeRuinedKing,
                    HextechGunblade,
                    MikaelsCrucible,
                    LocketIronSolari,
                    Sightstone,
                    RubySightstone
                };

                MaxRange = Items.Max(s => s.Range);
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
        }
Ejemplo n.º 9
0
        protected override void Combo()
        {
            var useQ = Menu.Item(Menu.Name + ".combo.q").GetValue <bool>() && Q.IsReady() &&
                       ResourceManager.Check("combo-q");
            var useE = Menu.Item(Menu.Name + ".combo.e").GetValue <bool>() && E.IsReady();

            if (useQ)
            {
                Casting.SkillShot(Q, Q.GetHitChance("combo"));
            }

            if (useE)
            {
                var target = TargetSelector.GetTarget(E);
                if (target != null && Rend.HasBuff(target))
                {
                    if (target.Distance(Player) > Orbwalking.GetRealAutoAttackRange(target))
                    {
                        if (
                            GameObjects.EnemyMinions.Any(
                                m => m.IsValidTarget(Orbwalking.GetRealAutoAttackRange(m)) && Rend.IsKillable(m, true)))
                        {
                            E.Cast();
                        }
                        else
                        {
                            var minion =
                                GetDashObjects(
                                    GameObjects.EnemyMinions.Where(
                                        m => m.IsValidTarget(Orbwalking.GetRealAutoAttackRange(m)))
                                    .Select(e => e as Obj_AI_Base)
                                    .ToList())
                                .Find(
                                    m =>
                                    m.Health > Player.GetAutoAttackDamage(m) &&
                                    m.Health < Player.GetAutoAttackDamage(m) + Rend.GetDamage(m, 1));
                            if (minion != null)
                            {
                                Orbwalker.ForceTarget(minion);
                            }
                        }
                    }
                    else if (E.IsInRange(target))
                    {
                        if (Rend.IsKillable(target, false))
                        {
                            E.Cast();
                        }
                        else
                        {
                            var buff = Rend.GetBuff(target);
                            if (buff != null &&
                                buff.Count >= Menu.Item(Menu.Name + ".combo.e-min").GetValue <Slider>().Value)
                            {
                                if (target.Distance(Player) > E.Range * 0.8 && !target.IsFacing(Player))
                                {
                                    E.Cast();
                                }
                            }
                        }
                    }
                }
            }

            if (Menu.Item(Menu.Name + ".combo.minions").GetValue <bool>() &&
                !GameObjects.EnemyHeroes.Any(
                    e => e.IsValidTarget() && e.Distance(Player) < Orbwalking.GetRealAutoAttackRange(e) * 1.1f) &&
                !Player.IsWindingUp && !Player.IsDashing())
            {
                var obj = GetDashObjects().FirstOrDefault();
                if (obj != null)
                {
                    Orbwalker.ForceTarget(obj);
                }
            }
            else
            {
                Orbwalker.ForceTarget(null);
            }
        }
Ejemplo n.º 10
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));
     }
 }