Example #1
0
        private static bool DontCast(Obj_AI_Base target)
        {
            // kindred r
            if (target.HasBuff("KindredRNoDeathBuff"))
            {
                return(true);
            }

            // tryndamere r
            if (target.HasBuff("UndyingRage") && target.GetBuff("UndyingRage").EndTime - Game.Time > 0.3)
            {
                return(true);
            }

            // kayle r
            if (target.HasBuff("JudicatorIntervention"))
            {
                return(true);
            }

            // zilean r
            if (target.HasBuff("ChronoShift") && target.GetBuff("ChronoShift").EndTime - Game.Time > 0.3)
            {
                return(true);
            }

            // fiora w
            if (target.HasBuff("FioraW"))
            {
                return(true);
            }

            return(false);
        }
Example #2
0
        public static bool CheckTarget(Obj_AI_Base target, float range = float.MaxValue)
        {
            if (target == null)
            {
                return(false);
            }

            if (target.DistanceToPlayer() > range)
            {
                return(false);
            }

            if (target.HasBuff("KindredRNoDeathBuff"))
            {
                return(false);
            }

            if (target.HasBuff("UndyingRage") && target.GetBuff("UndyingRage").EndTime - Game.Time > 0.3)
            {
                return(false);
            }

            if (target.HasBuff("JudicatorIntervention"))
            {
                return(false);
            }

            if (target.HasBuff("ChronoShift") && target.GetBuff("ChronoShift").EndTime - Game.Time > 0.3)
            {
                return(false);
            }

            return(!target.HasBuff("FioraW"));
        }
Example #3
0
        internal static bool IsUnKillable(this Obj_AI_Base target)
        {
            if (target == null || target.IsDead || target.Health <= 0)
            {
                return(true);
            }

            if (target.HasBuff("KindredRNoDeathBuff"))
            {
                return(true);
            }

            if (target.HasBuff("UndyingRage") && target.GetBuff("UndyingRage").EndTime - Game.Time > 0.3 &&
                target.Health <= target.MaxHealth * 0.10f)
            {
                return(true);
            }

            if (target.HasBuff("JudicatorIntervention"))
            {
                return(true);
            }

            if (target.HasBuff("ChronoShift") && target.GetBuff("ChronoShift").EndTime - Game.Time > 0.3 &&
                target.Health <= target.MaxHealth * 0.10f)
            {
                return(true);
            }

            if (target.HasBuff("VladimirSanguinePool"))
            {
                return(true);
            }

            if (target.HasBuff("ShroudofDarkness"))
            {
                return(true);
            }

            if (target.HasBuff("SivirShield"))
            {
                return(true);
            }

            if (target.HasBuff("itemmagekillerveil"))
            {
                return(true);
            }

            return(target.HasBuff("FioraW"));
        }
Example #4
0
        public static bool Check(this Obj_AI_Base target, float range = float.MaxValue)
        {
            if (target == null || target.IsDead || target.Health <= 0)
            {
                return(false);
            }

            if (target.Distance(ObjectManager.Player) > range)
            {
                return(false);
            }

            if (target.HasBuff("KindredRNoDeathBuff"))
            {
                return(false);
            }

            if (target.HasBuff("UndyingRage") && target.GetBuff("UndyingRage").EndTime - Game.Time > 0.3 && target.Health <= target.MaxHealth * 0.10f)
            {
                return(false);
            }

            if (target.HasBuff("JudicatorIntervention"))
            {
                return(false);
            }

            if (target.HasBuff("ChronoShift") && target.GetBuff("ChronoShift").EndTime - Game.Time > 0.3 && target.Health <= target.MaxHealth * 0.10f)
            {
                return(false);
            }

            if (target.HasBuff("ShroudofDarkness"))
            {
                return(false);
            }

            if (target.HasBuff("SivirShield"))
            {
                return(false);
            }

            if (target.HasBuff("itemmagekillerveil"))
            {
                return(false);
            }

            return(!target.HasBuff("FioraW"));
        }
Example #5
0
        public float GetRemainingCassDamage(Obj_AI_Base target)
        {
            var buff = target.GetBuff("cassiopeianoxiousblastpoison");
            float damage = 0;
            if (buff != null)
                damage += (float)(((int)(buff.EndTime - Game.Time)) * (ObjectManager.Player.GetSpellDamage(target, SpellSlot.Q) / 3));

            buff = target.GetBuff("cassiopeiamiasmapoison");
            if (buff != null)
            {
                damage += (float)(((int)(buff.EndTime - Game.Time)) * (ObjectManager.Player.GetSpellDamage(target, SpellSlot.W)));
            }

            return damage;
        }
Example #6
0
        private static float EDmg(Obj_AI_Base hero)
        {
            if (!hero.HasBuff("tristanaechargesound") || !Root.Item("efinish").GetValue <bool>())
            {
                return(0f);
            }

            var b = hero.HasBuff("tristanaecharge") ? hero.GetBuff("tristanaecharge").Count + 1 : 1;

            if (b < Root.Item("mine").GetValue <Slider>().Value)
            {
                return(0f);
            }

            var physdmg = Player.CalcDamage(hero, Damage.DamageType.Physical,
                                            new[] { 47, 57, 70, 80, 90 }[E.Level - 1]  +
                                            (new[] { 0.5, 0.65, 0.80, 0.95, 1.1 }[E.Level - 1] *Player.FlatPhysicalDamageMod));

            var physbonus = Player.CalcDamage(hero, Damage.DamageType.Physical,
                                              new[] { 14.1, 17.1, 21, 24, 27 }[E.Level - 1] +
                                              (new[] { 0.15, 0.195, 0.24, 0.285, 0.33 }[E.Level - 1] *Player.FlatPhysicalDamageMod));


            return((float)(physdmg + (physbonus * b)));
        }
Example #7
0
        Obj_AI_Base GetLastQBuffEnemyObject()
        {
            var currentEnemyWithQBuff = ObjectManager.Get <Obj_AI_Base>()
                                        .FirstOrDefault(x => x.IsEnemy && x.IsValid && x.HasBuff("BlindMonkQOne"));

            if (currentEnemyWithQBuff != null)
            {
                lastEnemyWithQBuff_object = currentEnemyWithQBuff;
                QbuffEndTime_object       = lastEnemyWithQBuff_object.GetBuff("BlindMonkQOne").EndTime;
            }

            if (extentedQ_object && lastEnemyWithQBuff_object != null &&
                lastEnemyWithQBuff_object.Distance(ObjectManager.Player) <= 80)
            {
                QbuffEndTime_object = 0;
            }

            if (lastEnemyWithQBuff_object != null && Game.Time >= QbuffEndTime_object)
            {
                lastEnemyWithQBuff_object = null;
                extentedQ_object          = false;
            }

            return(lastEnemyWithQBuff_object);
        }
Example #8
0
        private float GetComboDamage(Obj_AI_Base enemy)
        {
            float damage = 0;

            if (!ObjectManager.Player.Spellbook.IsAutoAttacking)
            {
                damage += (float)ObjectManager.Player.GetAutoAttackDamage(enemy, true);
            }

            var buff = enemy.GetBuff("vaynesilvereddebuff");

            if (buff != null)
            {
                if (buff.Caster.IsMe)
                {
                    if (buff.Count == 2)
                    {
                        damage += _w.GetDamage(enemy) + (float)ObjectManager.Player.GetAutoAttackDamage(enemy);
                    }
                }
            }

            if (_q.IsReadyPerfectly())
            {
                damage += _q.GetDamage(enemy) + (float)ObjectManager.Player.GetAutoAttackDamage(enemy);
            }

            if (ObjectManager.Player.HasBuff("vaynetumblebonus"))
            {
                damage += _q.GetDamage(enemy) + (float)ObjectManager.Player.GetAutoAttackDamage(enemy);
            }

            return(0);
        }
Example #9
0
 private static bool isValidAATarget(this Obj_AI_Base unit, bool meleepred = false)
 {
     if (unit.IsDead || unit.IsAlly)
     {
         return(false);
     }
     if (unit.HasBuff("JudicatorIntervention") && unit.GetBuff("JudicatorIntervention").EndTime < Game.Time + MissileHitTime(unit))             // Kayle R Buff
     {
         return(false);
     }
     if (unit.HasBuff("Chronoshift") && unit.GetBuff("Chronoshift").EndTime < Game.Time + MissileHitTime(unit))             // Zilean R Buff
     {
         return(false);
     }
     if (unit.HasBuff("FioraW") && unit.GetBuff("FioraW").EndTime < Game.Time + MissileHitTime(unit))             // Fiora W AttackReflect
     {
         return(false);
     }
     if (Me.HasBuffOfType(BuffType.Blind) && Me.Hero == Champion.Caitlyn && !Me.HasBuff("caitlynheadshot"))             // not shot while blind and Headshot is ready
     {
         return(false);
     }
     if (unit.Name == "WardCorpse" || unit.CharData.BaseSkinName == "jarvanivstandard")
     {
         return(false);
     }
     if (meleepred)
     {
         if (!(unit.IsValidTarget(99999, true) && Game.CursorPos.Distance(unit) <= InteractRange))
         {
             return(false);
         }
     }
     else
     {
         var attackrange = Me.AttackRange + Me.BoundingRadius + unit.BoundingRadius;
         if (Me.Hero == Champion.Caitlyn && unit.HasBuff("caitlynyordletrapinternal"))
         {
             attackrange += 650;
         }
         if (!unit.IsValidTarget(attackrange, true))
         {
             return(false);
         }
     }
     return(true);
 }
Example #10
0
        public static bool CanRock(Obj_AI_Base target)
        {
            int state = GetPassiveState(target);

            if (!WaitPassive)
            {
                return(true);
            }
            if (state == 2)
            {
                return(true);
            }
            if (GetDamage(target) >= target.Health)
            {
                return(true);
            }
            if (R.Instance.Name == RRName && R.Instance.Level >= 1)
            {
                return(true);
            }
            if (PassiveCDObjects.Any(x => x.Position.Distance(target.Position) <= 20))
            {
                return(true);
            }
            if (target.HasBuff("LeblancE") && state == 1)
            {
                var buffE = target.GetBuff("LeblancE");
                var buffP = target.GetBuff("LeblancPMark");
                if (buffP.StartTime * 1000 + 1495 <= buffE.StartTime * 1000 + 1500)
                {
                    return(true);
                }
            }
            if (WaitQTarget != null && WaitQTarget.NetworkId == target.NetworkId && state == 0)
            {
                return(false);
            }
            if (LastWPos.IsValid() && LastWPos.Distance(target.Position) <= 350 && Environment.TickCount - LastW <= 1000 + Game.Ping && state == 0)
            {
                return(false);
            }
            if (state == 1)
            {
                return(false);
            }
            return(true);
        }
Example #11
0
 public static float PassiveTime(Obj_AI_Base target)
 {
     if (target.HasBuff("twitchdeadlyvenom"))
     {
         return Math.Max(0, target.GetBuff("twitchdeadlyvenom").EndTime) - Game.Time;
     }
     return 0;
 }
Example #12
0
 public static float RTime(Obj_AI_Base target)
 {
     if (target.HasBuff("TwitchFullAutomatic"))
     {
         return(Math.Max(0, target.GetBuff("TwitchFullAutomatic").EndTime) - Game.Time);
     }
     return(0);
 }
Example #13
0
 public static float QTime(Obj_AI_Base target)
 {
     if (target.HasBuff("TwitchHideInShadows"))
     {
         return(Math.Max(0, target.GetBuff("TwitchHideInShadows").EndTime) - Game.Time);
     }
     return(0);
 }
Example #14
0
 private static float RTime(Obj_AI_Base target)
 {
     if (target.HasBuff("bantamtrapslow"))
     {
         return(Math.Max(0, target.GetBuff("bantamtrapslow").EndTime) - Game.Time);
     }
     return(0);
 }
Example #15
0
 public static float ETime(Obj_AI_Base target)
 {
     if (target.HasBuff("HecarimRamp"))
     {
         return(Math.Max(0, target.GetBuff("HecarimRamp").EndTime) - Game.Time);
     }
     return(0);
 }
Example #16
0
 public static float ETime(Obj_AI_Base target)
 {
     if (target.HasBuff("JudicatorRighteousFury"))
     {
         return(Math.Max(0, target.GetBuff("JudicatorRighteousFury").EndTime) - Game.Time);
     }
     return(0);
 }
Example #17
0
 private static float EDotTime(Obj_AI_Base target)
 {
     if (target.HasBuff("toxicshotparticle"))
     {
         return(Math.Max(0, target.GetBuff("toxicshotparticle").EndTime) - Game.Time);
     }
     return(0);
 }
Example #18
0
 public static float PassiveTime(Obj_AI_Base target)
 {
     if (target.HasBuff("twitchdeadlyvenom"))
     {
         return(Math.Max(0, target.GetBuff("twitchdeadlyvenom").EndTime) - Game.Time);
     }
     return(0);
 }
Example #19
0
 public static float RTime(Obj_AI_Base target)
 {
     if (target.HasBuff("Undying Rage"))
     {
         return(Math.Max(0, target.GetBuff("Undying Rage").EndTime) - Game.Time);
     }
     return(0);
 }
Example #20
0
        /// <summary>
        ///     Amplifies the basic attack.
        /// </summary>
        /// <param name="source">The source.</param>
        /// <param name="target">The target.</param>
        /// <returns>System.Double.</returns>
        internal static double AmplifyAuto(this Obj_AI_Base source, Obj_AI_Base target)
        {
            double dmg = 0;

            var aiHero = source as Obj_AI_Hero;

            if (aiHero != null)
            {
                if (source.HasBuff("sheen"))
                {
                    dmg +=
                        source.CalculateDamage(target, DamageType.Physical,
                                               1.0 * source.FlatPhysicalDamageMod + source.BaseAttackDamage);
                }

                if (source.HasBuff("lichbane"))
                {
                    dmg +=
                        source.CalculateDamage(target, DamageType.Magical,
                                               (0.75 * source.FlatPhysicalDamageMod + source.BaseAttackDamage) +
                                               (0.50 * source.FlatMagicDamageMod));
                }

                if (source.HasBuff("itemdisknighstalkerdamageproc"))
                {
                    dmg += source.CalculateDamage(target, DamageType.Physical, 50 + (15 * source.Level));
                }

                if (source.HasBuff("itemstatikshankcharge") && source.GetBuff("itemstatikshankcharge").Count == 100)
                {
                    return((int)source.CalculateDamage(target, DamageType.Physical,
                                                       new[] { 62, 120, 200, 200 }[Math.Min(18, source.Level) / 6]));
                }

                foreach (var data in ZLib.CachedSpells.Where(x => x.ChampionName.ToLower() == aiHero.ChampionName.ToLower()))
                {
                    if (aiHero.HasBuff(data.SpellName.ToLower()))
                    {
                        if (data.BasicAttackAmplifier)
                        {
                            dmg += aiHero.GetSpellDamage(target, data.Slot);
                        }
                    }
                    else if (aiHero.Buffs.Any(x => x.IsActive && x.IsValid && x.Name.ToLower().Contains(data.SpellName.ToLower())))
                    {
                        if (data.BasicAttackAmplifier)
                        {
                            dmg += aiHero.GetSpellDamage(target, data.Slot);
                        }
                    }
                }

                return(dmg);
            }

            return(dmg);
        }
Example #21
0
        public float GetRemainingCassDamage(Obj_AI_Base target)
        {
            var   buff   = target.GetBuff("cassiopeianoxiousblastpoison");
            float damage = 0;

            if (buff != null)
            {
                damage += (float)(((int)(buff.EndTime - Game.Time)) * (ObjectManager.Player.GetSpellDamage(target, SpellSlot.Q) / 3));
            }

            buff = target.GetBuff("cassiopeiamiasmapoison");
            if (buff != null)
            {
                damage += (float)(((int)(buff.EndTime - Game.Time)) * (ObjectManager.Player.GetSpellDamage(target, SpellSlot.W)));
            }

            return(damage);
        }
Example #22
0
        public static bool IsUnKillable(this Obj_AI_Base target)
        {
            if (target == null)
            {
                return(true);
            }

            if (target.HasBuff("KindredRNoDeathBuff"))
            {
                return(true);
            }

            if (target.HasBuff("UndyingRage") && target.GetBuff("UndyingRage").EndTime - Game.Time > 0.3)
            {
                return(true);
            }

            if (target.HasBuff("JudicatorIntervention"))
            {
                return(true);
            }

            if (target.HasBuff("ChronoShift") && target.GetBuff("ChronoShift").EndTime - Game.Time > 0.3)
            {
                return(true);
            }

            if (target.HasBuff("ShroudofDarkness"))
            {
                return(true);
            }

            if (target.HasBuff("SivirShield"))
            {
                return(true);
            }

            if (target.HasBuff("itemmagekillerveil"))
            {
                return(true);
            }

            return(target.HasBuff("FioraW"));
        }
Example #23
0
        public static float GetAutoAttackDamageOverride(this Obj_AI_Base Attacker, Obj_AI_Base Target, bool IncludePassive)
        {
            // in case of Bugs or not updated stuff inside the SDK
            if (Attacker != null && Target != null && Attacker.Type == GameObjectType.AIHeroClient)
            {
                var attacker = (AIHeroClient)Attacker;
                switch (attacker.Hero)
                {
                case Champion.MissFortune:
                    switch (Target.Type)
                    {
                    case GameObjectType.AIHeroClient:
                        return(Attacker.GetAutoAttackDamage(Target, IncludePassive) +
                               Attacker.CalculateDamageOnUnit(Target, DamageType.Physical,
                                                              Attacker.BaseAttackDamage * (0.5f + (0.5f / 17 * (attacker.Level - 1) * 0.95f))));

                    case GameObjectType.obj_AI_Minion:
                    case GameObjectType.obj_AI_Turret:
                        return(Attacker.GetAutoAttackDamage(Target, IncludePassive) +
                               Attacker.CalculateDamageOnUnit(Target, DamageType.Physical,
                                                              Attacker.BaseAttackDamage * (0.25f + (0.25f / 17 * (attacker.Level - 1) * 0.95f))));
                    }
                    break;

                case Champion.Thresh:
                    if (Attacker.Spellbook.GetSpell(SpellSlot.E).Level >= 1)
                    {
                        float passivePercent = 0;
                        if (Attacker.HasBuff("Threshqpassive1") && Attacker.HasBuff("Threshqpassive2") &&
                            Attacker.HasBuff("Threshqpassive3") && Attacker.HasBuff("Threshqpassive4"))
                        {
                            if (Attacker.HasBuff("Threshqpassive4"))
                            {
                                passivePercent = 1;
                            }
                            else
                            {
                                var timegone = Game.Time - Attacker.GetBuff("Threshqpassive").StartTime;
                                passivePercent = 10 / timegone - 0.05f;
                            }
                            if (passivePercent >= 1)
                            {
                                passivePercent = 1;
                            }
                        }
                        var     souls   = Attacker.HasBuff("threshpassivesoulsgain") ? Attacker.GetBuff("threshpassivesoulsgain").Count : 0;
                        float[] passive = { 0.8f, 1.1f, 1.4f, 1.7f, 2.0f };
                        return(Attacker.CalculateDamageOnUnit(Target, DamageType.Physical, Attacker.BaseAttackDamage) +
                               Attacker.CalculateDamageOnUnit(Target, DamageType.Magical,
                                                              (passivePercent * passive[Attacker.Spellbook.GetSpell(SpellSlot.E).Level]) * attacker.BaseAttackDamage + souls));
                    }
                    break;
                }
            }
            return(Attacker.GetAutoAttackDamage(Target, IncludePassive));
        }
Example #24
0
        private int MarkOfStorm(Obj_AI_Base target)
        {
            var buff = target.GetBuff("kennenmarkofstorm");

            if (buff != null)
            {
                return(buff.Count);
            }
            return(0);
        }
Example #25
0
        public static int EStacks(Obj_AI_Base target)
        {
            var buff = target.GetBuff("TristanaECharge");

            if (buff == null)
            {
                return(0);
            }
            return(buff.Count);
        }
Example #26
0
        public static float GetRemainingIgniteDamage(Obj_AI_Base target)
        {
            var ignitebuff = target.GetBuff("summonerdot");

            if (ignitebuff == null)
            {
                return(0);
            }
            return((float)ObjectManager.Player.CalcDamage(target, Damage.DamageType.True, ((int)(ignitebuff.EndTime - Game.Time) + 1) * (50 + ((Obj_AI_Hero)ignitebuff.Caster).Level * 20) / 5));
        }
Example #27
0
        /** TODO
         * public static void LaneClear()
         * {
         *  Chat.Print("FUI CHAMADO!!!");
         *  if (MenuX.FarmMenu["useWFarm"].Cast<CheckBox>().CurrentValue && Program.Spells[SpellSlot.W].IsReady())
         *  {
         *      var localtion =
         *          ObjectManager.Get<Obj_AI_Minion>()
         *              .Where(x => x.IsMinion());
         *      if (!localtion.Any())
         *      {
         *          Chat.Print("Achei nenhum!!!!");
         *          return;
         *      }
         *      else
         *      {
         *          Chat.Print("Achei alguns aeHO!!!!");
         *      }
         *  }
         *
         *  //  if (MenuX.FarmMenu["useEAmmo"].Cast<CheckBox>().CurrentValue && minion.IsEnemy)
         *  //&&
         *  //MenuX.FarmMenu["useEFarm"].Cast<Slider>().CurrentValue >= minion.CountEnemiesInRange(Program.Spells[SpellSlot.E].Range))
         * }
         **/
        #endregion

        #region Calcs OP
        public static float GetRemainingPoisonDamageMinusRegeneration(Obj_AI_Base target)
        {
            var buff = target.GetBuff("twitchdeadlyvenom");

            if (buff == null)
            {
                return(0f);
            }
            return((float)(ObjectManager.Player.CalculateDamageOnUnit(target, DamageType.True, ((int)(buff.EndTime - Game.Time) + 1) * GetPoisonTickDamage() * buff.Count)) - ((int)(buff.EndTime - Game.Time)) * target.HPRegenRate);
        }
Example #28
0
        private static bool MarkByMe(Obj_AI_Base enemy)
        {
            var mark = enemy.GetBuff("snowballfollowupself");

            if (mark != null && mark.Caster.IsMe)
            {
                return(true);
            }
            mark = enemy.GetBuff("snowballfollowup");
            if (mark != null && mark.Caster.IsMe)
            {
                return(true);
            }
            mark = enemy.GetBuff("porothrowfollowup");
            if (mark != null && mark.Caster.IsMe)
            {
                return(true);
            }
            return(false);
        }
Example #29
0
        public static float GetBlazeRemainingDamage(Obj_AI_Base unit)
        {
            var buff = unit.GetBuff("BrandAblaze");

            if (buff == null)
            {
                return 0;
            }

            return Player.Instance.CalculateDamageOnUnit(unit, DamageType.Magical,
                unit.MaxHealth*0.02f*(float) Math.Floor(buff.EndTime - Game.Time));
        }
Example #30
0
        public static float GetBlazeRemainingDamage(Obj_AI_Base unit)
        {
            var buff = unit.GetBuff("BrandAblaze");

            if (buff == null)
            {
                return(0);
            }

            return(Player.Instance.CalculateDamageOnUnit(unit, DamageType.Magical,
                                                         unit.MaxHealth * 0.02f * (float)Math.Floor(buff.EndTime - Game.Time)));
        }
Example #31
0
 public static int EStacks(Obj_AI_Base target)
 {
     var buff = target.GetBuff("TristanaECharge");
     if (buff == null)
     {
         return 0;
     }
     else
     {
         return buff.Count;
     }
 }
Example #32
0
        public static bool CheckTargetSureCanKill(Obj_AI_Base target)
        {
            if (target == null)
            {
                return(false);
            }

            if (target.HasBuff("KindredRNoDeathBuff"))
            {
                return(false);
            }

            if (target.HasBuff("UndyingRage") && target.GetBuff("UndyingRage").EndTime - Game.Time > 0.3)
            {
                return(false);
            }

            if (target.HasBuff("JudicatorIntervention"))
            {
                return(false);
            }

            if (target.HasBuff("ChronoShift") && target.GetBuff("ChronoShift").EndTime - Game.Time > 0.3)
            {
                return(false);
            }

            if (target.HasBuff("ShroudofDarkness"))
            {
                return(false);
            }

            if (target.HasBuff("SivirShield"))
            {
                return(false);
            }

            return(!target.HasBuff("FioraW"));
        }
Example #33
0
        protected static float PassiveDamage(Obj_AI_Base target)
        {
            var buff = target.GetBuff("TwitchDeadlyVenom");

            if (buff == null)
            {
                return(0);
            }
            else
            {
                int dmgperstacks = (player.Level - 1) / 4 + 1;
                int remaining    = (int)Math.Max(buff.EndTime - Game.Time, 0);
                return(GetECount(target) * dmgperstacks * remaining);
            }
        }
Example #34
0
        private static bool CheckTargetSureCanKill(Obj_AI_Base target)
        {
            if (target.HasBuff("KindredRNoDeathBuff"))
            {
                return(false);
            }

            if (target.HasBuff("UndyingRage") && target.GetBuff("UndyingRage").EndTime - Game.Time > 0.3)
            {
                return(false);
            }

            if (target.HasBuff("JudicatorIntervention"))
            {
                return(false);
            }

            if (target.HasBuff("ChronoShift") && target.GetBuff("ChronoShift").EndTime - Game.Time > 0.3)
            {
                return(false);
            }

            return(!target.HasBuff("FioraW"));
        }
Example #35
0
        public static float GetEdamage(Obj_AI_Base target)
        {
            var buff = target.GetBuff("KalistaExpungeMarker");
            if (buff != null)
            {
                var dmg =
                    (float)
                        ((new double[] { 20, 30, 40, 50, 60 }[Program.E.Level - 1] +
                          0.6 * (Program.Player.BaseAttackDamage + Program.Player.FlatPhysicalDamageMod)) +
                         ((buff.Count - 1) *
                          (new double[] { 10, 14, 19, 25, 32 }[Program.E.Level - 1] +
                           new double[] { 0.2, 0.225, 0.25, 0.275, 0.3 }[Program.E.Level - 1] *
                           (Program.Player.BaseAttackDamage + Program.Player.FlatPhysicalDamageMod))));

                if (Program.Player.HasBuff("summonerexhaust"))
                {
                    dmg *= 0.6f;
                }
                if (Program.Player.HasBuff("urgotcorrosivedebuff"))
                {
                    dmg *= 0.85f;
                }
                if (target.HasBuff("FerociousHowl"))
                {
                    dmg *= 0.3f;
                }
                if (target.HasBuff("vladimirhemoplaguedebuff"))
                {
                    dmg *= 1.15f;
                }
                if (target.Name.Contains("Baron") && Program.Player.HasBuff("barontarget"))
                {
                    dmg *= 0.5f;
                }
                if (target.Name.Contains("Dragon") && Program.Player.HasBuff("s5test_dragonslayerbuff"))
                {
                    dmg *= (1f - (0.07f * Program.Player.GetBuffCount("s5test_dragonslayerbuff")));
                }

                return
                (float)
                    Program.Player.CalcDamage(target, LeagueSharp.Common.Damage.DamageType.Physical, dmg + target.FlatHPRegenMod);
            }
            return 0;
        }
Example #36
0
 public float GetBuffEndTime(Obj_AI_Base target, string buffname)
 {
     return Math.Max(0, target.GetBuff(buffname).EndTime) - Game.Time;
 }
Example #37
0
 private static float GetRemainingIgniteDamage(Obj_AI_Base target)
 {
     var ignitebuff = target.GetBuff("summonerdot");
     if (ignitebuff == null) return 0;
     return (float)ObjectManager.Player.CalcDamage(target, Damage.DamageType.True, ((int)(ignitebuff.EndTime - Game.Time) + 1) * GetIgniteDamage(ignitebuff.Caster as Obj_AI_Hero) / 5);
 }
Example #38
0
 private static bool CanQ2(Obj_AI_Base target, bool isClear = false)
 {
     var buff = target.GetBuff("BlindMonkSonicWave");
     return buff != null && buff.EndTime - Game.Time < (isClear ? 0.2 : 0.3) * (buff.EndTime - buff.StartTime);
 }
Example #39
0
 /// <summary>
 /// Contains the list of currently marked targets.
 /// </summary>
 //public static List<Tuple<bool, Obj_AI_Base>> MarkedTargets = new List<Tuple<bool, Obj_AI_Base>>();
 /// <summary>
 /// Checks to see if the target is being silenced
 /// </summary>
 /// <param name="target">The Target</param>
 /// <returns></returns>
 public static bool IsMarked(Obj_AI_Base target)
 {
     return target.HasBuff("LeblancPMark") && (Environment.TickCount - target.GetBuff("LeblancPMark").StartTime > 1500f);
 }
Example #40
0
        private float GetComboDamage(Obj_AI_Base enemy)
        {
            float damage = 0;

            if (!ObjectManager.Player.IsWindingUp)
            {
                damage += (float)ObjectManager.Player.GetAutoAttackDamage(enemy, true);
            }

            var buff = enemy.GetBuff("vaynesilvereddebuff");

            if (buff != null)
                if (buff.Caster.IsMe)
                    if (buff.Count == 2)
                        damage += W.GetDamage(enemy) + (float)ObjectManager.Player.GetAutoAttackDamage(enemy);

            if (Q.isReadyPerfectly())
            {
                damage += Q.GetDamage(enemy) + (float)ObjectManager.Player.GetAutoAttackDamage(enemy);
            }

            if (ObjectManager.Player.HasBuff("vaynetumblebonus"))
            {
                damage += Q.GetDamage(enemy) + (float)ObjectManager.Player.GetAutoAttackDamage(enemy);
            }

            return 0;
        }
Example #41
0
 private static bool QAgain(Obj_AI_Base target)
 {
     var buff = target.GetBuff("BlindMonkSonicWave");
     return buff != null && buff.EndTime - Game.Time < 0.5f;
 }
Example #42
0
 private static float RTime(Obj_AI_Base target)
 {
     if (target.HasBuff("bantamtrapslow"))
     {
         return Math.Max(0, target.GetBuff("bantamtrapslow").EndTime) - Game.Time;
     }
     return 0;
 }
Example #43
0
        /** TODO
        public static void LaneClear()
        {
            Chat.Print("FUI CHAMADO!!!");
            if (MenuX.FarmMenu["useWFarm"].Cast<CheckBox>().CurrentValue && Program.Spells[SpellSlot.W].IsReady())
            {
                var localtion =
                    ObjectManager.Get<Obj_AI_Minion>()
                        .Where(x => x.IsMinion());
                if (!localtion.Any())
                {
                    Chat.Print("Achei nenhum!!!!");
                    return;
                }
                else
                {
                    Chat.Print("Achei alguns aeHO!!!!");
                }
            }

            //  if (MenuX.FarmMenu["useEAmmo"].Cast<CheckBox>().CurrentValue && minion.IsEnemy)
            //&&
            //MenuX.FarmMenu["useEFarm"].Cast<Slider>().CurrentValue >= minion.CountEnemiesInRange(Program.Spells[SpellSlot.E].Range))
        }
        **/
        #endregion

        #region Calcs OP
        public static float GetRemainingPoisonDamageMinusRegeneration(Obj_AI_Base target)
        {
            var buff = target.GetBuff("twitchdeadlyvenom");
            if (buff == null) return 0f;
            return (float)(ObjectManager.Player.CalculateDamageOnUnit(target, DamageType.True, ((int)(buff.EndTime - Game.Time) + 1) * GetPoisonTickDamage() * buff.Count)) - ((int)(buff.EndTime - Game.Time)) * target.HPRegenRate;
        }
Example #44
0
 private static float GetEdamageToMini(Obj_AI_Base target, int Count)
 {
     var buff = target.GetBuff("KalistaExpungeMarker");
     if (buff != null)
     {
         Count = buff.Count - 1;
     }
     var dmg =
         (float)
             ((new double[] { 20, 30, 40, 50, 60 }[E.Level - 1] +
               0.6 * (Player.BaseAttackDamage + Player.FlatPhysicalDamageMod)) +
              (Count *
               (new double[] { 10, 14, 19, 25, 32 }[E.Level - 1] +
                new double[] { 0.2, 0.225, 0.25, 0.275, 0.3 }[E.Level - 1] *
                (Player.BaseAttackDamage + Player.FlatPhysicalDamageMod))));
     return (float) (Player.CalculateDamage(target, DamageType.Physical, dmg));
 }
Example #45
0
 private static bool CanQ2(Obj_AI_Base target)
 {
     var buff = target.GetBuff("BlindMonkSonicWave");
     return buff != null && buff.EndTime - Game.Time < 0.25 * (buff.EndTime - buff.StartTime);
 }
Example #46
0
        /// <summary>
        /// Gets the damage reduction modifier.
        /// </summary>
        /// <param name="source">The source.</param>
        /// <param name="target">The target.</param>
        /// <param name="amount">The amount.</param>
        /// <param name="damageType">Type of the damage.</param>
        /// <returns></returns>
        private static double DamageReductionMod(
            Obj_AI_Base source,
            Obj_AI_Base target,
            double amount,
            DamageType damageType)
        {
            if (source is Obj_AI_Hero)
            {
                // Exhaust:
                // + Exhausts target enemy champion, reducing their Movement Speed and Attack Speed by 30%, their Armor and Magic Resist by 10, and their damage dealt by 40% for 2.5 seconds.
                if (source.HasBuff("Exhaust"))
                {
                    amount *= 0.6d;
                }

                // Lament
                // + Phantom Dancer reduces all damage dealt to attacker (if he's attack you) by 12%
                if (source.HasBuff("itemphantomdancerdebuff"))
                {
                    var caster = source.GetBuff("itemphantomdancerdebuff").Caster;
                    if (caster.NetworkId == target.NetworkId)
                    {
                        amount *= 0.88d;
                    }
                }
            }

            var targetHero = target as Obj_AI_Hero;
            if (targetHero != null)
            {

                //Damage Reduction Masteries

                //DAMAGE REDUCTION 2 %, increasing to 8 % when near at least one allied champion
                //IN THIS TOGETHER 8 % of the damage that the nearest allied champion would take is dealt to you instead.This can't bring you below 15% health.
                Mastery BondofStones = targetHero.GetMastery(Resolve.BondofStones);
                if (BondofStones != null && BondofStones.IsActive())
                {
                    bool closebyenemies = HeroManager.Enemies.Any(x => x.NetworkId != target.NetworkId && x.Distance(target) <= 500); //500 is not the real value
                    if (closebyenemies)
                    {
                        amount *= 0.92d;
                    }
                    else
                    {
                        amount *= 0.98d;
                    }
                }
                

                // Items:

                // Doran's Shield
                // + Blocks 8 damage from single target attacks and spells from champions.
                if (Items.HasItem(1054, targetHero))
                {
                    amount -= 8;
                }

                // Passives:

                // Unbreakable Will
                // + Alistar removes all crowd control effects from himself, then gains additional attack damage and takes 70% reduced physical and magic damage for 7 seconds.
                if (target.HasBuff("Ferocious Howl"))
                {
                    amount *= 0.3d;
                }

                // Tantrum
                // + Amumu takes reduced physical damage from basic attacks and abilities.
                if (target.HasBuff("Tantrum") && damageType == DamageType.Physical)
                {
                    amount -= new[] { 2, 4, 6, 8, 10 }[target.Spellbook.GetSpell(SpellSlot.E).Level - 1];
                }

                // Unbreakable
                // + Grants Braum 30% / 32.5% / 35% / 37.5% / 40% damage reduction from oncoming sources (excluding true damage and towers) for 3 / 3.25 / 3.5 / 3.75 / 4 seconds.
                // + The damage reduction is increased to 100% for the first source of champion damage that would be reduced.
                if (target.HasBuff("BraumShieldRaise"))
                {
                    amount -= amount
                              * new[] { 0.3d, 0.325d, 0.35d, 0.375d, 0.4d }[
                                  target.Spellbook.GetSpell(SpellSlot.E).Level - 1];
                }

                // Idol of Durand
                // + Galio becomes a statue and channels for 2 seconds, Taunt icon taunting nearby foes and reducing incoming physical and magic damage by 50%.
                if (target.HasBuff("GalioIdolOfDurand"))
                {
                    amount *= 0.5d;
                }

                // Courage
                // + Garen gains a defensive shield for a few seconds, reducing incoming damage by 30% and granting 30% crowd control reduction for the duration.
                if (target.HasBuff("GarenW"))
                {
                    amount *= 0.7d;
                }

                // Drunken Rage
                // + Gragas takes a long swig from his barrel, disabling his ability to cast or attack for 1 second and then receives 10% / 12% / 14% / 16% / 18% reduced damage for 3 seconds.
                if (target.HasBuff("GragasWSelf"))
                {
                    amount -= amount
                              * new[] { 0.1d, 0.12d, 0.14d, 0.16d, 0.18d }[
                                  target.Spellbook.GetSpell(SpellSlot.W).Level - 1];
                }

                // Void Stone
                // + Kassadin reduces all magic damage taken by 15%.
                if (target.HasBuff("VoidStone") && damageType == DamageType.Magical)
                {
                    amount *= 0.85d;
                }

                // Shunpo
                // + Katarina teleports to target unit and gains 15% damage reduction for 1.5 seconds. If the target is an enemy, the target takes magic damage.
                if (target.HasBuff("KatarinaEReduction"))
                {
                    amount *= 0.85d;
                }

                // Vengeful Maelstrom
                // + Maokai creates a magical vortex around himself, protecting him and allied champions by reducing damage from non-turret sources by 20% for a maximum of 10 seconds.
                if (target.HasBuff("MaokaiDrainDefense") && !(source is Obj_AI_Turret))
                {
                    amount *= 0.8d;
                }

                // Meditate
                // + Master Yi channels for up to 4 seconds, restoring health each second. This healing is increased by 1% for every 1% of his missing health. Meditate also resets the autoattack timer.
                // + While channeling, Master Yi reduces incoming damage (halved against turrets).
                if (target.HasBuff("Meditate"))
                {
                    amount -= amount
                              * new[] { 0.5d, 0.55d, 0.6d, 0.65d, 0.7d }[
                                  target.Spellbook.GetSpell(SpellSlot.W).Level - 1] / (source is Obj_AI_Turret ? 2 : 1);
                }

                // Valiant Fighter
                // + Poppy reduces all damage that exceeds 10% of her current health by 50%.
                if (target.HasBuff("PoppyValiantFighter") && !(source is Obj_AI_Turret) && amount / target.Health > 0.1d)
                {
                    amount *= 0.5d;
                }

                // Shadow Dash
                // + Shen reduces all physical damage by 50% from taunted enemies.
                if (target.HasBuff("Shen Shadow Dash") && source.HasBuff("Taunt") && damageType == DamageType.Physical)
                {
                    amount *= 0.5d;
                }
            }
            return amount;
        }
Example #47
0
 private int MarkOfStorm(Obj_AI_Base target)
 {
     var buff = target.GetBuff("kennenmarkofstorm");
     if (buff != null)
     {
         return buff.Count;
     }
     return 0;
 }
Example #48
0
        private static float EDmg(Obj_AI_Base hero)
        {
            if (!hero.HasBuff("tristanaechargesound") || !Root.Item("efinish").GetValue<bool>())
            {
                return 0f;
            }

            var b = hero.HasBuff("tristanaecharge") ? hero.GetBuff("tristanaecharge").Count + 1 : 1;
            if (b < Root.Item("mine").GetValue<Slider>().Value)
            {
                return 0f;
            }

            var physdmg = Player.CalcDamage(hero, Damage.DamageType.Physical,
                new[] { 47, 57, 70, 80, 90 } [E.Level - 1]  +
               (new[] { 0.5, 0.65, 0.80, 0.95, 1.1 } [E.Level - 1] * Player.FlatPhysicalDamageMod));

            var physbonus = Player.CalcDamage(hero, Damage.DamageType.Physical,
                new[] { 14.1, 17.1, 21, 24, 27 } [E.Level - 1] +
               (new[] { 0.15, 0.195, 0.24, 0.285, 0.33 } [E.Level - 1] * Player.FlatPhysicalDamageMod));


            return (float) (physdmg + (physbonus * b));
        }
Example #49
0
 private static float EDotTime(Obj_AI_Base target)
 {
     if (target.HasBuff("toxicshotparticle"))
     {
         return Math.Max(0, target.GetBuff("toxicshotparticle").EndTime) - Game.Time;
     }
     return 0;
 }
Example #50
0
 private static bool CanE2(Obj_AI_Base target)
 {
     var buff = target.GetBuff("BlindMonkTempest");
     return buff != null && buff.EndTime - Game.Time < 0.4 * (buff.EndTime - buff.StartTime);
 }
Example #51
0
 // Made somewhen with Justy
 private static float GetEdamage(Obj_AI_Base target)
 {
     var buff = target.GetBuff("KalistaExpungeMarker");
     if (buff != null)
     {
         var dmg =
             (float)
                 ((new double[] { 20, 30, 40, 50, 60 }[E.Level - 1] +
                   0.6 * (Player.BaseAttackDamage + Player.FlatPhysicalDamageMod)) +
                  ((buff.Count - 1) *
                   (new double[] { 10, 14, 19, 25, 32 }[E.Level - 1] +
                    new double[] { 0.2, 0.225, 0.25, 0.275, 0.3 }[E.Level - 1] *
                    (Player.BaseAttackDamage + Player.FlatPhysicalDamageMod))));
         if (target.Name.Contains("SRU_Dragon"))
         {
             var dsBuff = Player.GetBuff("s5test_dragonslayerbuff");
             if (dsBuff != null)
             {
                 dmg = dmg * (1f - 0.07f * dsBuff.Count);
             }
         }
         if (target.Name.Contains("SRU_Baron"))
         {
             var bBuff = Player.GetBuff("barontarget");
             if (bBuff != null)
             {
                 dmg = dmg * 0.5f;
             }
         }
         return
             (float)
                 (Player.CalculateDamage(target, DamageType.Physical, dmg) -
                  config["Misc"]["DmgRed"].GetValue<MenuSlider>().Value);
     }
     return 0;
 }
Example #52
0
 private static bool EAgain(Obj_AI_Base target)
 {
     var buff = target.GetBuff("BlindMonkTempest");
     return buff != null && buff.EndTime - Game.Time <= 0.5f;
 }