예제 #1
0
        public static void UpdateTSMode(Menu Config)
        {
            Menu = Config;

            bool Priority = false;

            TargetSelector.TargetingMode mode = TargetSelector.GetTargetingMode();
            switch (Config.Item("Selected Mode").GetValue <StringList>().SelectedIndex)
            {
            case 0:
                mode = TargetSelector.TargetingMode.AutoPriority;
                break;

            case 1:
                mode = TargetSelector.TargetingMode.Closest;
                break;

            case 2:
                mode = TargetSelector.TargetingMode.LessAttack;
                break;

            case 3:
                mode = TargetSelector.TargetingMode.LessCast;
                break;

            case 4:
                mode = TargetSelector.TargetingMode.LowHP;
                break;

            case 5:
                mode = TargetSelector.TargetingMode.MostAD;
                break;

            case 6:
                mode = TargetSelector.TargetingMode.MostAP;
                break;

            case 7:
                mode = TargetSelector.TargetingMode.NearMouse;
                break;

            case 8:
                Priority = true;
                break;
            }
            if (TargetSelector.GetTargetingMode() != mode && Priority == false)
            {
                TargetSelector.SetTargetingMode(mode);
            }

            if (selectedTarget.IsDead && selectedTarget != null)
            {
                selectedTarget = null;
            }
        }
예제 #2
0
        private static void Mode()
        {
            float TSRange = Config.Item("Range").GetValue <Slider>().Value;

            vTargetSelector.SetRange(TSRange);
            var mode = Config.Item("Mode").GetValue <StringList>().SelectedIndex;

            vTargetSelectorStr = "";
            switch (mode)
            {
            case 0:
                vTargetSelector.SetTargetingMode(TargetSelector.TargetingMode.AutoPriority);
                vTargetSelectorStr = "Targetin Mode: Auto Priority";
                break;

            case 1:
                vTargetSelector.SetTargetingMode(TargetSelector.TargetingMode.Closest);
                vTargetSelectorStr = "Targetin Mode: Closest";
                break;

            case 2:
                vTargetSelector.SetTargetingMode(TargetSelector.TargetingMode.LessAttack);
                vTargetSelectorStr = "Targetin Mode: Less Attack";
                break;

            case 3:
                vTargetSelector.SetTargetingMode(TargetSelector.TargetingMode.LessCast);
                vTargetSelectorStr = "Targetin Mode: Less Cast";
                break;

            case 4:
                vTargetSelector.SetTargetingMode(TargetSelector.TargetingMode.LowHP);
                vTargetSelectorStr = "Targetin Mode: Low HP";
                break;

            case 5:
                vTargetSelector.SetTargetingMode(TargetSelector.TargetingMode.MostAD);
                vTargetSelectorStr = "Targetin Mode: Most AD";
                break;

            case 6:
                vTargetSelector.SetTargetingMode(TargetSelector.TargetingMode.MostAP);
                vTargetSelectorStr = "Targetin Mode: Most AP";
                break;

            case 7:
                vTargetSelector.SetTargetingMode(TargetSelector.TargetingMode.NearMouse);
                vTargetSelectorStr = "Targetin Mode: Near Mouse";
                break;
            }
        }
예제 #3
0
        private static void Mode()
        {
            float TSRange = Menu.Item("Range").GetValue <Slider>().Value;

            Chon.SetRange(TSRange);
            var mode = Menu.Item("Mode").GetValue <StringList>().SelectedIndex;

            switch (mode)
            {
            case 0:
                Chon.SetTargetingMode(TargetSelector.TargetingMode.LowHP);
                break;

            case 1:
                Chon.SetTargetingMode(TargetSelector.TargetingMode.NearMouse);
                break;

            case 2:
                Chon.SetTargetingMode(TargetSelector.TargetingMode.MostAD);
                break;

            case 3:
                Chon.SetTargetingMode(TargetSelector.TargetingMode.MostAP);
                break;

            case 4:
                Chon.SetTargetingMode(TargetSelector.TargetingMode.LessAttack);
                break;

            case 5:
                Chon.SetTargetingMode(TargetSelector.TargetingMode.LessCast);
                break;

            case 6:
                Chon.SetTargetingMode(TargetSelector.TargetingMode.Closest);
                break;

            case 7:
                Chon.SetTargetingMode(TargetSelector.TargetingMode.AutoPriority);
                break;
            }
        }
        private static void InternalSetTargetingMode()
        {
            float TSRange = Config.Item("TargetingRange").GetValue <Slider>().Value;

            TS.SetRange(TSRange);
            var mode = Config.Item("TargetingMode").GetValue <StringList>().SelectedIndex;

            switch (mode)
            {
            case 0:
                TS.SetTargetingMode(TargetSelector.TargetingMode.AutoPriority);
                break;

            case 1:
                TS.SetTargetingMode(TargetSelector.TargetingMode.Closest);
                break;

            case 2:
                TS.SetTargetingMode(TargetSelector.TargetingMode.LessAttack);
                break;

            case 3:
                TS.SetTargetingMode(TargetSelector.TargetingMode.LessCast);
                break;

            case 4:
                TS.SetTargetingMode(TargetSelector.TargetingMode.LowHP);
                break;

            case 5:
                TS.SetTargetingMode(TargetSelector.TargetingMode.MostAD);
                break;

            case 6:
                TS.SetTargetingMode(TargetSelector.TargetingMode.MostAP);
                break;

            case 7:
                TS.SetTargetingMode(TargetSelector.TargetingMode.NearMouse);
                break;
            }
        }
예제 #5
0
        private static Obj_AI_Hero GetTarget()
        {
            switch (Config.Item("tsMode").GetValue <StringList>().SelectedIndex)
            {
            case 0:
                selectTarget.SetTargetingMode(TargetSelector.TargetingMode.AutoPriority);
                break;

            case 1:
                selectTarget.SetTargetingMode(TargetSelector.TargetingMode.MostAD);
                break;

            case 2:
                selectTarget.SetTargetingMode(TargetSelector.TargetingMode.MostAP);
                break;

            case 3:
                selectTarget.SetTargetingMode(TargetSelector.TargetingMode.LessAttack);
                break;

            case 4:
                selectTarget.SetTargetingMode(TargetSelector.TargetingMode.LessCast);
                break;

            case 5:
                selectTarget.SetTargetingMode(TargetSelector.TargetingMode.LowHP);
                break;

            case 6:
                selectTarget.SetTargetingMode(TargetSelector.TargetingMode.Closest);
                break;

            case 7:
                selectTarget.SetTargetingMode(TargetSelector.TargetingMode.NearMouse);
                break;
            }
            return(selectTarget.Target);
        }
예제 #6
0
        private void checkAndUse(MItem item, String buff = "", double incDamage = 0)
        {
            if (Config.Item(item.menuVariable) != null)
            {
                // check if is configured to use
                if (Config.Item(item.menuVariable).GetValue <bool>())
                {
                    int incDamagePercent      = (int)(_player.Health / incDamage * 100);
                    int actualHeroHpPercent   = (int)(((_player.Health - incDamage) / _player.MaxHealth) * 100);
                    int actualHeroManaPercent = (int)((_player.Mana / _player.MaxMana) * 100);

                    if (item.type == ItemTypeId.DeffensiveSpell || item.type == ItemTypeId.ManaRegeneratorSpell || item.type == ItemTypeId.PurifierSpell || item.type == ItemTypeId.OffensiveSpell)
                    {
                        var spellSlot = Utility.GetSpellSlot(_player, item.menuVariable);
                        if (spellSlot != SpellSlot.Unknown)
                        {
                            if (_player.SummonerSpellbook.CanUseSpell(spellSlot) == SpellState.Ready)
                            {
                                if (item.type == ItemTypeId.DeffensiveSpell)
                                {
                                    int usePercent = Config.Item(item.menuVariable + "UseOnPercent").GetValue <Slider>().Value;
                                    if (actualHeroHpPercent <= usePercent && playerHit == _player.NetworkId && gotHit)
                                    {
                                        _player.SummonerSpellbook.CastSpell(spellSlot);
                                        gotHit = false;
                                    }
                                }
                                else if (item.type == ItemTypeId.ManaRegeneratorSpell)
                                {
                                    int usePercent = Config.Item(item.menuVariable + "UseOnPercent").GetValue <Slider>().Value;
                                    if (actualHeroManaPercent <= usePercent && !Utility.InFountain())
                                    {
                                        _player.SummonerSpellbook.CastSpell(spellSlot);
                                    }
                                }
                                else if (item.type == ItemTypeId.PurifierSpell)
                                {
                                    if ((Config.Item("defJustOnCombo").GetValue <bool>() && Config.Item("comboModeActive").GetValue <KeyBind>().Active) ||
                                        (!Config.Item("defJustOnCombo").GetValue <bool>()))
                                    {
                                        if (checkCC(_player))
                                        {
                                            _player.SummonerSpellbook.CastSpell(spellSlot);
                                        }
                                    }
                                }
                                else if (item.type == ItemTypeId.OffensiveSpell)
                                {
                                    if (item == ignite)
                                    {
                                        ts.SetRange(item.range);
                                        ts.SetTargetingMode(TargetSelector.TargetingMode.LowHP);
                                        Obj_AI_Hero target = ts.Target;
                                        if (target != null)
                                        {
                                            var   aaspeed = _player.AttackSpeedMod;
                                            float aadmg   = 0;

                                            // attack speed checks
                                            if (aaspeed < 0.8f)
                                            {
                                                aadmg = _player.FlatPhysicalDamageMod * 3;
                                            }
                                            else if (aaspeed > 1f && aaspeed < 1.3f)
                                            {
                                                aadmg = _player.FlatPhysicalDamageMod * 5;
                                            }
                                            else if (aaspeed > 1.3f && aaspeed < 1.5f)
                                            {
                                                aadmg = _player.FlatPhysicalDamageMod * 7;
                                            }
                                            else if (aaspeed > 1.5f && aaspeed < 1.7f)
                                            {
                                                aadmg = _player.FlatPhysicalDamageMod * 9;
                                            }
                                            else if (aaspeed > 2.0f)
                                            {
                                                aadmg = _player.FlatPhysicalDamageMod * 11;
                                            }

                                            // Will calculate for base hp regen, currenthp, etc
                                            float dmg         = (_player.Level * 20) + 50;
                                            float regenpersec = (target.FlatHPRegenMod + (target.HPRegenRate * target.Level));
                                            float dmgafter    = (dmg - ((regenpersec * 5) / 2));

                                            float aaleft = (dmgafter + target.Health / _player.FlatPhysicalDamageMod);
                                            //var pScreen = Drawing.WorldToScreen(target.Position);

                                            if (target.Health < (dmgafter + aadmg) && _player.Distance(target) <= item.range)
                                            {
                                                bool overIgnite = Config.Item("overIgnite").GetValue <bool>();
                                                if ((!overIgnite && !target.HasBuff("summonerdot")) || overIgnite)
                                                {
                                                    _player.SummonerSpellbook.CastSpell(spellSlot, target);
                                                    //Drawing.DrawText(pScreen[0], pScreen[1], System.Drawing.Color.Crimson, "Kill in " + aaleft);
                                                }
                                            }
                                        }
                                    }
                                    else
                                    {
                                        try
                                        {
                                            string[] jungleMinions;
                                            if (Utility.Map.GetMap()._MapType.Equals(Utility.Map.MapType.TwistedTreeline))
                                            {
                                                jungleMinions = new string[] { "TT_Spiderboss", "TT_NWraith", "TT_NGolem", "TT_NWolf" };
                                            }
                                            else
                                            {
                                                jungleMinions = new string[] { "AncientGolem", "GreatWraith", "Wraith", "LizardElder", "Golem", "Worm", "Dragon", "GiantWolf" };
                                            }

                                            var minions = MinionManager.GetMinions(_player.Position, item.range, MinionTypes.All, MinionTeam.Neutral);
                                            if (minions.Count() > 0)
                                            {
                                                int smiteDmg = getSmiteDmg();
                                                foreach (Obj_AI_Base minion in minions)
                                                {
                                                    Boolean b;
                                                    if (Utility.Map.GetMap()._MapType.Equals(Utility.Map.MapType.TwistedTreeline))
                                                    {
                                                        b = minion.Health <= smiteDmg && jungleMinions.Any(name => minion.Name.Substring(0, minion.Name.Length - 5).Equals(name) && Config.Item(name).GetValue <bool>());
                                                    }
                                                    else
                                                    {
                                                        b = minion.Health <= smiteDmg && jungleMinions.Any(name => minion.Name.StartsWith(name) && Config.Item(name).GetValue <bool>());
                                                    }

                                                    if (b)
                                                    {
                                                        _player.SummonerSpellbook.CastSpell(spellSlot, minion);
                                                    }
                                                }
                                            }
                                        }
                                        catch
                                        {
                                            Game.PrintChat("Problem with MasterActivator(Smite).");
                                        }
                                    }
                                }
                            }
                        }
                    }
                    else if (item.type == ItemTypeId.Ability)
                    {
                        try
                        {
                            var spellSlot = Utility.GetSpellSlot(_player, item.name, false);
                            if (spellSlot != SpellSlot.Unknown)
                            {
                                if (_player.Spellbook.CanUseSpell(spellSlot) == SpellState.Ready)
                                {
                                    int minPercent  = Config.Item(item.menuVariable + "MinHpPct").GetValue <Slider>().Value;
                                    int usePercent  = Config.Item(item.menuVariable + "UseOnPercent").GetValue <Slider>().Value;
                                    int manaPercent = Config.Item(item.menuVariable + "UseManaPct").GetValue <Slider>().Value;
                                    if (actualHeroManaPercent > manaPercent && actualHeroHpPercent <= usePercent &&
                                        incDamagePercent >= minPercent && playerHit == _player.NetworkId && gotHit)
                                    {
                                        _player.Spellbook.CastSpell(item.abilitySlot, _player);
                                        gotHit = false;
                                    }
                                }
                            }
                        }
                        catch (Exception e)
                        {
                            //Console.WriteLine(e);
                            Game.PrintChat("Problem with MasterActivator(AutoShield).");
                        }
                    }
                    else
                    {
                        if (Items.HasItem(item.id))
                        {
                            if (Items.CanUseItem(item.id))
                            {
                                if (item.type == ItemTypeId.Offensive)
                                {
                                    if (checkTarget(item.range))
                                    {
                                        int actualTargetHpPercent = (int)((ts.Target.Health / ts.Target.MaxHealth) * 100);
                                        if (checkUsePercent(item, actualTargetHpPercent))
                                        {
                                            useItem(item.id, item.range == 0 ? null : ts.Target);
                                        }
                                    }
                                }
                                else if (item.type == ItemTypeId.HPRegenerator || item.type == ItemTypeId.Deffensive)
                                {
                                    if (checkUsePercent(item, actualHeroHpPercent) && !Utility.InFountain())
                                    {
                                        if ((buff != "" && !checkBuff(buff)) || buff == "")
                                        {
                                            useItem(item.id);
                                        }
                                    }
                                }
                                else if (item.type == ItemTypeId.ManaRegenerator)
                                {
                                    if (checkUsePercent(item, actualHeroManaPercent) && !Utility.InFountain())
                                    {
                                        if ((buff != "" && !checkBuff(buff)) || buff == "")
                                        {
                                            useItem(item.id);
                                        }
                                    }
                                }
                                else if (item.type == ItemTypeId.Buff)
                                {
                                    if (checkTarget(item.range))
                                    {
                                        if (!checkBuff(item.name))
                                        {
                                            useItem(item.id);
                                        }
                                    }
                                    else
                                    {
                                        if (checkBuff(item.name))
                                        {
                                            useItem(item.id);
                                        }
                                    }
                                }
                                else if (item.type == ItemTypeId.Purifier)
                                {
                                    if ((Config.Item("defJustOnCombo").GetValue <bool>() && Config.Item("comboModeActive").GetValue <KeyBind>().Active) ||
                                        (!Config.Item("defJustOnCombo").GetValue <bool>()))
                                    {
                                        if (checkCC(_player))
                                        {
                                            useItem(item.id);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }