예제 #1
0
 private static double GetSmiteDamage()
 {
     int[] dmg =
     {
         20 * Player.Level + 370, 30 * Player.Level + 330, 40 * +Player.Level + 240,
         50 * Player.Level + 100
     };
     return(Player.GetSpellSlot(CheckHandler.SmiteSpellName()).IsReady() ? dmg.Max() : 0);
 }
예제 #2
0
        private static void Tick()
        {
            if (!Program.Config.Item("smiteEnabled").GetValue <KeyBind>().Active)
            {
                return;
            }

            Obj_AI_Base selectedMinion =
                MinionManager.GetMinions(1100, MinionTypes.All, MinionTeam.Neutral, MinionOrderTypes.MaxHealth)
                .FirstOrDefault(
                    minion =>
                    minion.Health > 0 && Program.Config.Item(minion.BaseSkinName) != null &&
                    Program.Config.Item(minion.BaseSkinName).GetValue <bool>());

            if (selectedMinion == null)
            {
                return;
            }
            if (GetSmiteDamage() >= selectedMinion.Health && Player.Distance(selectedMinion) <= 700 ||
                _checkForSmite && Player.Distance(selectedMinion) < 100)
            {
                Player.Spellbook.CastSpell(Player.GetSpellSlot(CheckHandler.SmiteSpellName()), selectedMinion);
                _checkForSmite = false;
            }
            if (!CheckHandler._spells[SpellSlot.Q].IsReady())
            {
                return;
            }

            if (selectedMinion.HasQBuff() &&
                CheckHandler.Q2Damage(selectedMinion, (float)GetSmiteDamage(), true) + GetSmiteDamage() > selectedMinion.Health &&
                !CheckHandler.QState)
            {
                CheckHandler._spells[SpellSlot.Q].Cast();
                _checkForSmite = true;
            }
            if (
                CheckHandler.Q2Damage(
                    selectedMinion, (float)GetSmiteDamage() + CheckHandler._spells[SpellSlot.Q].GetDamage(selectedMinion),
                    true) + GetSmiteDamage() + CheckHandler._spells[SpellSlot.Q].GetDamage(selectedMinion) >
                selectedMinion.Health && CheckHandler.QState)
            {
                CheckHandler._spells[SpellSlot.Q].Cast(selectedMinion);
            }
        }
예제 #3
0
        public static void CastQ(Obj_AI_Base target, bool smiteQ = false)
        {
            PredictionOutput qData = CheckHandler._spells[SpellSlot.Q].GetPrediction(target);

            if (CheckHandler._spells[SpellSlot.Q].IsReady() &&
                target.IsValidTarget(CheckHandler._spells[SpellSlot.Q].Range))
            {
                if (qData.Hitchance >= GetHitChance())
                {
                    CheckHandler._spells[SpellSlot.Q].Cast(qData.CastPosition);
                }
            }

            if (smiteQ && CheckHandler._spells[SpellSlot.Q].IsReady() &&
                target.IsValidTarget(CheckHandler._spells[SpellSlot.Q].Range) && qData.Hitchance == HitChance.Collision)
            {
                foreach (Obj_AI_Base minion in
                         from minion in
                         MinionManager.GetMinions(
                             Player.Position, CheckHandler._spells[SpellSlot.Q].Range, MinionTypes.All,
                             MinionTeam.NotAlly)
                         let projection =
                             minion.Position.To2D().ProjectOn(Player.ServerPosition.To2D(), target.ServerPosition.To2D())
                             where
                             projection.IsOnSegment &&
                             projection.SegmentPoint.Distance(minion) <=
                             minion.BoundingRadius + CheckHandler._spells[SpellSlot.Q].Width &&
                             Player.GetSpellSlot(CheckHandler.SmiteSpellName()).IsReady() &&
                             Player.GetSummonerSpellDamage(minion, Damage.SummonerSpell.Smite) > minion.Health
                             select minion)
                {
                    Player.Spellbook.CastSpell(Player.GetSpellSlot(CheckHandler.SmiteSpellName()), minion);
                    CheckHandler._spells[SpellSlot.Q].Cast(target);
                }
            }
        }