Пример #1
0
        private bool CanMoonSec(AIHeroClient target)
        {
            if (!LeeSinMenu.insecMenu["moonSec"].Cast <CheckBox>().CurrentValue)
            {
                return(false);
            }

            var wardPlacePos = SelectionHandler.GetAllyPos + (target.Position.To2D() - SelectionHandler.GetAllyPos);

            var canFlash    = SpellManager.FlashReady;
            var canWardJump = SpellManager.CanCastW1 && me.Mana >= minEnegeryFirstActivation &&
                              WardManager.CanCastWard;

            if (me.Distance(wardPlacePos) <= WardManager.WardRange && canWardJump && canFlash)
            {
                moonSecActive = true;
                WardManager.CastWardTo(wardPlacePos.To3D());
                Core.RepeatAction(() =>
                {
                    if (me.Distance(target) <= (float)SpellManager.Flash.Range / 2)
                    {
                        SpellManager.R.Cast(target);
                    }
                    else
                    {
                        moonSecActive = false;
                    }
                }, 350, 1500);
                return(true);
            }

            return(false);
        }
Пример #2
0
        private bool CanWardKick(Vector2 wardPlacePos, AIHeroClient target)
        {
            var allyJump      = GetAllyAsWard();
            var allyJumpValid = allyJump != null;
            var canWardJump   = (WardManager.CanCastWard || allyJumpValid) && SpellManager.CanCastW1 &&
                                me.Mana >= minEnegeryFirstActivation;
            float maxDist = WardManager.CanCastWard ? WardManager.WardRange : SpellManager.W1.Range;

            if (me.Distance(wardPlacePos) <= maxDist && canWardJump)
            {
                decidedWardKick           = true;
                LastWardJumpInsecPosition = wardPlacePos;
                //Chat.Print("wardKick");
                if (WardManager.CanCastWard)
                {
                    WardManager.CastWardTo(wardPlacePos.To3D());
                }
                else
                {
                    SpellManager.W1.Cast(allyJump);
                }
                Core.RepeatAction(() => SpellManager.R.Cast(target), 350, 1500);

                Core.DelayAction(() => decidedWardKick = false, 1000);
                return(true);
            }

            return(false);
        }
        static void Postfix(CharacterState __instance, SpawnPoint destinationSpawnPoint, int delayIndex, int prevRoomIndex)
        {
            // CustomTrigger
            CustomTriggerManager.QueueTrigger(OnRelocate.OnRelocateCharTrigger, __instance, true, true,
                                              new CharacterState.FireTriggersData
            {
                paramInt = destinationSpawnPoint.GetRoomOwner().GetRoomIndex() - prevRoomIndex
            },
                                              1);

            // WardTriggers
            WardManager.TriggerWardsNow("Power", destinationSpawnPoint.GetRoomOwner().GetRoomIndex(), new List <CharacterState> {
                __instance
            });

            // Room Modifier
            List <CharacterState> chars = new List <CharacterState>();

            __instance.GetCharacterManager().AddCharactersInRoomToList(chars, __instance.GetCurrentRoomIndex());
            foreach (var unit in chars)
            {
                if (unit == __instance)
                {
                    continue;
                }
                foreach (IRoomStateModifier roomStateModifier in unit.GetRoomStateModifiers())
                {
                    IRoomStateSpawnPointsModifiedModifier roomStateSpawnPointsChangedModifier;
                    if ((roomStateSpawnPointsChangedModifier = (roomStateModifier as IRoomStateSpawnPointsModifiedModifier)) != null)
                    {
                        roomStateSpawnPointsChangedModifier.SpawnPointModifier(__instance);
                    }
                }
            }
        }
Пример #4
0
 private void SearchForSolution()
 {
     if (canAllyJump && Enabled(MenuEntry.UseAlly))
     {
         solution = StarSolutions.Ally;
     }
     else if (canWardJump && target.Distance(me) <= WardManager.WardRange && Enabled(MenuEntry.UseWard))
     {
         solution = StarSolutions.Ward;
     }
     else if (canFlash && target.Distance(me) <= SpellManager.Flash.Range && Enabled(MenuEntry.UseFlash))
     {
         solution = StarSolutions.Flash;
     }
     else if ((canWardJump || canAllyJump) && canFlash && Enabled(MenuEntry.UseFlash))//maybe flash + ward?
     {
         var ally =
             EntityManager.Heroes.Allies.Where(
                 x => x.IsValid && x.Distance(target) < SpellManager.R.Range)
             .OrderBy(x => x.Distance(me)).FirstOrDefault();
         bool allyValid = ally != null && !ally.Equals(default(AIHeroClient)) && ally.IsValid;
         if (allyValid && ally.Distance(me) <= SpellManager.W1.Range + SpellManager.Flash.Range && Enabled(MenuEntry.UseAlly))
         {
             SpellManager.Flash.Cast(me.Position.Extend(ally, SpellManager.Flash.Range).To3D());
         }
         else if (target.Distance(me) <= WardManager.WardRange + SpellManager.Flash.Range && canWardJump &&
                  Enabled(MenuEntry.UseWard))
         {
             WardManager.CastWardTo(me.Position.Extend(target, WardManager.WardRange).To3D());
         }
     }
 }
Пример #5
0
        private void deleteButton_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(IdTextBox.Text))
            {
                MessageBox.Show("Ward info not found.");
                return;
            }
            DialogResult dr = MessageBox.Show("Are you sure to delete this information?", "Confirmation Message", MessageBoxButtons.YesNo);

            if (dr == DialogResult.Yes)
            {
                Ward aWard = new Ward();
                aWard.Id = Convert.ToInt32(IdTextBox.Text);

                MessageModel message = new WardManager().DeleteWard(aWard);
                if (message.MessageTitle == "Successfull")
                {
                    MessageBox.Show(message.MessageBody, message.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    ResetAllData();
                    LoadFloor();
                    LoadCategory();
                    Refresh();
                }
            }
        }
Пример #6
0
 /// <summary>
 ///     The on update callback.
 /// </summary>
 internal override void OnUpdate()
 {
     if (MyMenu.RootMenu.Item("wardjump.key").GetValue <KeyBind>().Active)
     {
         ObjectManager.Player.IssueOrder(GameObjectOrder.MoveTo, ObjectManager.Player.ServerPosition.Extend(Game.CursorPos, 250), false);
         WardManager.WardjumpHandler(Game.CursorPos);
     }
 }
Пример #7
0
        /// <returns></returns>
        void CheckWardJump()
        {
            float wSpeed = 2000;

            if (canAllyJump)
            {
                var ally = EntityManager.Heroes.Allies.Where(
                    x =>
                    x.IsValid && x.Distance(me) <= SpellManager.W1.Range &&
                    x.Distance(target) < 100).OrderBy(x => x.Distance(me)).First();
                float predictionDist = me.Distance(ally);

                float   flyTime = predictionDist / wSpeed;
                Vector2 predPos = Prediction.Position.PredictUnitPosition(target, (int)flyTime);

                if (predPos.Distance(ally) <= SpellManager.R.Range)
                {
                    foundSolution = true;
                    SpellManager.W1.Cast(ally);
                }
            }

            if (LeeSinMenu.bubbaKushMenu["useMovementPredictionBubba1"].Cast <CheckBox>().CurrentValue &&
                WardManager.CanWardJump)
            {
                float predictionDist = me.Distance(target) >= WardManager.WardRange
                    ? WardManager.WardRange
                    : me.Distance(target);
                float   flyTime = predictionDist / wSpeed;
                Vector2 predPos = Prediction.Position.PredictUnitPosition(target, (int)flyTime);

                if (me.Distance(predPos) <= WardManager.WardRange)
                {
                    foundSolution = true;
                    WardManager.CastWardTo(predPos.To3D());
                }
            }
            else if (WardManager.CanWardJump)
            {
                Vector2 targetPos = target.Position.To2D();
                if (me.Distance(targetPos) <= WardManager.WardRange)
                {
                    foundSolution = true;
                    WardManager.CastWardTo(targetPos.To3D());
                }
            }
        }
Пример #8
0
        private void editButton_Click(object sender, EventArgs e)
        {
            aWard             = new Ward();
            aWard.Id          = Convert.ToInt32(IdTextBox.Text);
            aWard.WardName    = wardNameTextBox.Text;
            aWard.FloorId     = Convert.ToInt32(floorComboBox.SelectedValue);
            aWard.CategoryId  = Convert.ToInt32(categoryComboBox.SelectedValue);
            aWard.Description = descriptionTextBox.Text;

            MessageModel myMessage = new WardManager().EditWard(aWard);

            MessageBox.Show(myMessage.MessageTitle, myMessage.MessageBody, MessageBoxButtons.OK, MessageBoxIcon.Information);
            if (myMessage.MessageTitle == "Successfull")
            {
                ResetAllData();
            }
        }
Пример #9
0
Файл: Flee.cs Проект: jitart/adc
 public static void Execute()
 {
     if (SpellManager.CanCastW1)
     {
         var obj = Champion.GetBestObjectNearTo(Util.MousePos);
         if (obj != null && Menu.GetCheckBoxValue("W"))
         {
             SpellManager.CastW1(obj);
         }
         else if (Menu.GetCheckBoxValue("WardJump"))
         {
             if (WardManager.CanCastWard)
             {
                 WardManager.CastWardTo(Util.MousePos);
             }
         }
     }
 }
Пример #10
0
        private bool CanWardFlashKick(Vector2 wardPlacePos)
        {
            var allyJump      = GetAllyAsWard();
            var allyJumpValid = allyJump != null;
            var canFlash      = SpellManager.FlashReady;
            var canWardJump   = (WardManager.CanCastWard || allyJumpValid) &&
                                me.Mana >= minEnegeryFirstActivation && SpellManager.W1.IsReady();
            float maxWardJumpDist = !allyJumpValid ? WardManager.WardRange : SpellManager.W1.Range;


            bool inRange = me.Distance(wardPlacePos) <= SpellManager.Flash.Range + maxWardJumpDist;



            float distQTargetToWardPos = GetLastQBuffEnemyObject() != null && GetLastQBuffEnemyObject().IsValid ?
                                         GetLastQBuffEnemyObject().Distance(wardPlacePos) : float.MaxValue;

            bool dontNeedFlash = distQTargetToWardPos <= maxWardJumpDist;
            bool waitForQFirst = (SpellManager.CanCastQ1 || Environment.TickCount - LastQ1CastTick < 1000) &&
                                 LeeSinMenu.insecExtensionsMenu["waitForQBefore_WardFlashKick"].Cast <CheckBox>().CurrentValue;
            bool onlyUseWithQ = GetLastQBuffEnemyObject() == null &&
                                LeeSinMenu.insecExtensionsMenu["WardFlashKickOnlyWithQ"].Cast <CheckBox>().CurrentValue;

            if (inRange && canWardJump && canFlash && !dontNeedFlash &&
                !waitForQFirst && !onlyUseWithQ)
            {
                //Chat.Print("wardFLashKick");
                if (WardManager.CanCastWard)
                {
                    if (!LeeSinMenu.insecExtensionsMenu["dontFlash"].Cast <CheckBox>().CurrentValue)
                    {
                        WardManager.CastWardTo(wardPlacePos.To3D());
                        return(true);
                    }
                    else /*flash -> ally w to reach wardPos*/ if (!LeeSinMenu.insecExtensionsMenu["dontFlash"].Cast <CheckBox>().CurrentValue)
                    {
                        SpellManager.Flash.Cast(wardPlacePos.To3D());
                        return(true);
                    }
                }
            }

            return(false);
        }
Пример #11
0
        private void button1_Click(object sender, EventArgs e)
        {
            Users u = new Users();
            //try
            //{
            int    user_id = Convert.ToInt32(textBox1.Text);
            string pass    = textBox2.Text;
            string uname   = u.Login(user_id, pass, out string role);

            if (uname.Equals(""))
            {
                throw new FormatException();
            }
            SessionClass.SessionId   = user_id;
            SessionClass.SessionName = uname;
            this.Hide();
            switch (role)
            {
            case "Doctor":
                Doctor doctor = new Doctor();
                doctor.ShowDialog();
                break;

            case "Laboratorian":
                Laboratorian laboratorian = new Laboratorian();
                laboratorian.ShowDialog();
                break;

            case "Chemist":
                Chemist chemist = new Chemist();
                chemist.ShowDialog();
                break;

            case "Receptionist":
                Receptionist receptionist = new Receptionist();
                receptionist.ShowDialog();
                break;

            case "Manager":
                Manager manager = new Manager();
                manager.ShowDialog();
                break;

            case "Nurse":
                Nurse nurse = new Nurse();
                nurse.ShowDialog();
                break;

            case "WardManager":
                WardManager wm = new WardManager();
                wm.ShowDialog();
                break;

            case "Admin":
                Admin a = new Admin();
                a.ShowDialog();
                break;
            }

            /* }
             * catch (Exception ex)
             * {
             *   Console.WriteLine(ex.Message.ToString());
             *   if (ex.GetType().ToString().Equals("System.FormatException"))
             *       MessageBox.Show("User doesn't exists", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             *   else
             *    MessageBox.Show("Something went wrong please try agian later", "Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
             *   label8.Text = "NOT FOUND";
             * }*/
        }
Пример #12
0
        public LeeSin()
        {
            var spellConfig = new SpellConfig();

            spellConfig.Load();

            var insecManager = new InsecManager(spellConfig);

            var wardtracker = new WardTracker(spellConfig);
            var wardmanager = new WardManager(wardtracker);

            var wardjump  = new WardJump(wardtracker, wardmanager, spellConfig);
            var insec     = new Insec(wardtracker, wardmanager, spellConfig, insecManager);
            var kickFlash = new KickFlash(spellConfig, insecManager);

            var combo = new Combo(wardmanager, spellConfig, wardtracker);

            var harass      = new Harass(wardmanager, spellConfig);
            var jungle      = new JungleClear(wardmanager, spellConfig);
            var lane        = new LaneClear(spellConfig);
            var lasthit     = new Lasthit(spellConfig);
            var killsteal   = new Killsteal(spellConfig);
            var drawManager = new DrawManager(spellConfig, insecManager, new Dmg(spellConfig));

            var mainmenu = new Menu("main", "Adept AIO", true);

            mainmenu.Attach();

            spellConfig.InsecMode     = new OrbwalkerMode("Insec", KeyCode.T, Global.TargetSelector.GetSelectedTarget, insec.OnKeyPressed);
            spellConfig.WardjumpMode  = new OrbwalkerMode("Wardjump", KeyCode.G, null, wardjump.OnKeyPressed);
            spellConfig.KickFlashMode = new OrbwalkerMode("Kick Flash", KeyCode.A, null, kickFlash.OnKeyPressed);

            spellConfig.InsecMode.MenuItem.OnValueChanged     += (sender, args) => insec.Enabled = args.GetNewValue <MenuKeyBind>().Value;
            spellConfig.WardjumpMode.MenuItem.OnValueChanged  += (sender, args) => wardjump.Enabled = args.GetNewValue <MenuKeyBind>().Value;
            spellConfig.KickFlashMode.MenuItem.OnValueChanged += (sender, args) => kickFlash.Enabled = args.GetNewValue <MenuKeyBind>().Value;

            Global.Orbwalker.AddMode(spellConfig.InsecMode);
            Global.Orbwalker.AddMode(spellConfig.WardjumpMode);
            Global.Orbwalker.AddMode(spellConfig.KickFlashMode);
            Global.Orbwalker.Attach(mainmenu);

            var insecMenu     = new Menu("Insec", "Insec");
            var insecBk       = new MenuKeyBind("BK", "Bubba Kush Toggle", KeyCode.L, KeybindType.Toggle);
            var insecF        = new MenuBool("Flash", "Enable Flash");
            var insecObject   = new MenuBool("Object", "Use Q On Minions").SetToolTip("Uses Q to gapclose to every minion");
            var insecQLast    = new MenuBool("Last", "Use Q After Insec").SetToolTip("Only possible if no minions near target");
            var insecPosition = new MenuList("Position",
                                             "Insec Position",
                                             new[]
            {
                "Ally Turret",
                "Ally Hero"
            },
                                             0);
            var insecKick = new MenuList("Kick",
                                         "Kick Type: ",
                                         new[]
            {
                "Flash R",
                "R Flash"
            },
                                         1);

            insecMenu.Add(insecBk);
            insecMenu.Add(insecF);
            insecMenu.Add(insecObject);
            insecMenu.Add(insecQLast);
            insecMenu.Add(insecPosition);
            insecMenu.Add(insecKick);
            mainmenu.Add(insecMenu);

            Temp.IsBubbaKush                = insec.Bk = insecMenu["BK"].Enabled;
            insec.FlashEnabled              = insecMenu["Flash"].Enabled;
            insec.ObjectEnabled             = insecMenu["Object"].Enabled;
            insec.QLast                     = insecMenu["Last"].Enabled;
            insecManager.InsecPositionValue = insecMenu["Position"].Value;
            insecManager.InsecKickValue     = insecMenu["Kick"].Value;

            insecBk.OnValueChanged += (sender, args) =>
            {
                insec.Bk         = args.GetNewValue <MenuKeyBind>().Value;
                Temp.IsBubbaKush = args.GetNewValue <MenuKeyBind>().Value;
            };

            insecF.OnValueChanged        += (sender, args) => insec.FlashEnabled = args.GetNewValue <MenuBool>().Value;
            insecObject.OnValueChanged   += (sender, args) => insec.ObjectEnabled = args.GetNewValue <MenuBool>().Value;
            insecQLast.OnValueChanged    += (sender, args) => insec.QLast = args.GetNewValue <MenuBool>().Value;
            insecPosition.OnValueChanged += (sender, args) => insecManager.InsecPositionValue = args.GetNewValue <MenuList>().Value;
            insecKick.OnValueChanged     += (sender, args) => insecManager.InsecKickValue = args.GetNewValue <MenuList>().Value;

            var comboMenu   = new Menu("Combo", "Combo");
            var comboTurret = new MenuBool("Turret", "Don't Q2 Into Turret");
            var comboQ      = new MenuBool("Q", "Use Q");
            var comboQ2     = new MenuBool("Q2", "Use Q2");
            var comboW      = new MenuBool("W", "Use W");
            var comboWard   = new MenuBool("Ward", "Use Wards");
            var comboE      = new MenuBool("E", "Use E");

            foreach (var b in new List <MenuBool>
            {
                comboTurret,
                comboQ,
                comboQ2,
                comboW,
                comboWard,
                comboE
            })
            {
                comboMenu.Add(b);
            }
            mainmenu.Add(comboMenu);

            combo.TurretCheckEnabled = comboMenu["Turret"].Enabled;
            combo.Q1Enabled          = comboMenu["Q"].Enabled;
            combo.Q2Enabled          = comboMenu["Q2"].Enabled;
            combo.WEnabled           = comboMenu["W"].Enabled;
            combo.WardEnabled        = comboMenu["Ward"].Enabled;
            combo.EEnabled           = comboMenu["E"].Enabled;

            comboTurret.OnValueChanged += (sender, args) => combo.TurretCheckEnabled = args.GetNewValue <MenuBool>().Value;
            comboQ.OnValueChanged      += (sender, args) => combo.Q1Enabled = args.GetNewValue <MenuBool>().Value;
            comboQ2.OnValueChanged     += (sender, args) => combo.Q2Enabled = args.GetNewValue <MenuBool>().Value;
            comboW.OnValueChanged      += (sender, args) => combo.WEnabled = args.GetNewValue <MenuBool>().Value;
            comboWard.OnValueChanged   += (sender, args) => combo.WardEnabled = args.GetNewValue <MenuBool>().Value;
            comboE.OnValueChanged      += (sender, args) => combo.EEnabled = args.GetNewValue <MenuBool>().Value;

            var harassMenu = new Menu("Harass", "Harass");
            var harassQ    = new MenuBool("Q", "Use Q");
            var harassQ2   = new MenuBool("Q2", "Use Q2");
            var harassMode = new MenuList("Mode",
                                          "W Mode: ",
                                          new[]
            {
                "Away",
                "W Self"
            },
                                          0);
            var harassE  = new MenuBool("E", "Use E");
            var harassE2 = new MenuBool("E2", "Use E2");

            harassMenu.Add(harassQ);
            harassMenu.Add(harassQ2);
            harassMenu.Add(harassMode);
            harassMenu.Add(harassE);
            harassMenu.Add(harassE2);
            mainmenu.Add(harassMenu);

            harass.Q1Enabled = harassMenu["Q"].Enabled;
            harass.Q2Enabled = harassMenu["Q2"].Enabled;
            harass.Mode      = harassMenu["Mode"].Value;
            harass.EEnabled  = harassMenu["E"].Enabled;
            harass.E2Enabled = harassMenu["E2"].Enabled;

            harassQ.OnValueChanged    += (sender, args) => harass.Q1Enabled = args.GetNewValue <MenuBool>().Value;
            harassQ2.OnValueChanged   += (sender, args) => harass.Q2Enabled = args.GetNewValue <MenuBool>().Value;
            harassMode.OnValueChanged += (sender, args) => harass.Mode = args.GetNewValue <MenuList>().Value;
            harassE.OnValueChanged    += (sender, args) => harass.EEnabled = args.GetNewValue <MenuBool>().Value;
            harassE2.OnValueChanged   += (sender, args) => harass.E2Enabled = args.GetNewValue <MenuBool>().Value;

            var jungleMenu  = new Menu("Jungle", "Jungle");
            var jungleSteal = new MenuBool("Steal", "Steal Legendary");
            var jungleSmite = new MenuBool("Smite", "Smite Big Mobs");
            var jungleBlue  = new MenuBool("Blue", "Smite Blue Buff");
            var jungleQ     = new MenuBool("Q", "Q");
            var jungleW     = new MenuBool("W", "W");
            var jungleE     = new MenuBool("E", "E");

            foreach (var b in new List <MenuBool>
            {
                jungleSteal,
                jungleSmite,
                jungleBlue,
                jungleQ,
                jungleW,
                jungleE
            })
            {
                jungleMenu.Add(b);
            }
            mainmenu.Add(jungleMenu);

            jungle.StealEnabled = jungleMenu["Steal"].Enabled;
            jungle.SmiteEnabled = jungleMenu["Smite"].Enabled;
            jungle.BlueEnabled  = jungleMenu["Blue"].Enabled;
            jungle.Q1Enabled    = jungleMenu["Q"].Enabled;
            jungle.WEnabled     = jungleMenu["W"].Enabled;
            jungle.EEnabled     = jungleMenu["E"].Enabled;

            jungleSteal.OnValueChanged += (sender, args) => jungle.StealEnabled = args.GetNewValue <MenuBool>().Value;
            jungleSmite.OnValueChanged += (sender, args) => jungle.Q1Enabled = args.GetNewValue <MenuBool>().Value;
            jungleBlue.OnValueChanged  += (sender, args) => jungle.BlueEnabled = args.GetNewValue <MenuBool>().Value;
            jungleQ.OnValueChanged     += (sender, args) => jungle.Q1Enabled = args.GetNewValue <MenuBool>().Value;
            jungleW.OnValueChanged     += (sender, args) => jungle.WEnabled = args.GetNewValue <MenuBool>().Value;
            jungleE.OnValueChanged     += (sender, args) => jungle.EEnabled = args.GetNewValue <MenuBool>().Value;

            var laneMenu  = new Menu("Lane", "Lane");
            var laneCheck = new MenuBool("Check", "Don't Clear When Enemies Nearby");
            var laneQ     = new MenuBool("Q", "Q");
            var laneW     = new MenuBool("W", "W");
            var laneE     = new MenuBool("E", "E");

            foreach (var b in new List <MenuBool>
            {
                laneCheck,
                laneQ,
                laneW,
                laneE
            })
            {
                laneMenu.Add(b);
            }
            mainmenu.Add(laneMenu);

            lane.CheckEnabled = laneMenu["Check"].Enabled;
            lane.Q1Enabled    = laneMenu["Q"].Enabled;
            lane.WEnabled     = laneMenu["W"].Enabled;
            lane.EEnabled     = laneMenu["E"].Enabled;

            laneCheck.OnValueChanged += (sender, args) => lane.CheckEnabled = args.GetNewValue <MenuBool>().Value;
            laneQ.OnValueChanged     += (sender, args) => lane.Q1Enabled = args.GetNewValue <MenuBool>().Value;
            laneW.OnValueChanged     += (sender, args) => lane.WEnabled = args.GetNewValue <MenuBool>().Value;
            laneE.OnValueChanged     += (sender, args) => lane.EEnabled = args.GetNewValue <MenuBool>().Value;

            var lasthitMenu    = new Menu("Lasthit", "Lasthit");
            var lasthitEnabled = new MenuBool("Enabled", "Enabled");

            lasthitMenu.Add(lasthitEnabled);
            mainmenu.Add(lasthitMenu);
            lasthit.Enabled = lasthitMenu["Enabled"].Enabled;
            lasthitEnabled.OnValueChanged += (sender, args) => lasthit.Enabled = args.GetNewValue <MenuBool>().Value;

            var ksMenu   = new Menu("Killsteal", "Killsteal");
            var ksIgnite = new MenuBool("Ignite", "Ignite");
            var ksSmite  = new MenuBool("Smite", "Smite");
            var ksQ      = new MenuBool("Q", "Q");
            var ksE      = new MenuBool("E", "E");
            var ksR      = new MenuBool("R", "R");

            foreach (var b in new List <MenuBool>
            {
                ksIgnite,
                ksSmite,
                ksQ,
                ksE,
                ksR
            })
            {
                ksMenu.Add(b);
            }
            mainmenu.Add(ksMenu);

            killsteal.IgniteEnabled = ksMenu["Ignite"].Enabled;
            killsteal.SmiteEnabled  = ksMenu["Smite"].Enabled;
            killsteal.QEnabled      = ksMenu["Q"].Enabled;
            killsteal.EEnabled      = ksMenu["E"].Enabled;
            killsteal.REnabled      = ksMenu["R"].Enabled;

            ksIgnite.OnValueChanged += (sender, args) => killsteal.IgniteEnabled = args.GetNewValue <MenuBool>().Value;
            ksSmite.OnValueChanged  += (sender, args) => killsteal.SmiteEnabled = args.GetNewValue <MenuBool>().Value;
            ksQ.OnValueChanged      += (sender, args) => killsteal.QEnabled = args.GetNewValue <MenuBool>().Value;
            ksE.OnValueChanged      += (sender, args) => killsteal.EEnabled = args.GetNewValue <MenuBool>().Value;
            ksR.OnValueChanged      += (sender, args) => killsteal.REnabled = args.GetNewValue <MenuBool>().Value;

            var drawMenu     = new Menu("Draw", "DrawManager");
            var drawSegments = new MenuSlider("Segments", "Segments", 100, 10, 150).SetToolTip("Smoothness of the circles");
            var drawPosition = new MenuBool("Position", "Insec Position");
            var drawQ        = new MenuBool("Q", "Q Range");

            drawMenu.Add(drawSegments);
            drawMenu.Add(drawPosition);
            drawMenu.Add(drawQ);
            mainmenu.Add(drawMenu);

            drawManager.QEnabled        = drawMenu["Q"].Enabled;
            drawManager.SegmentsValue   = drawMenu["Segments"].Value;
            drawManager.PositionEnabled = drawMenu["Position"].Enabled;

            drawSegments.OnValueChanged += (sender, args) => drawManager.SegmentsValue = args.GetNewValue <MenuSlider>().Value;
            drawPosition.OnValueChanged += (sender, args) => drawManager.PositionEnabled = args.GetNewValue <MenuBool>().Value;
            drawQ.OnValueChanged        += (sender, args) => drawManager.QEnabled = args.GetNewValue <MenuBool>().Value;

            Gapcloser.Attach(mainmenu, "Gapcloser");
            var gapcloser = new AntiGapcloser(spellConfig, wardmanager, wardtracker);

            Gapcloser.OnGapcloser += gapcloser.OnGapcloser;

            var manager = new Manager(combo, harass, jungle, lane, lasthit);

            Game.OnUpdate += manager.OnUpdate;
            Game.OnUpdate += killsteal.OnUpdate;

            Global.Orbwalker.PostAttack += manager.PostAttack;

            Render.OnRender  += drawManager.OnRender;
            Render.OnPresent += drawManager.RenerDamage;

            Obj_AI_Base.OnProcessSpellCast += insec.OnProcessSpellCast;
            Obj_AI_Base.OnProcessSpellCast += kickFlash.OnProcessSpellCast;
            Obj_AI_Base.OnProcessSpellCast += spellConfig.OnProcessSpellCast;

            GameObject.OnCreate += wardtracker.OnCreate;
        }
Пример #13
0
        private void GameOnOnUpdate(EventArgs args)
        {
            if (!LeeSinMenu.starComboMenu["starComboKey"].Cast <KeyBind>().CurrentValue)
            {
                errorString = string.Empty;
                return;
            }

            if (target.HasBuff("BlindMonkQOne") && SpellManager.CanCastQ2)
            {
                SpellManager.Q2.Cast();
            }

            if (!hasResources)
            {
                if (!SpellManager.R.IsReady())
                {
                    errorString = "R not ready";
                }
                else if ((!WardManager.CanCastWard || !SpellManager.FlashReady) && !canAllyJump)
                {
                    errorString = "Cannot dash";
                }
                else if (canAllyJump && (!SpellManager.CanCastW1 || me.Mana < 50))
                {
                    errorString = "Cannot jump to ally";
                }

                return;
            }
            else if (!SelectionHandler.LastTargetValid)
            {
                errorString = "Target not selected";
                return;
            }
            else
            {
                errorString = string.Empty;
            }

            Orbwalker.OrbwalkTo(Game.CursorPos);

            if (solution == StarSolutions.None)
            {
                SearchForSolution();
            }
            else
            {
                Core.DelayAction(() =>
                {
                    if (solution != StarSolutions.None)
                    {
                        solution = StarSolutions.None;
                    }
                }, 4000);
            }

            if (CanContinueWith(StarSolutions.Ally))
            {
                if (SpellManager.CanCastW1 && me.Mana >= 50)
                {
                    var ally =
                        EntityManager.Heroes.Allies.Where(
                            x =>
                            x.IsValid && x.Distance(me) <= SpellManager.W1.Range &&
                            x.Distance(target) < SpellManager.R.Range)
                        .OrderBy(x => x.Distance(target))
                        .First();
                    SpellManager.W1.Cast(ally);
                }

                if (target.Distance(me) <= SpellManager.R.Range)
                {
                    SpellManager.R.Cast(target);
                }
            }
            else if (CanContinueWith(StarSolutions.Ward))
            {
                if (canWardJump)
                {
                    var jumpPos = GetJumpPos(true, Enabled(MenuEntry.MovementPrediction)).To3D();
                    WardManager.CastWardTo(jumpPos);
                }

                if (target.Distance(me) <= SpellManager.R.Range)
                {
                    SpellManager.R.Cast(target);
                }
            }
            else if (CanContinueWith(StarSolutions.Flash))
            {
                if (canFlash)
                {
                    SpellManager.Flash.Cast(GetJumpPos(false).To3D());
                }

                if (target.Distance(me) <= SpellManager.R.Range)
                {
                    SpellManager.R.Cast(target);
                }
            }
        }