/// <summary> /// PrivateEvents Initialization /// </summary> private void InitPrivateEvents() { Utility.DelayAction.Add(250, () => { _spells.Add(Q); _spells.Add(W); _spells.Add(E); _spells.Add(R); TargetSelector.SetRange(_spells.Where(s => s.Range != float.MaxValue).Select(s => s.Range).Max()); }); Game.OnGameUpdate += args => { ActiveMode = Orbwalker.ActiveMode; if (Config.Item("visit").GetValue <bool>()) { Process.Start("http://www.joduska.me/forum/topic/170-aio-support-is-easy/"); Config.Item("visit").SetValue(false); } }; Orbwalking.BeforeAttack += args => { if (args.Target.IsValid <Obj_AI_Minion>() && !AttackMinion) { args.Process = false; } if (args.Target.IsValid <Obj_AI_Hero>() && !ConfigValue <bool>("AttackChampions") && Orbwalker.ActiveMode != Orbwalking.OrbwalkingMode.None) { args.Process = false; } }; Drawing.OnDraw += args => { if (Player.IsDead) { return; } if (Target != null && ConfigValue <Circle>("Target").Active) { Utility.DrawCircle(Target.Position, 120, ConfigValue <Circle>("Target").Color); } foreach (var spell in _spells.Where(s => s != null)) { var menuItem = ConfigValue <Circle>(spell.Slot + "Range"); if (menuItem.Active && spell.Level > 0) { Utility.DrawCircle(Player.Position, spell.Range + Player.BoundingRadius, spell.IsReady() ? menuItem.Color : Color.FromArgb(150, Color.Red)); } } }; }
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; } }
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; } }
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); } } } } } } } } }
/// <summary> /// PrivateEvents Initialization /// </summary> private void InitPrivateEvents() { Utility.DelayAction.Add(500, () => { try { _spells.Add(Q); _spells.Add(W); _spells.Add(E); _spells.Add(R); TargetSelector.SetRange(_spells.Where(s => s.Range != float.MaxValue).Select(s => s.Range).Max() + 500); } catch (Exception e) { Console.WriteLine(e); } }); Game.OnGameUpdate += args => { try { ActiveMode = Orbwalker.ActiveMode; if (Config.Item("visit").GetValue <bool>()) { Process.Start("http://www.joduska.me/forum/topic/170-aio-support-is-easy/"); Config.Item("visit").SetValue(false); } } catch (Exception e) { Console.WriteLine(e); } }; Orbwalking.BeforeAttack += args => { try { if (args.Target.IsValid <Obj_AI_Minion>() && Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Mixed) { switch (ConfigValue <StringList>("AttackMinions").SelectedIndex) { case 0: // Smart args.Process = AttackMinion; break; case 1: // Never args.Process = false; break; } } if (args.Target.IsValid <Obj_AI_Hero>() && !ConfigValue <bool>("AttackChampions") && Orbwalker.ActiveMode != Orbwalking.OrbwalkingMode.None) { args.Process = false; } } catch (Exception e) { Console.WriteLine(e); } }; Drawing.OnDraw += args => { try { if (Player.IsDead) { return; } if (Target != null && ConfigValue <Circle>("Target").Active) { Utility.DrawCircle(Target.Position, 125, ConfigValue <Circle>("Target").Color); } foreach (var spell in _spells.Where(s => s != null)) { var menuItem = ConfigValue <Circle>(spell.Slot + "Range"); if (menuItem.Active && spell.Level > 0) { Utility.DrawCircle(Player.Position, spell.Range, spell.IsReady() ? menuItem.Color : Color.FromArgb(150, Color.Red)); } } } catch (Exception e) { Console.WriteLine(e); } }; Game.OnGameProcessPacket += args => { try { if (args.PacketData[0] != Packet.MultiPacket.Header || args.PacketData[5] != Packet.MultiPacket.OnAttack.SubHeader) { return; } var basePacket = Packet.MultiPacket.DecodeHeader(args.PacketData); var attackPacket = Packet.MultiPacket.OnAttack.Decoded(args.PacketData); var caster = ObjectManager.GetUnitByNetworkId <GameObject>(basePacket.NetworkId) as Obj_AI_Base; var target = ObjectManager.GetUnitByNetworkId <GameObject>(attackPacket.TargetNetworkId) as Obj_AI_Base; if (!caster.IsValid <Obj_AI_Hero>() || caster == null || caster.IsAlly) { return; } if (BeforeEnemyAttack != null) { BeforeEnemyAttack(new BeforeEnemyAttackEventArgs { Caster = caster, Target = target, Position = attackPacket.Position, Type = attackPacket.Type }); } } catch (Exception e) { Console.WriteLine(e); } }; }
public static void setRange(float range) { TargetSelector.SetRange(range); }