Example #1
0
        private static bool UnleashedPowerCheck(Obj_AI_Hero target)
        {
            var currentTick = (int)(Game.ClockTime * 0x3E8);
            var tickDelay   = 600 + Game.Ping;

            var attackDamage = 0d;

            if (EntryPoint.Menu.Item("l33t.stds.ups.disable.AA").GetValue <bool>())
            {
                attackDamage = EntryPoint.Player.GetAutoAttackDamage(target);
            }

            var includeQ = EntryPoint.Menu.Item("l33t.stds.ups.disable.Q").GetValue <bool>();
            var includeW = EntryPoint.Menu.Item("l33t.stds.ups.disable.W").GetValue <bool>();
            var includeE = EntryPoint.Menu.Item("l33t.stds.ups.disable.E").GetValue <bool>();

            switch (EntryPoint.Menu.Item("l33t.stds.ups.disable").GetValue <StringList>().SelectedIndex)
            {
            case 2:
                return(true);

            case 0:
                return(!(target.GetComboDamage(includeQ, includeW, includeE, false) + attackDamage >= target.Health));

            case 1:
                return
                    (!(target.GetComboDamage(includeQ, false, false, false) >= target.Health ||
                       target.GetComboDamage(false, includeW, false, false) >= target.Health ||
                       target.GetComboDamage(false, false, includeE, false) >= target.Health));
            }

            return(currentTick - Spells[SpellSlot.Q].LastCastAttemptTick > tickDelay &&
                   currentTick - Spells[SpellSlot.E].LastCastAttemptTick > tickDelay &&
                   currentTick - Spells[SpellSlot.W].LastCastAttemptTick > tickDelay);
        }
        private static float GetComboDamage(Obj_AI_Hero enemy)
        {
            IEnumerable <SpellSlot> spellCombo = new[] { SpellSlot.Q, SpellSlot.W };

            if (GetPassiveStacks() >= 4)
            {
                spellCombo = spellCombo.Concat(new[] { SpellSlot.Q });
            }
            if (R.IsReady())
            {
                spellCombo = spellCombo.Concat(new[] { SpellSlot.R });
            }

            return((float)Player.GetComboDamage(enemy, spellCombo));
        }
Example #3
0
        private static float GetComboDamage(Obj_AI_Hero enemy)
        {
            IEnumerable <SpellSlot> spellCombo = new[] { SpellSlot.Q, SpellSlot.W, SpellSlot.R };

            return((float)Player.GetComboDamage(enemy, spellCombo));
        }
Example #4
0
        private static void ProcessFlashKillsteal(Obj_AI_Hero enemy)
        {
            var useFlash = EntryPoint.Menu.Item("l33t.stds.ks.kenemies." + enemy.ChampionName) != null &&
                           EntryPoint.Menu.Item("l33t.stds.ks.kenemies." + enemy.ChampionName).GetValue <bool>();
            var useR = EntryPoint.Menu.Item("l33t.stds.ups.ignore." + enemy.ChampionName) != null &&
                       EntryPoint.Menu.Item("l33t.stds.ups.ignore." + enemy.ChampionName).GetValue <bool>() == false;
            var rflash =
                enemy.GetComboDamage(
                    EntryPoint.Menu.Item("l33t.stds.ks.useQ").GetValue <bool>(), false,
                    EntryPoint.Menu.Item("l33t.stds.ks.useE").GetValue <bool>(), false) < enemy.Health;
            var ePos = Spells[SpellSlot.R].Instance.GetPrediction(enemy);

            if ((FlashSpell.Slot == LeagueSharp.SpellSlot.Unknown && FlashSpell.IsReady()) || !useFlash ||
                !(EntryPoint.Player.Distance(ePos.UnitPosition, true) <=
                  Math.Pow(Spells[SpellSlot.Q].Range + 25f + 395, 2)) ||
                !(EntryPoint.Player.Distance(ePos.UnitPosition, true) >
                  Math.Pow(Spells[SpellSlot.Q].Range + 25f + 200, 2)))
            {
                return;
            }
            if (
                (!(enemy.GetComboDamage(
                       EntryPoint.Menu.Item("l33t.stds.ks.useQ").GetValue <bool>(), false,
                       EntryPoint.Menu.Item("l33t.stds.ks.useE").GetValue <bool>(), false) > enemy.Health) ||
                 !EntryPoint.Menu.Item("l33t.stds.ks.usefqe").GetValue <bool>()) &&
                (!(enemy.GetComboDamage(false, false, false, EntryPoint.Menu.Item("l33t.stds.ks.useR").GetValue <bool>()) >
                   enemy.Health) || !EntryPoint.Menu.Item("l33t.stds.ks.usefr").GetValue <bool>() ||
                 !(EntryPoint.Player.Distance(ePos.UnitPosition, true) <= Math.Pow(Spells[SpellSlot.R].Range + 390, 2)) ||
                 (int)(Game.ClockTime * 0x3E8) - Spells[SpellSlot.R].LastCastAttemptTick <= Game.Ping + 750 ||
                 (int)(Game.ClockTime * 0x3E8) - Spells[SpellSlot.SphereE].LastCastAttemptTick <= Game.Ping + 750 ||
                 !(EntryPoint.Player.Distance(ePos.UnitPosition, true) > Math.Pow(Spells[SpellSlot.R].Range + 200, 2))))
            {
                return;
            }
            var manaCost = 0d;

            if (EntryPoint.Menu.Item("l33t.stds.ks.mana").GetValue <bool>())
            {
                manaCost = Spells.Where(s => s.Key != SpellSlot.SphereE)
                           .Aggregate(manaCost, (current, spell) => current + spell.Value.Instance.Instance.ManaCost);
            }
            if (manaCost > EntryPoint.Player.Mana && EntryPoint.Menu.Item("l33t.stds.ks.mana").GetValue <bool>() &&
                EntryPoint.Menu.Item("l33t.stds.ks.mana").GetValue <bool>())
            {
                return;
            }
            var nearbyE = ePos.UnitPosition.CountEnemiesInRange(1000);

            if (nearbyE > EntryPoint.Menu.Item("l33t.stds.ks.maxenemy").GetValue <Slider>().Value)
            {
                return;
            }
            var flashPos = EntryPoint.Player.ServerPosition -
                           Vector3.Normalize(EntryPoint.Player.ServerPosition - ePos.UnitPosition) * 400;

            if (flashPos.IsWall())
            {
                return;
            }
            if (rflash)
            {
                if (useR)
                {
                    FlashSpell.Cast(flashPos);
                    ProcessSpells(
                        false, false, false, EntryPoint.Menu.Item("l33t.stds.ks.useR").GetValue <bool>(), false);
                    Audio.PlaySound();
                }
            }
            else
            {
                FlashSpell.Cast(flashPos);
            }
            _flashCastTick = (int)(Game.ClockTime * 0x3E8);
        }
Example #5
0
        //These are rly easy to use and makes code much better! like for some a lot used calculations or smth!

        public static float GetDamageTo(this Obj_AI_Hero from, Obj_AI_Base to)
        {
            return((float)from.GetComboDamage(to, new List <SpellSlot> {
                SpellSlot.Q, SpellSlot.W, SpellSlot.E, SpellSlot.R
            }));
        }
Example #6
0
 public static bool IsKillable(this Obj_AI_Hero source, Obj_AI_Base target, IEnumerable <SpellSlot> spellCombo)
 {
     return(source.GetComboDamage(target, spellCombo) * 0.9 > target.Health);
 }
Example #7
0
        private static void DrawEnemyInfo(Obj_AI_Hero enemy)
        {
            var hpBarPos = enemy.HPBarPosition;
            hpBarPos.X += 45;
            hpBarPos.Y += 18;
            var killText = "";
            var combodamage = enemy.GetComboDamage(
                EntryPoint.Menu.Item("l33t.stds.combo.useQ").GetValue<bool>(),
                EntryPoint.Menu.Item("l33t.stds.combo.useW").GetValue<bool>(),
                EntryPoint.Menu.Item("l33t.stds.combo.useE").GetValue<bool>(),
                EntryPoint.Menu.Item("l33t.stds.combo.useR").GetValue<bool>());

            var percentHPleftAfterCombo = (enemy.Health - combodamage) / enemy.MaxHealth;
            var percentHPleft = enemy.Health / enemy.MaxHealth;
            if (percentHPleftAfterCombo < 0)
            {
                percentHPleftAfterCombo = 0;
            }

            var comboXPos = hpBarPos.X - 36 + (107 * percentHPleftAfterCombo);
            double currentHpxPos = hpBarPos.X - 36 + (107 * percentHPleft);
            var barcolor = System.Drawing.Color.FromArgb(100, 0, 220, 0);
            var barcolorline = System.Drawing.Color.WhiteSmoke;
            if (combodamage + Mechanics.Spells[SpellSlot.Q].Damage(enemy) +
                EntryPoint.Player.GetAutoAttackDamage(enemy) * 2 > enemy.Health)
            {
                killText = "Killable by: Full Combo + 1Q + 2AA";
                if (combodamage >= enemy.Health)
                {
                    killText = "Killable by: Full Combo";
                }
                barcolor = System.Drawing.Color.FromArgb(100, 255, 255, 0);
                barcolorline = System.Drawing.Color.SpringGreen;
                var linecolor = barcolor;
                if (
                    enemy.GetComboDamage(
                        EntryPoint.Menu.Item("l33t.stds.combo.useQ").GetValue<bool>(),
                        EntryPoint.Menu.Item("l33t.stds.combo.useW").GetValue<bool>(),
                        EntryPoint.Menu.Item("l33t.stds.combo.useE").GetValue<bool>(), false) > enemy.Health)
                {
                    killText = "Killable by: Q + W + E";
                    barcolor = System.Drawing.Color.FromArgb(130, 255, 70, 0);
                    linecolor = System.Drawing.Color.FromArgb(150, 255, 0, 0);
                }
                if (EntryPoint.Menu.Item("l33t.stds.drawing.drawGank").GetValue<bool>())
                {
                    var pos = EntryPoint.Player.Position +
                              Vector3.Normalize(enemy.Position - EntryPoint.Player.Position) * 100;
                    var myPos = Drawing.WorldToScreen(pos);
                    pos = EntryPoint.Player.Position +
                          Vector3.Normalize(enemy.Position - EntryPoint.Player.Position) * 350;
                    var ePos = Drawing.WorldToScreen(pos);
                    Drawing.DrawLine(myPos.X, myPos.Y, ePos.X, ePos.Y, 1, linecolor);
                }
            }
            var killTextPos = Drawing.WorldToScreen(enemy.Position);
            var hPleftText = Math.Round(percentHPleftAfterCombo * 100) + "%";
            Drawing.DrawLine((float)comboXPos, hpBarPos.Y, (float)comboXPos, hpBarPos.Y + 5, 1, barcolorline);
            if (EntryPoint.Menu.Item("l33t.stds.drawing.drawKillText").GetValue<bool>())
            {
                Drawing.DrawText(killTextPos[0] - 105, killTextPos[1] + 25, barcolor, killText);
            }
            if (EntryPoint.Menu.Item("l33t.stds.drawing.drawKillTextHP").GetValue<bool>())
            {
                Drawing.DrawText(hpBarPos.X + 98, hpBarPos.Y + 5, barcolor, hPleftText);
            }
            if (EntryPoint.Menu.Item("l33t.stds.drawing.drawHPFill").GetValue<bool>())
            {
                var diff = currentHpxPos - comboXPos;
                for (var i = 0; i < diff; i++)
                {
                    Drawing.DrawLine(
                        (float)comboXPos + i, hpBarPos.Y + 2, (float)comboXPos + i, hpBarPos.Y + 10, 1,
                        barcolor);
                }
            }
        }
Example #8
0
        private static void DrawEnemyInfo(Obj_AI_Hero enemy)
        {
            var hpBarPos = enemy.HPBarPosition;

            hpBarPos.X += 45;
            hpBarPos.Y += 18;
            var killText    = "";
            var combodamage = enemy.GetComboDamage(
                EntryPoint.Menu.Item("l33t.stds.combo.useQ").GetValue <bool>(),
                EntryPoint.Menu.Item("l33t.stds.combo.useW").GetValue <bool>(),
                EntryPoint.Menu.Item("l33t.stds.combo.useE").GetValue <bool>(),
                EntryPoint.Menu.Item("l33t.stds.combo.useR").GetValue <bool>());

            var percentHPleftAfterCombo = (enemy.Health - combodamage) / enemy.MaxHealth;
            var percentHPleft           = enemy.Health / enemy.MaxHealth;

            if (percentHPleftAfterCombo < 0)
            {
                percentHPleftAfterCombo = 0;
            }

            var    comboXPos     = hpBarPos.X - 36 + (107 * percentHPleftAfterCombo);
            double currentHpxPos = hpBarPos.X - 36 + (107 * percentHPleft);
            var    barcolor      = System.Drawing.Color.FromArgb(100, 0, 220, 0);
            var    barcolorline  = System.Drawing.Color.WhiteSmoke;

            if (combodamage + Mechanics.Spells[SpellSlot.Q].Damage(enemy) +
                EntryPoint.Player.GetAutoAttackDamage(enemy) * 2 > enemy.Health)
            {
                killText = "Killable by: Full Combo + 1Q + 2AA";
                if (combodamage >= enemy.Health)
                {
                    killText = "Killable by: Full Combo";
                }
                barcolor     = System.Drawing.Color.FromArgb(100, 255, 255, 0);
                barcolorline = System.Drawing.Color.SpringGreen;
                var linecolor = barcolor;
                if (
                    enemy.GetComboDamage(
                        EntryPoint.Menu.Item("l33t.stds.combo.useQ").GetValue <bool>(),
                        EntryPoint.Menu.Item("l33t.stds.combo.useW").GetValue <bool>(),
                        EntryPoint.Menu.Item("l33t.stds.combo.useE").GetValue <bool>(), false) > enemy.Health)
                {
                    killText  = "Killable by: Q + W + E";
                    barcolor  = System.Drawing.Color.FromArgb(130, 255, 70, 0);
                    linecolor = System.Drawing.Color.FromArgb(150, 255, 0, 0);
                }
                if (EntryPoint.Menu.Item("l33t.stds.drawing.drawGank").GetValue <bool>())
                {
                    var pos = EntryPoint.Player.Position +
                              Vector3.Normalize(enemy.Position - EntryPoint.Player.Position) * 100;
                    var myPos = Drawing.WorldToScreen(pos);
                    pos = EntryPoint.Player.Position +
                          Vector3.Normalize(enemy.Position - EntryPoint.Player.Position) * 350;
                    var ePos = Drawing.WorldToScreen(pos);
                    Drawing.DrawLine(myPos.X, myPos.Y, ePos.X, ePos.Y, 1, linecolor);
                }
            }
            var killTextPos = Drawing.WorldToScreen(enemy.Position);
            var hPleftText  = Math.Round(percentHPleftAfterCombo * 100) + "%";

            Drawing.DrawLine((float)comboXPos, hpBarPos.Y, (float)comboXPos, hpBarPos.Y + 5, 1, barcolorline);
            if (EntryPoint.Menu.Item("l33t.stds.drawing.drawKillText").GetValue <bool>())
            {
                Drawing.DrawText(killTextPos[0] - 105, killTextPos[1] + 25, barcolor, killText);
            }
            if (EntryPoint.Menu.Item("l33t.stds.drawing.drawKillTextHP").GetValue <bool>())
            {
                Drawing.DrawText(hpBarPos.X + 98, hpBarPos.Y + 5, barcolor, hPleftText);
            }
            if (EntryPoint.Menu.Item("l33t.stds.drawing.drawHPFill").GetValue <bool>())
            {
                var diff = currentHpxPos - comboXPos;
                for (var i = 0; i < diff; i++)
                {
                    Drawing.DrawLine(
                        (float)comboXPos + i, hpBarPos.Y + 2, (float)comboXPos + i, hpBarPos.Y + 10, 1,
                        barcolor);
                }
            }
        }
Example #9
0
        private static bool UnleashedPowerCheck(Obj_AI_Hero target)
        {
            var currentTick = (int) (Game.ClockTime * 0x3E8);
            var tickDelay = 600 + Game.Ping;

            var attackDamage = 0d;
            if (EntryPoint.Menu.Item("l33t.stds.ups.disable.AA").GetValue<bool>())
            {
                attackDamage = EntryPoint.Player.GetAutoAttackDamage(target);
            }

            var includeQ = EntryPoint.Menu.Item("l33t.stds.ups.disable.Q").GetValue<bool>();
            var includeW = EntryPoint.Menu.Item("l33t.stds.ups.disable.W").GetValue<bool>();
            var includeE = EntryPoint.Menu.Item("l33t.stds.ups.disable.E").GetValue<bool>();
            switch (EntryPoint.Menu.Item("l33t.stds.ups.disable").GetValue<StringList>().SelectedIndex)
            {
                case 2:
                    return true;
                case 0:
                    return !(target.GetComboDamage(includeQ, includeW, includeE, false) + attackDamage >= target.Health);
                case 1:
                    return
                        !(target.GetComboDamage(includeQ, false, false, false) >= target.Health ||
                          target.GetComboDamage(false, includeW, false, false) >= target.Health ||
                          target.GetComboDamage(false, false, includeE, false) >= target.Health);
            }

            return currentTick - Spells[SpellSlot.Q].LastCastAttemptTick > tickDelay &&
                   currentTick - Spells[SpellSlot.E].LastCastAttemptTick > tickDelay &&
                   currentTick - Spells[SpellSlot.W].LastCastAttemptTick > tickDelay;
        }
Example #10
0
 private static void ProcessFlashKillsteal(Obj_AI_Hero enemy)
 {
     var useFlash = EntryPoint.Menu.Item("l33t.stds.ks.kenemies." + enemy.ChampionName) != null &&
                    EntryPoint.Menu.Item("l33t.stds.ks.kenemies." + enemy.ChampionName).GetValue<bool>();
     var useR = EntryPoint.Menu.Item("l33t.stds.ups.ignore." + enemy.ChampionName) != null &&
                EntryPoint.Menu.Item("l33t.stds.ups.ignore." + enemy.ChampionName).GetValue<bool>() == false;
     var rflash =
         enemy.GetComboDamage(
             EntryPoint.Menu.Item("l33t.stds.ks.useQ").GetValue<bool>(), false,
             EntryPoint.Menu.Item("l33t.stds.ks.useE").GetValue<bool>(), false) < enemy.Health;
     var ePos = Spells[SpellSlot.R].Instance.GetPrediction(enemy);
     if ((FlashSpell.Slot == LeagueSharp.SpellSlot.Unknown && FlashSpell.IsReady()) || !useFlash ||
         !(EntryPoint.Player.Distance(ePos.UnitPosition, true) <=
           Math.Pow(Spells[SpellSlot.Q].Range + 25f + 395, 2)) ||
         !(EntryPoint.Player.Distance(ePos.UnitPosition, true) >
           Math.Pow(Spells[SpellSlot.Q].Range + 25f + 200, 2)))
     {
         return;
     }
     if (
         (!(enemy.GetComboDamage(
             EntryPoint.Menu.Item("l33t.stds.ks.useQ").GetValue<bool>(), false,
             EntryPoint.Menu.Item("l33t.stds.ks.useE").GetValue<bool>(), false) > enemy.Health) ||
          !EntryPoint.Menu.Item("l33t.stds.ks.usefqe").GetValue<bool>()) &&
         (!(enemy.GetComboDamage(false, false, false, EntryPoint.Menu.Item("l33t.stds.ks.useR").GetValue<bool>()) >
            enemy.Health) || !EntryPoint.Menu.Item("l33t.stds.ks.usefr").GetValue<bool>() ||
          !(EntryPoint.Player.Distance(ePos.UnitPosition, true) <= Math.Pow(Spells[SpellSlot.R].Range + 390, 2)) ||
          (int) (Game.ClockTime * 0x3E8) - Spells[SpellSlot.R].LastCastAttemptTick <= Game.Ping + 750 ||
          (int) (Game.ClockTime * 0x3E8) - Spells[SpellSlot.SphereE].LastCastAttemptTick <= Game.Ping + 750 ||
          !(EntryPoint.Player.Distance(ePos.UnitPosition, true) > Math.Pow(Spells[SpellSlot.R].Range + 200, 2))))
     {
         return;
     }
     var manaCost = 0d;
     if (EntryPoint.Menu.Item("l33t.stds.ks.mana").GetValue<bool>())
     {
         manaCost = Spells.Where(s => s.Key != SpellSlot.SphereE)
             .Aggregate(manaCost, (current, spell) => current + spell.Value.Instance.Instance.ManaCost);
     }
     if (manaCost > EntryPoint.Player.Mana && EntryPoint.Menu.Item("l33t.stds.ks.mana").GetValue<bool>() &&
         EntryPoint.Menu.Item("l33t.stds.ks.mana").GetValue<bool>())
     {
         return;
     }
     var nearbyE = ePos.UnitPosition.CountEnemiesInRange(1000);
     if (nearbyE > EntryPoint.Menu.Item("l33t.stds.ks.maxenemy").GetValue<Slider>().Value)
     {
         return;
     }
     var flashPos = EntryPoint.Player.ServerPosition -
                    Vector3.Normalize(EntryPoint.Player.ServerPosition - ePos.UnitPosition) * 400;
     if (flashPos.IsWall())
     {
         return;
     }
     if (rflash)
     {
         if (useR)
         {
             FlashSpell.Cast(flashPos);
             ProcessSpells(
                 false, false, false, EntryPoint.Menu.Item("l33t.stds.ks.useR").GetValue<bool>(), false);
             Audio.PlaySound();
         }
     }
     else
     {
         FlashSpell.Cast(flashPos);
     }
     _flashCastTick = (int) (Game.ClockTime * 0x3E8);
 }