Exemplo n.º 1
0
 public static void CastQ()
 {
     var target = TargetSelector2.GetTarget(400, DamageType.Physical);
     if (target.IsValidTarget() && !target.IsZombie)
     {
         PassiveManager.CastQhelper(target);
     }
     else
     {
         target = TargetSelector2.GetTarget(400 + Player.Instance.GetAutoAttackRange(), DamageType.Physical);
         {
             if (target.IsValidTarget() && !target.IsZombie)
             {
                 PassiveManager.CastQhelper(target);
             }
             else
             {
                 target = TargetSelector2.GetTarget(400 + 350, DamageType.Physical);
                 if (target.IsValidTarget() && !target.IsZombie)
                 {
                     PassiveManager.CastQhelper(target);
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
        public static void CastW()
        {
            var target = TargetSelector2.GetTarget(W.Range, DamageType.Physical);

            if (target.IsValidTarget() && !target.IsZombie && W.IsReady())
            {
                W.Cast(target);
            }
        }
Exemplo n.º 3
0
        public static void CastR()
        {
            var target = TargetSelector2.GetTarget(R.Range, DamageType.Physical);

            if (target.IsValidTarget(500) && !target.IsZombie && R.IsReady())
            {
                R.Cast(target);
            }
        }
Exemplo n.º 4
0
        public static void UseCastables()
        {
            if (BOTRK.IsOwned() || Cutl.IsOwned())
            {
                var t = TargetSelector2.GetTarget(BOTRK.Range, DamageType.Physical);
                if (t == null || !t.IsValidTarget())
                {
                    return;
                }

                if (BOTRK.IsReady() || Cutl.IsReady())
                {
                    BOTRK.Cast(t);
                    Cutl.Cast(t);
                }
            }
        }
Exemplo n.º 5
0
        static void OnUpdate(EventArgs args)
        {
            if (!SpellManager.W.IsReady() || !Config.Dispell.DispellSpells)
            {
                return;
            }

            foreach (var dispell in Dispells.Where(
                         d =>
                         Player.HasBuff(d.BuffName) &&
                         Config.Dispell.Menu[d.ChampionName + d.BuffName] != null &&
                         Config.Dispell.Menu[d.ChampionName + d.BuffName].Cast <CheckBox>().CurrentValue
                         ))
            {
                var buff = Player.GetBuff(dispell.BuffName);
                if (buff == null || !buff.IsValid || !buff.IsActive)
                {
                    continue;
                }

                var t  = (buff.EndTime - Game.Time) * 1000f + dispell.Offset + 250;
                var wT = SpellManager.W.CastDelay + Game.Ping / 2f;

                if (t < wT)
                {
                    var target = TargetSelector2.GetTarget(SpellManager.W.Range, DamageType.Mixed);

                    if (target != null && target.IsValidTarget(SpellManager.W.Range) && SpellManager.W.Cast(target))
                    {
                        return;
                    }

                    if (SpellManager.W.Cast(Game.CursorPos))
                    {
                        return;
                    }
                }
            }
        }
Exemplo n.º 6
0
        private static void OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            var unit = sender as AIHeroClient;


            /*
             * Chat.Print("=========================================");
             * Chat.Print("End Distance: " + args.End.Distance(Player.Instance.Position).ToString());
             * Chat.Print("Mov speed: " + unit.MoveSpeed.ToString());
             * Chat.Print("Start Distance: " + args.Start.Distance(Player.Instance));
             * Chat.Print("unit distance: " + unit.Distance(Player.Instance));
             * Chat.Print(args.Time.ToString());
             * Chat.Print(sender.Distance(Player.Instance));
             * Chat.Print(sender.Distance(Player.Instance.Position));
             */


            if (unit == null || !unit.IsValid)
            {
                return;
            }


            if (unit.IsMe && args.Slot.Equals(SpellSlot.E))
            {
                Orbwalker.ResetAutoAttack();
                return;
            }

            if (!unit.IsEnemy || !ShieldSettings.BlockSpells || !SpellManager.W.IsReady())
            {
                return;
            }

            // spell handled by evade
            if (SpellDatabase.GetByName(args.SData.Name) != null && !ShieldSettings.EvadeIntegration)
            {
                return;
            }

            if (!SpellBlock.Contains(unit, args))
            {
                return;
            }

            if (args.End.Distance(Player.Instance) == 0)
            {
                return;
            }



            var castUnit = unit;
            var type     = args.SData.TargettingType;

            if (!unit.IsValidTarget())
            {
                var target = TargetSelector2.GetTarget(SpellManager.W.Range, DamageType.Mixed);
                if (target == null || !target.IsValidTarget(SpellManager.W.Range))
                {
                    target = TargetSelector.SelectedTarget;
                }

                if (target != null && target.IsValidTarget(SpellManager.W.Range))
                {
                    castUnit = target;
                }
            }

            if (unit.ChampionName.Equals("Caitlyn") && args.Slot == SpellSlot.Q)
            {
                Core.DelayAction(() => CastW(castUnit),
                                 (int)(args.Start.Distance(Player.Instance) / args.SData.MissileSpeed * 1000) -
                                 (int)(args.End.Distance(Player.Instance) / args.SData.MissileSpeed) - 500);
            }
            if (unit.ChampionName.Equals("Zyra"))
            {
                Core.DelayAction(() => CastW(castUnit),
                                 (int)(args.Start.Distance(Player.Instance) / args.SData.MissileSpeed * 1000) -
                                 (int)(args.End.Distance(Player.Instance) / args.SData.MissileSpeed) - 500);
            }
            if (args.End.Distance(Player.Instance) < 250)
            {
                if (unit.ChampionName.Equals("Bard") && args.End.Distance(Player.Instance) < 300)
                {
                    Core.DelayAction(() => CastW(castUnit), (int)(unit.Distance(Player.Instance) / 7f) + 400);
                }
                else if (unit.ChampionName.Equals("Ashe"))
                {
                    Core.DelayAction(() => CastW(castUnit),
                                     (int)(args.Start.Distance(Player.Instance) / args.SData.MissileSpeed * 1000) -
                                     (int)args.End.Distance(Player.Instance));
                    return;
                }
                else if (unit.ChampionName.Equals("Varus") || unit.ChampionName.Equals("TahmKench") ||
                         unit.ChampionName.Equals("Lux"))
                {
                    Core.DelayAction(() => CastW(castUnit),
                                     (int)(args.Start.Distance(Player.Instance) / args.SData.MissileSpeed * 1000) -
                                     (int)(args.End.Distance(Player.Instance) / args.SData.MissileSpeed) - 500);
                }
                else if (unit.ChampionName.Equals("Amumu"))
                {
                    if (sender.Distance(Player.Instance) < 1100)
                    {
                        Core.DelayAction(() => CastW(castUnit),
                                         (int)(args.Start.Distance(Player.Instance) / args.SData.MissileSpeed * 1000) -
                                         (int)(args.End.Distance(Player.Instance) / args.SData.MissileSpeed) - 500);
                    }
                }
            }
            //    else if (args.End.Distance(Player.Instance) < 60)
            //    {
            //        Core.DelayAction(() => CastW(castUnit),
            //            (int) (args.Start.Distance(Player.Instance)/args.SData.MissileSpeed*1000) -
            //            (int) (args.End.Distance(Player.Instance)/args.SData.MissileSpeed) - 500);
            //    }
            //}


            if (args.Target != null && type.Equals(SpellDataTargetType.Unit))
            {
                if (!args.Target.IsMe ||
                    (args.Target.Name.Equals("Barrel") && args.Target.Distance(Player.Instance) > 200 &&
                     args.Target.Distance(Player.Instance) < 400))
                {
                    return;
                }

                if (unit.ChampionName.Equals("Nautilus") ||
                    (unit.ChampionName.Equals("Caitlyn") && args.Slot.Equals(SpellSlot.R)))
                {
                    var d          = unit.Distance(Player.Instance);
                    var travelTime = d / args.SData.MissileSpeed;
                    var delay      = travelTime * 1000 - SpellManager.W.CastDelay + 150;
                    Console.WriteLine("TT: " + travelTime + " " + delay);
                    Core.DelayAction(() => CastW(castUnit), (int)delay);
                    return;
                }
                CastW(castUnit);
            }

            if (type.Equals(SpellDataTargetType.Unit))
            {
                if (unit.ChampionName.Equals("Bard") && args.End.Distance(Player.Instance) < 300)
                {
                    Core.DelayAction(() => CastW(castUnit), 400 + (int)(unit.Distance(Player.Instance) / 7f));
                }
                else if (unit.ChampionName.Equals("Riven") && args.End.Distance(Player.Instance) < 260)
                {
                    CastW(castUnit);
                }
                else
                {
                    CastW(castUnit);
                }
            }
            else if (type.Equals(SpellDataTargetType.LocationAoe) &&
                     args.End.Distance(Player.Instance) < args.SData.CastRadius)
            {
                // annie moving tibbers
                if (unit.ChampionName.Equals("Annie") && args.Slot.Equals(SpellSlot.R))
                {
                    return;
                }
                CastW(castUnit);
            }
            else if (type.Equals(SpellDataTargetType.Cone) &&
                     args.End.Distance(Player.Instance) < args.SData.CastRadius)
            {
                CastW(castUnit);
            }
            else if (type.Equals(SpellDataTargetType.SelfAoe) || type.Equals(SpellDataTargetType.Self))
            {
                var d = args.End.Distance(Player.Instance.ServerPosition);
                var p = args.SData.CastRadius > 5000 ? args.SData.CastRange : args.SData.CastRadius;
                if (d < p)
                {
                    CastW(castUnit);
                }
            }
        }