internal static void Game_OnUpdate(EventArgs args) { if (Player.IsDead) { return; } if (!Player.IsRecalling() && !Player.InFountain()) { if (Menu.Item("AutoPotion.Use Health Potion").GetValue <bool>()) { if (Player.HealthPercent <= Menu.Item("AutoPotion.ifHealthPercent").GetValue <Slider>().Value) { var healthSlot = GetPotionSlot(PotionType.Health); if (!IsBuffActive(PotionType.Health) && healthSlot != null) { Player.Spellbook.CastSpell(healthSlot.SpellSlot); } } } if (Menu.Item("AutoPotion.Use Mana Potion").GetValue <bool>()) { if (Player.ManaPercent <= Menu.Item("AutoPotion.ifManaPercent").GetValue <Slider>().Value) { var manaSlot = GetPotionSlot(PotionType.Mana); if (!IsBuffActive(PotionType.Mana) && manaSlot != null) { Player.Spellbook.CastSpell(manaSlot.SpellSlot); } } } } #region RS if (Menu.Item("OnAttack.RS").GetValue <bool>()) { OnAttack.setRSmiteSlot(); //Red Smite } #endregion #region BS if (Menu.Item("Killsteal.BS").GetValue <bool>() && Killsteal.smiteSlot != SpellSlot.Unknown) { Killsteal.setBSmiteSlot(); var ts = ObjectManager.Get <Obj_AI_Hero>().Where(f => !f.IsAlly && !f.IsDead && Player.Distance(f, false) <= Killsteal.smrange); if (ts == null) { return; } float dmg = Killsteal.BSDamage(); foreach (var t in ts) { if (AIO_Func.isKillable(t, dmg)) { if (Killsteal.smiteSlot.IsReady() && Killsteal.BS.Slot == Killsteal.smiteSlot) { Player.Spellbook.CastSpell(Killsteal.smiteSlot, t); } else { return; } } } } #endregion }
internal static float pastTime = 0; //버프 체크시 랙 덜걸리도록.. internal static void Game_OnUpdate(EventArgs args) { if (Player.IsDead) { return; } if (!Player.IsRecalling() && !Player.InFountain()) { if (Menu.Item("AutoPotion.Use Health Potion").GetValue <bool>()) { if (AIO_Func.getHealthPercent(Player) <= Menu.Item("AutoPotion.ifHealthPercent").GetValue <Slider>().Value) { var healthSlot = GetPotionSlot(PotionType.Health); if (!IsBuffActive(PotionType.Health) && healthSlot != null) { Player.Spellbook.CastSpell(healthSlot.SpellSlot); } } } if (Menu.Item("AutoPotion.Use Mana Potion").GetValue <bool>()) { if (AIO_Func.getManaPercent(Player) <= Menu.Item("AutoPotion.ifManaPercent").GetValue <Slider>().Value) { var manaSlot = GetPotionSlot(PotionType.Mana); if (!IsBuffActive(PotionType.Mana) && manaSlot != null) { Player.Spellbook.CastSpell(manaSlot.SpellSlot); } } } } if (Menu.Item("Misc.BF").GetValue <bool>() && Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo) // 개발 편의를 위해 추가한 버프 체크기. { if (Environment.TickCount - pastTime > 500) //랙 줄이려고 추가함 { pastTime = Environment.TickCount; } if (Environment.TickCount - pastTime > 499) { var Target = TargetSelector.GetTarget(1000, TargetSelector.DamageType.Physical); if (Target == null) { foreach (var buff in Player.Buffs) { AIO_Func.sendDebugMsg("PLAYER : " + buff.Name); } } else { foreach (var buff in Player.Buffs) { AIO_Func.sendDebugMsg("PLAYER : " + buff.Name); } foreach (var buff in Target.Buffs) { AIO_Func.sendDebugMsg("TARGET : " + buff.Name); } } } } #region RS if (Menu.Item("OnAttack.RS").GetValue <bool>()) { OnAttack.setRSmiteSlot(); //Red Smite } #endregion #region BS if (Menu.Item("Killsteal.BS").GetValue <bool>()) { Killsteal.setBSmiteSlot(); var ts = ObjectManager.Get <Obj_AI_Hero>().Where(f => !f.IsAlly && !f.IsDead && Player.Distance(f, false) <= Killsteal.smrange); if (ts == null) { return; } float dmg = Killsteal.BSDamage(); foreach (var t in ts) { if (AIO_Func.isKillable(t, dmg)) { if (Killsteal.smiteSlot.IsReady() && Killsteal.BS.Slot == Killsteal.smiteSlot) { Player.Spellbook.CastSpell(Killsteal.smiteSlot, t); } else { return; } } } } #endregion #region AA if (AIO_Func.AfterAttack() && AfterAttack.AIO) { var target = TargetSelector.GetTarget(Orbwalking.GetRealAutoAttackRange(Player) + 50, TargetSelector.DamageType.Physical, true); var itemone = AfterAttack.itemsList.FirstOrDefault(x => Items.CanUseItem((int)x.Id) && target.IsValidTarget(x.Range) && Menu.Item("AfterAttack.Use " + x.Id.ToString()).GetValue <bool>()); if (Menu.Item("Misc.Cb").GetValue <bool>() && Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo || Menu.Item("Misc.Hr").GetValue <bool>() && Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Mixed) { if (Menu.Item("AfterAttack.SF").GetValue <bool>()) { if (AfterAttack.SkillCasted) { if (itemone.isTargeted) { Items.UseItem(itemone.Id, (Obj_AI_Hero)target); } else { Items.UseItem(itemone.Id); } } } else { if (itemone.isTargeted) { Items.UseItem(itemone.Id, (Obj_AI_Hero)target); } else { Items.UseItem(itemone.Id); } } } } #endregion }