Exemplo n.º 1
0
        private static void Obj_AI_Base_OnCreate(GameObject sender, EventArgs args)
        {
            var unit = sender as Obj_AI_Base;

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

            var enemy =
                ObjectManager.Get<Obj_AI_Hero>().FirstOrDefault(h => h.IsValid && h.IsEnemy && h.Name.Equals(unit.Name));

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

            Game.SendPing((PingCategory) 1, enemy);

            var circle = new Render.Circle(enemy, 200, Color.Red)
            {
                VisibleCondition = o => enemy.IsVisible && unit.IsValid
            };

            circle.Add();

            MonitoredUnits.Add(unit.NetworkId, circle);
        }
Exemplo n.º 2
0
        private static void Game_OnGameLoad(EventArgs args)
        {
            foreach (var hero in ObjectManager.Get<Obj_AI_Hero>().Where(hero => hero.IsValid && hero.IsEnemy))
            {
                var circle = new Render.Circle(hero, Orbwalking.GetRealAutoAttackRange(hero), Color.Red, 4, true);
                circle.Add();
                CircleDictionary.Add(hero, circle);
            }

            Game.OnGameUpdate += Game_OnGameUpdate;
            Game.PrintChat("Attack Range Loaded!");
        }
Exemplo n.º 3
0
        public static void Initialize(MenuItem drawPix)
        {
            _drawPix = drawPix;
            FindPix();
            _circle = new Render.Circle(Vector3.Zero, 50, Color.Purple);
            _circle.VisibleCondition += sender => _drawPix.IsActive();
            _circle.Add();

            Obj_AI_Base.OnBuffRemove += (sender, args) =>
            {
                if (args.Buff.SourceName == ObjectManager.Player.ChampionName && (args.Buff.Name == "luluevision" || args.Buff.Name == "lulufaerieshield"))
                {
                    _lastECast = 0;
                }
            };
            Game.OnUpdate += Game_OnUpdate;
            Obj_AI_Base.OnProcessSpellCast += Obj_AI_Base_OnProcessSpellCast;
        }
Exemplo n.º 4
0
        private static void Game_OnGameLoad(EventArgs args)
        {
            foreach (var c in
                ControllerArray.Select(controlId => new Controller((UserIndex) controlId)).Where(c => c.IsConnected))
            {
                Controller = new GamepadState(c.UserIndex);
            }

            if (Controller == null || !Controller.Connected)
            {
                Game.PrintChat("No controller detected!");
                return;
            }

            Menu = new Menu("ControllerTest", "ControllerTest", true);

            Menu.AddSubMenu(new Menu("Orbwalker", "Orbwalker"));
            OrbWalker = new Orbwalking.Orbwalker(Menu.SubMenu("Orbwalker"));

            Menu.AddItem(new MenuItem("Draw", "Draw Circle").SetValue(true));
            Menu.AddToMainMenu();

            if (Menu.Item("Draw").GetValue<bool>())
            {
                CurrentPosition = new Render.Circle(ObjectManager.Player.Position, 100, Color.Red, 2);
                CurrentPosition.Add();
                Text = new Render.Text(new Vector2(50, 50), "MODE: " + CurrentMode, 30, new ColorBGRA(255, 0, 0, 255))
                {
                    OutLined = true
                };
                Text.Add();
            }

            Game.PrintChat(
                "<b><font color =\"#FFFFFF\">ControlSharp by </font><font color=\"#5C00A3\">Trees</font><font color =\"#FFFFFF\"> loaded!</font></b>");

            Menu.Item("Draw").ValueChanged += OnValueChanged;
            Game.OnUpdate += Game_OnGameUpdate;
        }
Exemplo n.º 5
0
 public PreviewCircle()
 {
     Drawing.OnEndScene += Drawing_OnEndScene;
     _mapCircle = new Render.Circle(ObjectManager.Player, 0, System.Drawing.Color.Red, 5);
     _mapCircle.Add(0);
     _mapCircle.VisibleCondition = sender => _lastChanged > 0 && Game.ClockTime - _lastChanged < Delay;
 }
Exemplo n.º 6
0
        public void CreateRenderObjects()
        {
            //Create the minimap sprite.

            if (Range == 1100)
            {
                _minimapSprite = new Render.Sprite(WardData.Bitmap, MinimapPosition);
                _minimapSprite.Scale = new Vector2(_scale, _scale);
                _minimapSprite.Add(0);
            }

            //Create the circle:
            _defaultCircle = new Render.Circle(Position, 200, Color, 5, true);
            _defaultCircle.VisibleCondition +=
                sender =>
                    WardTracker.Config.Item("Enabled").GetValue<bool>() &&
                    !WardTracker.Config.Item("Details").GetValue<KeyBind>().Active &&
                    Render.OnScreen(Drawing.WorldToScreen(Position));
            _defaultCircle.Add(0);
            _defaultCircleFilled = new Render.Circle(Position, 200, Color.FromArgb(25, Color), -142857, true);
            _defaultCircleFilled.VisibleCondition +=
                sender =>
                    WardTracker.Config.Item("Enabled").GetValue<bool>() &&
                    !WardTracker.Config.Item("Details").GetValue<KeyBind>().Active &&
                    Render.OnScreen(Drawing.WorldToScreen(Position));
            _defaultCircleFilled.Add(-1);

            //Create the circle that shows the range
            _rangeCircle = new Render.Circle(Position, Range, Color, 10, false);
            _rangeCircle.VisibleCondition +=
                sender =>
                    WardTracker.Config.Item("Enabled").GetValue<bool>() &&
                    WardTracker.Config.Item("Details").GetValue<KeyBind>().Active;
            _rangeCircle.Add(0);

            _rangeCircleFilled = new Render.Circle(Position, Range, Color.FromArgb(25, Color), -142857, true);
            _rangeCircleFilled.VisibleCondition +=
                sender =>
                    WardTracker.Config.Item("Enabled").GetValue<bool>() &&
                    WardTracker.Config.Item("Details").GetValue<KeyBind>().Active;
            _rangeCircleFilled.Add(-1);

            //Missile line;
            if (IsFromMissile)
            {
                _missileLine = new Render.Line(new Vector2(), new Vector2(), 2, new ColorBGRA(255, 255, 255, 255));
                _missileLine.EndPositionUpdate = () => Drawing.WorldToScreen(Position);
                _missileLine.StartPositionUpdate = () => Drawing.WorldToScreen(StartPosition);
                _missileLine.VisibleCondition +=
                    sender =>
                        WardTracker.Config.Item("Enabled").GetValue<bool>() &&
                        WardTracker.Config.Item("Details").GetValue<KeyBind>().Active;
                _missileLine.Add(0);
            }

            //Create the timer text:
            if (Duration != int.MaxValue)
            {
                _timerText = new Render.Text(10, 10, "t", 18, new ColorBGRA(255, 255, 255, 255));
                _timerText.OutLined = true;
                _timerText.PositionUpdate = () => Drawing.WorldToScreen(Position);
                _timerText.Centered = true;
                _timerText.VisibleCondition +=
                    sender =>
                        WardTracker.Config.Item("Enabled").GetValue<bool>() &&
                        Render.OnScreen(Drawing.WorldToScreen(Position));

                _timerText.TextUpdate =
                    () =>
                        (IsFromMissile ? "?? " : "") + Utils.FormatTime((EndT - Environment.TickCount) / 1000f) +
                        (IsFromMissile ? " ??" : "");
                _timerText.Add(2);
            }
        }
Exemplo n.º 7
0
 private static void OnValueChanged(object sender, OnValueChangeEventArgs onValueChangeEventArgs)
 {
     if (onValueChangeEventArgs.GetNewValue<bool>())
     {
         CurrentPosition = new Render.Circle(ObjectManager.Player.Position, 100, Color.Red, 2);
         CurrentPosition.Add();
         Text = new Render.Text(new Vector2(50, 50), "MODE: " + CurrentMode, 30, new ColorBGRA(255, 0, 0, 255))
         {
             OutLined = true
         };
         Text.Add();
     }
     else
     {
         CurrentPosition.Remove();
         Text.Remove();
     }
 }
Exemplo n.º 8
0
        /// <summary>
        ///     The game_ on game load.
        /// </summary>
        private static void Game_OnGameLoad()
        {
            Configuration.Miscellaneous.AddItem(new MenuItem("Debug", "Debug Mode")).SetValue<bool>(false);

            // CHANGE THIS IF YOU WANT DEBUG ENABLED ON FIRST LOAD
            Logger.Print(string.Format("AIO Version {0} Loaded.", Version));

            if (Champion != null)
            {
                #region Menu OnLoad

                Orbwalker = new Orbwalking.Orbwalker(Configuration.Main.AddSubMenu(new Menu("Orbwalk", "Orbwalk")));
                DamageIndicator = new HpBarIndicator(ObjectManager.Player);

                Configuration.Draw.AddItem(new MenuItem("Indicator", "HP Damage Indicator"))
                    .SetValue<bool>(true)
                    .ValueChanged += (a, b) =>
                        {
                            if (b.GetNewValue<bool>())
                            {
                                Logger.Print("Indicator has been disabled.");
                            }

                            DamageIndicator.Enabled = b.GetNewValue<bool>();
                        };
                Configuration.Draw.AddItem(new MenuItem("IndicatorColor", "Damage Indicator Color"))
                    .SetValue<Color>(Color.Green)
                    .ValueChanged += (a, b) =>
                        {
                            var color = b.GetNewValue<Color>();
                            DamageIndicator.DrawColor = new SharpDX.Color(color.R, color.G, color.B, color.A);
                        };
                Configuration.Miscellaneous.AddItem(
                    new MenuItem("BuiltIn", "Disable Built-In Orbwalker").SetValue<bool>(false)).ValueChanged +=
                    (a, b) =>
                        {
                            if (b.GetNewValue<bool>())
                            {
                                Logger.Print(
                                    "Built-In orbwalker disabled, feel free to use any external orb walker of your choice");
                            }

                            Orbwalker.SetMovement(!b.GetNewValue<bool>());
                            Orbwalker.SetAttack(!b.GetNewValue<bool>());
                        };
                Configuration.Miscellaneous.AddItem(new MenuItem("CustomPrediction", "Use Custom Prediction", true))
                    .SetValue<bool>(true)
                    .ValueChanged += (a, b) =>
                        {
                            if (b.GetNewValue<bool>())
                            {
                                Logger.Print("Custom prediction enabled, turn on Debug to see prediction circle");
                            }
                        };

                foreach (var spell in Champion.GetList())
                {
                    if (spell.CastingType == ChampionSpell.CastType.LinearCollision
                        || spell.CastingType == ChampionSpell.CastType.Circle)
                    {
                        spell.CreateHandler(ChampionSpell.HandlerType.Immobile);
                        spell.CreateHandler(ChampionSpell.HandlerType.Dash);
                    }

                    spell.CreateHandler(ChampionSpell.HandlerType.Killable);
                    spell.CreateHandler(ChampionSpell.HandlerType.Farm);
                    spell.CreateHandler(ChampionSpell.HandlerType.OnMinimumHit);

                    #region Range Circle

                    var circle = new Render.Circle(ObjectManager.Player, spell.Range, Color.AliceBlue);

                    Configuration.Draw.AddItem(
                        new MenuItem(spell.String, string.Format("Draw {0}", spell.String)))
                        .SetValue<Circle>(new Circle(false, Color.Aqua, spell.Range))
                        .ValueChanged += (a, b) => { circle.Color = b.GetNewValue<Circle>().Color; };

                    circle.VisibleCondition =
                        (a) =>
                        Configuration.Draw.Item(spell.String).GetValue<Circle>().Active
                        && ObjectManager.Player.IsVisible;

                    circle.Add();

                    #endregion

                    #region Damage Indicator

                    DamageIndicator.AddSpell(spell.Slot);

                    #endregion
                }

                #endregion

                #region Champion#OnLoad call

                Champion.OnLoad().Invoke();

                #endregion

                #region Event registration

                // SpeechRecongition.OnRecongized += SpeechRecongition_OnRecongized;
                Game.OnUpdate += Game_OnGameUpdate;

                #endregion

                Configuration.Main.AddToMainMenu();

                Logger.Debug(
                    string.Format(
                        "Game_OnGameLoad passed, Champion instance created for {0}",
                        ObjectManager.Player.ChampionName));
            }
            else
            {
                Logger.Debug(
                    string.Format(
                        "Game_OnGameLoad passed, Champion {0} could not be instanced and is not supported.",
                        ObjectManager.Player.ChampionName));
            }
        }
Exemplo n.º 9
0
 public void DrawCircle()
 {
     _circle = new Render.Circle(WardObject.Position, 100, Color, 5, true);
     _circle.VisibleCondition += sender => WardDetector.IsActive() && Render.OnScreen(Drawing.WorldToScreen(WardObject.Position));
     _circle.Add(0);
     if (Type != WardType.Trap)
     {
         _minimapSprite = new Render.Sprite(Bitmap, MinimapPosition) { Scale = new Vector2(Scale, Scale) };
         _minimapSprite.Add(0);
     }
     if (Duration == int.MaxValue)
     {
         return;
     }
     _timerText = new Render.Text(10, 10, "t", 18, new ColorBGRA(255, 255, 255, 255))
     {
         OutLined = true,
         PositionUpdate = () => Drawing.WorldToScreen(WardObject.Position),
         Centered = true
     };
     _timerText.VisibleCondition +=
         sender => WardDetector.IsActive() && Render.OnScreen(Drawing.WorldToScreen(WardObject.Position));
     _timerText.TextUpdate = () => Utils.FormatTime((EndTime - Environment.TickCount) / 1000f);
     _timerText.Add(2);
 }