public double GetDamageAfterTime(Obj_AI_Base target, BuffInstance buff, float time) { var damage = GetdTotalBuffDamage(target, buff); var nextStackCount = 1 * Math.Max(1, time); if (Stacks != Time && Stacks < Time) { if (buff.EndTime - buff.StartTime - Time + time > CombatHelper.GetBuffTime(buff)) { nextStackCount = 1; } else { nextStackCount = 0; } } if (buff.Name == "tristanaechargesound" && buff.Count >= 3) { nextStackCount = 1; } return(damage / Stacks * nextStackCount); }
public static void UseItems(Obj_AI_Hero target, Menu config, float comboDmg = 0f, bool cleanseSpell = false) { if (config.Item("hyd").GetValue <bool>() && player.ChampionName != "Renekton") { castHydra(target); } if (config.Item("hyd").GetValue <bool>()) { hydraTarget = target; useHydra = true; } else { useHydra = false; } if (config.Item("ran").GetValue <bool>() && Items.HasItem(randuins.Id) && Items.CanUseItem(randuins.Id)) { if (target != null && player.Distance(target) < randuins.Range && player.CountEnemiesInRange(randuins.Range) >= config.Item("ranmin").GetValue <Slider>().Value) { Items.UseItem(randuins.Id); } } /* * if (config.Item("Muramana").GetValue<bool>() && * ((!MuramanaEnabled && config.Item("MuramanaMinmana").GetValue<Slider>().Value < player.ManaPercent) || * (MuramanaEnabled && config.Item("MuramanaMinmana").GetValue<Slider>().Value > player.ManaPercent))) * { * if (Muramana.IsOwned() && Muramana.IsReady()) * { * Muramana.Cast(); * } * if (Muramana2.IsOwned() && Muramana2.IsReady()) * { * Muramana2.Cast(); * } * } * MuramanaTime = System.Environment.TickCount; */ if (config.Item("you").GetValue <bool>() && Items.HasItem(youmuu.Id) && Items.CanUseItem(youmuu.Id) && target != null && player.Distance(target) < player.AttackRange + 50 && target.HealthPercent < 65) { youmuu.Cast(); } if (config.Item("Zhonya").GetValue <bool>()) { if (((config.Item("Zhonyadmg").GetValue <Slider>().Value / 100f * player.Health <= Program.IncDamages.GetAllyData(player.NetworkId).DamageTaken || Program.IncDamages.GetAllyData(player.NetworkId).DamageTaken > player.Health) || (Danger() && player.HealthPercent < 30)) && player.IsValidTarget(10, false)) { if (Items.HasItem(Zhonya.Id) && Items.CanUseItem(Zhonya.Id)) { Zhonya.Cast(); return; } if (Items.HasItem(Wooglet.Id) && Items.CanUseItem(Wooglet.Id)) { Wooglet.Cast(); return; } } } if (config.Item("Seraph").GetValue <bool>()) { if (((config.Item("SeraphdmgHP").GetValue <Slider>().Value / 100f * player.Health <= Program.IncDamages.GetAllyData(player.NetworkId).DamageTaken || Program.IncDamages.GetAllyData(player.NetworkId).DamageTaken > player.Health) || (config.Item("SeraphdmgSh").GetValue <Slider>().Value / 100f * (150 + player.Mana * 0.2f) <= Program.IncDamages.GetAllyData(player.NetworkId).DamageTaken)) || Danger()) { if (Items.HasItem(Seraph.Id) && Items.CanUseItem(Seraph.Id)) { Seraph.Cast(); } if (Items.HasItem(SeraphDom.Id) && Items.CanUseItem(SeraphDom.Id)) { SeraphDom.Cast(); } } } if (Items.HasItem(solari.Id) && Items.CanUseItem(solari.Id) && config.Item("solari").GetValue <bool>()) { if ((config.Item("solariminally").GetValue <Slider>().Value <= player.CountAlliesInRange(solari.Range) && config.Item("solariminenemy").GetValue <Slider>().Value <= player.CountEnemiesInRange(solari.Range)) || ObjectManager.Get <Obj_AI_Hero>() .FirstOrDefault( h => h.IsAlly && !h.IsDead && solari.IsInRange(h) && CombatHelper.CheckCriticalBuffs(h)) != null || (Program.IncDamages.IncomingDamagesAlly.Any( a => a.Hero.HealthPercent < 50 && (a.DamageTaken > 150 || a.DamageTaken > a.Hero.Health)))) { solari.Cast(); } } if (config.Item("protoBelt").GetValue <bool>() && target != null && player.Distance(target) < 750) { if (config.Item("protoBeltEHealth").GetValue <Slider>().Value > target.HealthPercent && (player.Distance(target) > 150 || player.Distance(target) > Orbwalking.GetRealAutoAttackRange(target))) { if (Items.HasItem(ProtoBelt.Id) && Items.CanUseItem(ProtoBelt.Id)) { var pred = Prediction.GetPrediction( target, 0.25f, 100, 2000, new[] { CollisionableObjects.Heroes, CollisionableObjects.Minions, CollisionableObjects.Walls, CollisionableObjects.YasuoWall }); if (pred.Hitchance >= HitChance.High) { ProtoBelt.Cast(pred.CastPosition); } } } } if (config.Item("glp").GetValue <bool>() && target != null && player.Distance(target) < 650) { if (config.Item("glpEHealth").GetValue <Slider>().Value > target.HealthPercent) { if (Items.HasItem(GLP.Id) && Items.CanUseItem(GLP.Id)) { var pred = Prediction.GetPrediction( target, 0.25f, 100, 1500, new[] { CollisionableObjects.Heroes, CollisionableObjects.YasuoWall }); if (pred.Hitchance >= HitChance.High) { GLP.Cast(pred.CastPosition); } } } } if (config.Item("QSSEnabled").GetValue <bool>()) { UseCleanse(config, cleanseSpell); } }