Exemple #1
0
        private static void Spellbook_OnCastSpell(Spellbook sender, SpellbookCastSpellEventArgs args)
        {
            if (sender.Owner.IsMe && Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
            {
                if (BarrelsList.All(b => b?.Barrel.NetworkId != args.Target?.NetworkId))
                {
                    return;
                }

                var target =
                    EntityManager.Heroes.Enemies.FirstOrDefault(e => e.IsKillable() &&
                                                                BarrelsList.Any(b => b.Barrel.IsValidTarget(Q.Range) && (KillableBarrel(b)?.Distance(e) <= E.SetSkillshot().Width || BarrelsList.Any(a => KillableBarrel(b)?.Distance(a.Barrel) <= ConnectionRange && e.Distance(b.Barrel) <= E.SetSkillshot().Width))))
                    ?? TargetSelector.GetTarget(E.Range, DamageType.Physical);
                var position      = Vector3.Zero;
                var startposition = Vector3.Zero;
                if (args.Slot == SpellSlot.Q && E.IsReady())
                {
                    var barrel       = BarrelsList.FirstOrDefault(b => b.Barrel.NetworkId == args.Target.NetworkId);
                    var Secondbarrel = BarrelsList.FirstOrDefault(b => b.Barrel.NetworkId != barrel?.Barrel.NetworkId && b.Barrel.Distance(args.Target) <= ConnectionRange);
                    if (barrel != null)
                    {
                        startposition = Secondbarrel?.Barrel.ServerPosition ?? barrel.Barrel.ServerPosition;
                    }
                    if (startposition != Vector3.Zero)
                    {
                        if (target != null && target.IsKillable(E.Range + E.SetSkillshot().Radius))
                        {
                            if (target.Distance(startposition) <= ConnectionRange + E.SetSkillshot().Radius&& target.Distance(startposition) > E.SetSkillshot().Width - 75)
                            {
                                var extended = startposition.Extend(E.GetPrediction(target).CastPosition, ConnectionRange).To3D();
                                position = !E.IsInRange(extended) ? E.GetPrediction(target).CastPosition : extended;
                            }
                        }
                        else
                        {
                            target = EntityManager.Heroes.Enemies.OrderBy(e => e.Distance(Game.CursorPos)).FirstOrDefault(e => e.IsKillable(E.Range));
                            if (target != null)
                            {
                                var extended = startposition.Extend(E.GetPrediction(target).CastPosition, ConnectionRange).To3D();
                                position = !E.IsInRange(extended) ? E.GetPrediction(target).CastPosition : extended;
                            }
                        }
                        if (position != Vector3.Zero)
                        {
                            if (BarrelsList.Count(b => b.Barrel.Distance(position) <= E.SetSkillshot().Width) < 1)
                            {
                                E.Cast(position);
                            }
                        }
                    }
                }
            }
        }
Exemple #2
0
 public override void JungleClear()
 {
     foreach (var target in EntityManager.MinionsAndMonsters.GetJungleMonsters().OrderBy(m => m.MaxHealth).Where(m => m.IsKillable(Q.Range) && !m.IsMoving))
     {
         if (target != null)
         {
             if (Q.IsReady() && JungleClearMenu.CheckBoxValue(SpellSlot.Q) && JungleClearMenu.CompareSlider("Qmana", user.ManaPercent))
             {
                 var targetbarrel = BarrelsList.FirstOrDefault(b => KillableBarrel(b) != null && b.Barrel.IsInRange(target, E.Width));
                 Q.Cast(targetbarrel != null ? KillableBarrel(targetbarrel) : target);
             }
             if (E.IsReady() && JungleClearMenu.CheckBoxValue(SpellSlot.E) && BarrelsList.Count(b => b.Barrel.IsInRange(target, E.Width)) < 1)
             {
                 E.Cast(target);
             }
         }
     }
 }