private bool checkBuffs(Obj_AI_Base hero, float distance) { var stun = hero.Buffs.Where( buff => buff.Type == BuffType.Snare || buff.Type == BuffType.Stun || buff.Type == BuffType.Suppression || buff.Type == BuffType.Knockup) .OrderByDescending(buff => CombatHelper.GetBuffTime(buff)) .FirstOrDefault(); if (stun != null) { if (CombatHelper.GetBuffTime(stun) > distance / R.Speed) { return(true); } } return(false); }
private static double getEDamage(AIHeroClient target, bool bufftime = false) { var spins = 0d; if (bufftime) { spins = CombatHelper.GetBuffTime(player.GetBuff("GarenE")) * GetSpins() / 3; } else { spins = GetSpins(); } var dmg = (baseEDamage[E.Level - 1] + bonusEDamage[E.Level - 1] / 100 * player.TotalAttackDamage) * spins; var bonus = target.HasBuff("garenpassiveenemytarget") ? target.MaxHealth / 100f * spins : 0; if (ObjectManager.Get <Obj_AI_Base>().Count(o => o.LSIsValidTarget() && o.LSDistance(target) < 650) == 0) { return(player.CalcDamage(target, DamageType.Physical, dmg) * 1.33 + bonus); } return(player.CalcDamage(target, DamageType.Physical, dmg) + bonus); }
private void CastW() { if (justW) { return; } var allyW = ObjectManager.Get <Obj_AI_Base>().FirstOrDefault(o => o.HasBuff("mordekaisercreepingdeath")); if (allyW != null) { if (allyW.HealthPercent < 20 || player.HealthPercent < 20 || CombatHelper.GetBuffTime(allyW.GetBuff("mordekaisercreepingdeath")) < 0.5f) { if ((allyW.CountEnemiesInRange(250) + Environment.Minion.countMinionsInrange(allyW.Position, 250f) / 2f >= 1 || player.CountEnemiesInRange(250f) + Environment.Minion.countMinionsInrange(player.Position, 250f) / 2f >= 1)) { W.Cast(config.Item("packets").GetValue <bool>()); } } } else { Obj_AI_Base wTarget = Environment.Hero.mostEnemyAtFriend(player, W.Range, 250f); if (MordeGhost) { var ghost = ObjectManager.Get <Obj_AI_Minion>().FirstOrDefault(m => m.HasBuff("mordekaisercotgpetbuff2")); if (wTarget == null || ghost.CountEnemiesInRange(250f) > wTarget.CountEnemiesInRange(250f)) { wTarget = ghost; } } if (wTarget != null && (wTarget.CountEnemiesInRange(250) > 0 || player.CountEnemiesInRange(250) > 0)) { W.Cast(wTarget, config.Item("packets").GetValue <bool>()); } } }