public static Obj_AI_Base GetKStarget(this Spell.SpellBase spell) { return(spell.IsReady() ? EntityManager.Heroes.Enemies.Where(e => e.IsKillable() && e.IsKillable(spell.Range) && kCore.ks.checkbox(e.ID())) .FirstOrDefault(enemy => spell.GetDamage(enemy) >= Prediction.Health.GetPrediction(enemy, (int)spell.TravelTime(enemy))) : null); }
public static Obj_AI_Base GetJStarget(this Spell.SpellBase spell) { return (EntityManager.MinionsAndMonsters.GetJungleMonsters() .Where(j => j.IsKillable() && kCore.Junglemobs.Contains(j.BaseSkinName) && j.IsKillable(spell.Range) && kCore.ks.checkbox(j.BaseSkinName)) .FirstOrDefault(jmob => spell.GetDamage(jmob) >= Prediction.Health.GetPrediction(jmob, (int)spell.TravelTime(jmob)))); }
public static void DrawSpellDamage(this Spell.SpellBase spell, bool draw = false) { if (draw) { foreach (var enemy in EntityManager.Heroes.Enemies.Where(e => e.IsHPBarRendered && e.IsValidTarget())) { if (enemy != null) { var hpx = enemy.HPBarPosition.X; var hpy = enemy.HPBarPosition.Y; var dmg = (int)spell.GetDamage(enemy); var c = Color.GreenYellow; Drawing.DrawText(hpx + 145, hpy, c, dmg + " / " + (int)enemy.TotalShieldHealth(), 3); } } } }
internal static double GetRealDamage(this Spell.SpellBase spell, Obj_AI_Base target, bool havetoler = false, float tolerDMG = 0) { if (target != null && !target.IsDead && target.Buffs.Any(a => a.Name.ToLower().Contains("kalistaexpungemarker"))) { if (target.HasBuff("KindredRNoDeathBuff")) { return(0); } if (target.HasBuff("UndyingRage") && target.GetBuff("UndyingRage").EndTime - Game.Time > 0.3) { return(0); } if (target.HasBuff("JudicatorIntervention")) { return(0); } if (target.HasBuff("ChronoShift") && target.GetBuff("ChronoShift").EndTime - Game.Time > 0.3) { return(0); } if (target.HasBuff("FioraW")) { return(0); } if (target.HasBuff("ShroudofDarkness")) { return(0); } if (target.HasBuff("SivirShield")) { return(0); } var damage = 0d; damage += spell.IsReady() ? spell.GetDamage(target) : 0d + (havetoler ? tolerDMG : 0) - target.HPRegenRate; if (target.CharData.BaseSkinName == "Morderkaiser") { damage -= target.Mana; } if (ObjectManager.Player.HasBuff("SummonerExhaust")) { damage = damage * 0.6f; } if (target.HasBuff("BlitzcrankManaBarrierCD") && target.HasBuff("ManaBarrier")) { damage -= target.Mana / 2f; } if (target.HasBuff("GarenW")) { damage = damage * 0.7f; } if (target.HasBuff("ferocioushowl")) { damage = damage * 0.7f; } return(damage); } return(0d); }