示例#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));
     }
 }
示例#2
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));
            }
        }
 private void OnOrbwalkingAfterAttack(AttackableUnit unit, AttackableUnit target)
 {
     try
     {
         if (unit.IsMe)
         {
             var minion = target as Obj_AI_Minion;
             if (minion != null)
             {
                 _lastAaMinion        = minion;
                 _lastAaMinionEndTime = Game.Time + minion.Distance(Player) / Orbwalking.GetMyProjectileSpeed() +
                                        0.25f;
             }
         }
     }
     catch (Exception ex)
     {
         Global.Logger.AddItem(new LogItem(ex));
     }
 }
示例#4
0
 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));
     }
 }
        private void OnOrbwalkingBeforeAttack(Orbwalking.BeforeAttackEventArgs args)
        {
            try
            {
                var t = args.Target as Obj_AI_Hero;
                if (t != null &&
                    (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo ||
                     Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Mixed))
                {
                    args.Process =
                        Menu.Item(
                            Menu.Name + "." +
                            (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo ? "combo" : "harass") + ".aa")
                            .GetValue<bool>();
                    if (!args.Process)
                    {
                        var poison = GetPoisonBuffEndTime(t);
                        args.Process = (!Q.IsReady() || Q.Instance.ManaCost > Player.Mana) &&
                                       ((!E.IsReady() && Game.Time - _lastECast > 3) ||
                                        E.Instance.ManaCost > Player.Mana || poison <= 0 || poison < E.ArrivalTime(t));
                    }
                }
                if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LaneClear)
                {
                    args.Process = Menu.Item(Menu.Name + ".lane-clear.aa").GetValue<bool>();
                    if (!args.Process)
                    {
                        var m = args.Target as Obj_AI_Minion;
                        if (m != null && (_lastEEndTime < Game.Time || E.IsReady()) ||
                            (GetPoisonBuffEndTime(m) < E.ArrivalTime(m) || E.Instance.ManaCost > Player.Mana) ||
                            !ResourceManager.Check("lane-clear"))
                        {
                            args.Process = true;
                        }
                    }
                }

                if ((Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LastHit))
                {
                    var m = args.Target as Obj_AI_Minion;
                    if (m != null && E.CanCast(m))
                    {
                        if (E.Instance.ManaCost < Player.Mana)
                        {
                            args.Process = Menu.Item(Menu.Name + ".lasthit.e").GetValue<bool>() ||
                                           (Menu.Item(Menu.Name + ".lasthit.e-poison").GetValue<bool>() &&
                                            GetPoisonBuffEndTime(m) > E.ArrivalTime(m)) &&
                                           ResourceManager.Check("lasthit");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
        }
示例#6
0
        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));
            }
        }
 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));
     }
 }
        protected override void OnPostUpdate()
        {
            if (_ultimate.IsActive(UltimateModeType.Flash) && R.IsReady() && SummonerManager.Flash.IsReady())
            {
                if (_ultimate.ShouldMove(UltimateModeType.Flash))
                {
                    Orbwalking.MoveTo(Game.CursorPos, Orbwalker.HoldAreaRadius);
                }
                var targets =
                    Targets.Where(
                        t =>
                        t.Distance(Player) < (R.Range + R.Width + SummonerManager.Flash.Range) * 1.5f &&
                        !t.IsDashing() &&
                        (t.IsFacing(Player)
                                ? (t.Distance(Player))
                                : (R.GetPrediction(t).UnitPosition.Distance(Player.Position))) > R.Range);
                foreach (var target in targets)
                {
                    var flashPos = Player.Position.Extend(target.Position, SummonerManager.Flash.Range);
                    var maxHits  = GetMaxRHits(HitChance.High, flashPos);
                    if (maxHits.Item1.Count > 0)
                    {
                        if (_ultimate.Check(UltimateModeType.Flash, maxHits.Item1))
                        {
                            if (
                                R.Cast(
                                    Player.Position.Extend(
                                        maxHits.Item2, -(Player.Position.Distance(maxHits.Item2) * 2)), true))
                            {
                                Utility.DelayAction.Add(
                                    300 + (Game.Ping / 2), () => SummonerManager.Flash.Cast(flashPos));
                            }
                        }
                        else if (_ultimate.ShouldSingle(UltimateModeType.Flash))
                        {
                            if (
                                maxHits.Item1.Where(hit => _ultimate.CheckSingle(UltimateModeType.Flash, hit))
                                .Any(
                                    hit =>
                                    R.Cast(
                                        Player.Position.Extend(
                                            maxHits.Item2, -(Player.Position.Distance(maxHits.Item2) * 2)), true)))
                            {
                                Utility.DelayAction.Add(
                                    300 + (Game.Ping / 2), () => SummonerManager.Flash.Cast(flashPos));
                            }
                        }
                    }
                }
            }

            if (_ultimate.IsActive(UltimateModeType.Assisted) && R.IsReady())
            {
                if (_ultimate.ShouldMove(UltimateModeType.Assisted))
                {
                    Orbwalking.MoveTo(Game.CursorPos, Orbwalker.HoldAreaRadius);
                }

                if (!RLogic(UltimateModeType.Assisted, R.GetHitChance("combo")))
                {
                    RLogicSingle(UltimateModeType.Assisted, R.GetHitChance("combo"), false);
                }
            }

            if (_ultimate.IsActive(UltimateModeType.Auto) && R.IsReady())
            {
                if (!RLogic(UltimateModeType.Auto, R.GetHitChance("combo")))
                {
                    RLogicSingle(UltimateModeType.Auto, R.GetHitChance("combo"));
                }
            }

            if (HeroListManager.Enabled("w-immobile") && W.IsReady())
            {
                var target =
                    Targets.FirstOrDefault(
                        t =>
                        HeroListManager.Check("w-immobile", t) && BestTargetOnlyManager.Check("w-immobile", W, t) &&
                        Utils.IsImmobile(t));
                if (target != null)
                {
                    Casting.SkillShot(target, W, HitChance.High);
                }
            }
        }