Exemple #1
0
 private void OnObjAiBaseProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
 {
     try
     {
         if (sender.IsMe)
         {
             if (args.SData.Name == "KalistaExpungeWrapper")
             {
                 Orbwalking.ResetAutoAttackTimer();
             }
         }
     }
     catch (Exception ex)
     {
         Global.Logger.AddItem(new LogItem(ex));
     }
 }
Exemple #2
0
        private void OnOrbwalkingAfterAttack(AttackableUnit unit, AttackableUnit target)
        {
            try
            {
                if (unit.IsMe && W.IsReady())
                {
                    var useW        = false;
                    var wMin        = 0;
                    var laneclear   = false;
                    var jungleClear = false;
                    switch (Orbwalker.ActiveMode)
                    {
                    case Orbwalking.OrbwalkingMode.Combo:
                        useW = Menu.Item(Menu.Name + ".combo.w").GetValue <bool>();
                        break;

                    case Orbwalking.OrbwalkingMode.Mixed:
                        useW = Menu.Item(Menu.Name + ".harass.w").GetValue <bool>();
                        break;

                    case Orbwalking.OrbwalkingMode.LaneClear:
                        if (target.Team == GameObjectTeam.Neutral)
                        {
                            useW = Menu.Item(Menu.Name + ".jungle-clear.w").GetValue <bool>() &&
                                   ResourceManager.Check("jungle-clear-w");
                            wMin        = 1;
                            jungleClear = true;
                        }
                        else
                        {
                            useW = Menu.Item(Menu.Name + ".lane-clear.w").GetValue <bool>() &&
                                   ResourceManager.Check("lane-clear-w");
                            wMin      = Menu.Item(Menu.Name + ".lane-clear.w-min").GetValue <Slider>().Value;
                            laneclear = true;
                        }
                        break;
                    }
                    if (useW)
                    {
                        var range   = W.Range + Player.BoundingRadius * 2f;
                        var targets = laneclear || jungleClear
                            ? MinionManager.GetMinions(range + 450, MinionTypes.All, MinionTeam.NotAlly)
                            : GameObjects.EnemyHeroes.Where(e => e.IsValidTarget(range + 450))
                                      .Cast <Obj_AI_Base>()
                                      .ToList();

                        if (targets.Count >= wMin && targets.Any(Orbwalking.InAutoAttackRange) &&
                            (wMin == 0 ||
                             targets.Any(
                                 t =>
                                 Orbwalking.InAutoAttackRange(t) &&
                                 targets.Any(t2 => t2.NetworkId != t.NetworkId && t2.Distance(t) <= 450))))
                        {
                            W.Cast();
                            Orbwalking.ResetAutoAttackTimer();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
        }