Exemplo n.º 1
0
    private void CastChargedSpell(string spell, SimpleTs.DamageType damageType, bool packet, bool aoe)
    {
        if (!Spells[spell].IsReady())
        {
            return;
        }

        Obj_AI_Hero target = SimpleTs.GetTarget(Spells[spell].ChargedMaxRange, damageType);

        if (target == null || !target.IsValidTarget(Spells[spell].ChargedMaxRange))
        {
            return;
        }

        if (!Spells[spell].IsCharging)
        {
            Spells[spell].StartCharging();
        }
        else
        {
            if (Spells[spell].GetPrediction(target).Hitchance >= HitChance.High)
            {
                Spells[spell].Cast(target, packet, aoe);
            }
        }
    }
Exemplo n.º 2
0
        private static Obj_AI_Hero Cast_BasicLineSkillshot_Enemy(Spell spell, SimpleTs.DamageType damageType = SimpleTs.DamageType.Physical)
        {
            var QonlyAA = Config.Item("QMin").GetValue <bool>();
            var target  = SimpleTs.GetTarget(spell.Range, damageType);

            if (!spell.IsReady())
            {
                return(null);
            }

            if (target == null)
            {
                return(null);
            }

            if (QonlyAA && Orbwalking.InAutoAttackRange(target))
            {
                return(null);
            }

            if (!target.IsValidTarget(spell.Range) || spell.GetPrediction(target).Hitchance < HitChance.High)
            {
                return(null);
            }

            spell.Cast(target, true);
            return(target);
        }
Exemplo n.º 3
0
 protected void Cast(string spell, SimpleTs.DamageType damageType, bool packet = true, bool aoe = false)
 {
     if (Spells[spell].IsSkillshot)
     {
         CastSkillshot(spell, damageType, packet, aoe);
     }
     if (Spells[spell].IsChargedSpell)
     {
         CastChargedSpell(spell, damageType, packet, aoe);
     }
     CastOnUnit(spell, damageType, packet);
 }
Exemplo n.º 4
0
        public void Cast_onEnemy(Spell spell, SimpleTs.DamageType damageType = SimpleTs.DamageType.Physical)
        {
            if (!spell.IsReady() || !ManaManagerAllowCast(spell))
            {
                return;
            }
            var target = SimpleTs.GetTarget(spell.Range, damageType);

            if (target.IsValidTarget(spell.Range))
            {
                spell.CastOnUnit(target, Packets());
            }
        }
Exemplo n.º 5
0
        public void CastBasicSkillShot(Spell spell, float range, SimpleTs.DamageType type, HitChance hitChance)
        {
            var target = SimpleTs.GetTarget(range, type);

            if (target == null || !spell.IsReady())
            {
                return;
            }
            spell.UpdateSourcePosition();

            if (spell.GetPrediction(target).Hitchance >= hitChance)
            {
                spell.Cast(target, packets());
            }
        }
Exemplo n.º 6
0
    protected void CastSelf(string spell, SimpleTs.DamageType damageType, float extraRange = 0)
    {
        if (!Spells[spell].IsReady())
        {
            return;
        }

        Obj_AI_Hero target = SimpleTs.GetTarget(Spells[spell].Range + extraRange, damageType);

        if (target == null)
        {
            return;
        }

        Spells[spell].Cast();
    }
Exemplo n.º 7
0
    private void CastOnUnit(string spell, SimpleTs.DamageType damageType, bool packet)
    {
        if (!Spells[spell].IsReady())
        {
            return;
        }

        Obj_AI_Hero target = SimpleTs.GetTarget(Spells[spell].Range, damageType);

        if (target == null)
        {
            return;
        }

        Spells[spell].CastOnUnit(target, packet);
    }
Exemplo n.º 8
0
        public void Cast_BasicCircleSkillshot_Enemy(Spell spell, SimpleTs.DamageType damageType = SimpleTs.DamageType.Physical, float extrarange = 0)
        {
            if (!spell.IsReady())
            {
                return;
            }
            var target = SimpleTs.GetTarget(spell.Range + extrarange, damageType);

            if (target == null)
            {
                return;
            }
            if (target.IsValidTarget(spell.Range + extrarange) && spell.GetPrediction(target).Hitchance >= HitChance.High)
            {
                spell.Cast(target, Packets());
            }
        }
Exemplo n.º 9
0
    public void CastSkillshot(string spell, SimpleTs.DamageType damageType, HitChance hitChance = HitChance.VeryHigh, bool packet = true, bool aoe = false)
    {
        if (!Spells[spell].IsReady())
        {
            return;
        }

        if (!Spells[spell].IsChargedSpell)
        {
            Obj_AI_Hero target = SimpleTs.GetTarget(Spells[spell].Range, damageType);
            if (target == null)
            {
                return;
            }

            if (target.IsValidTarget(Spells[spell].Range) && Spells[spell].GetPrediction(target).Hitchance >= hitChance)
            {
                Spells[spell].Cast(target, packet, aoe);
            }
        }
        else
        {
            Obj_AI_Hero target = SimpleTs.GetTarget(Spells[spell].ChargedMaxRange, damageType);
            if (target == null || !target.IsValidTarget(Spells[spell].ChargedMaxRange))
            {
                return;
            }

            if (!Spells[spell].IsCharging)
            {
                Spells[spell].StartCharging();
            }
            else
            {
                if (hitChance == HitChance.VeryHigh && Spells[spell].Range - Spells[spell].ChargedMaxRange * 0.2f > ObjectManager.Player.Distance(target) && Spells[spell].GetPrediction(target).Hitchance >= HitChance.High)
                {
                    Spells[spell].Cast(target, packet, aoe);
                }
                if (Spells[spell].GetPrediction(target).Hitchance >= hitChance)
                {
                    Spells[spell].Cast(target, packet, aoe);
                }
            }
        }
    }
Exemplo n.º 10
0
    public void CastOnTarget(string spell, SimpleTs.DamageType damageType, bool packet = true)
    {
        if (!Spells[spell].IsReady())
        {
            return;
        }

        Obj_AI_Hero target = SimpleTs.GetTarget(Spells[spell].Range, damageType);

        if (target == null)
        {
            return;
        }

        if (target.IsValidTarget(Spells[spell].Range))
        {
            Spells[spell].CastOnUnit(target, packet);
        }
    }
Exemplo n.º 11
0
        public Obj_AI_Hero Cast_BasicLineSkillshot_Enemy(Spell spell, SimpleTs.DamageType damageType = SimpleTs.DamageType.Physical)
        {
            if (!spell.IsReady() || !ManaManagerAllowCast(spell))
            {
                return(null);
            }
            var target = SimpleTs.GetTarget(spell.Range, damageType);

            if (target == null)
            {
                return(null);
            }
            if (!target.IsValidTarget(spell.Range) || spell.GetPrediction(target).Hitchance < HitChance.High)
            {
                return(null);
            }
            spell.Cast(target, Packets());
            return(target);
        }
Exemplo n.º 12
0
    private void CastSkillshot(string spell, SimpleTs.DamageType damageType, bool packet, bool aoe)
    {
        if (!Spells[spell].IsReady())
        {
            return;
        }

        Obj_AI_Hero target = SimpleTs.GetTarget(Spells[spell].Range, damageType);

        if (target == null)
        {
            return;
        }

        if (target.IsValidTarget(Spells[spell].Range) && Spells[spell].GetPrediction(target).Hitchance >= HitChance.High)
        {
            Spells[spell].Cast(target, packet, aoe);
        }
    }
Exemplo n.º 13
0
        /// <summary>
        ///     Casts a basic circle skillshot towards target if hitchance is high
        /// </summary>
        /// <param name="spell"></param>
        /// <param name="damageType"></param>
        /// <param name="extrarange"></param>
        /// <returns></returns>
        public Obj_AI_Base CastCircleSkillShot(Spell spell,
                                               SimpleTs.DamageType damageType = SimpleTs.DamageType.Physical, float extrarange = 0)
        {
            if (!spell.IsReady())
            {
                return(null);
            }
            var target = SimpleTs.GetTarget(spell.Range + extrarange, damageType);

            if (target == null)
            {
                return(null);
            }
            if (target.IsValidTarget(spell.Range + extrarange) &&
                spell.GetPrediction(target).Hitchance >= HitChance.High)
            {
                spell.Cast(target, true);
            }
            return(target);
        }
Exemplo n.º 14
0
        /// <summary>
        ///     Casts a basic line skillshot towards target if hitchance is high
        /// </summary>
        /// <param name="spell"></param>
        /// <param name="damageType"></param>
        /// <returns> target </returns>
        public Obj_AI_Hero CastLineSkillShot(Spell spell,
                                             SimpleTs.DamageType damageType = SimpleTs.DamageType.Physical)
        {
            if (!spell.IsReady())
            {
                return(null);
            }
            var target = SimpleTs.GetTarget(spell.Range, damageType);

            if (target == null)
            {
                return(null);
            }
            if (!target.IsValidTarget(spell.Range) || spell.GetPrediction(target).Hitchance < HitChance.High)
            {
                return(null);
            }
            spell.Cast(target, true);
            return(target);
        }
Exemplo n.º 15
0
        public Obj_AI_Hero Cast_BasicSkillshot_Enemy(Spell spell, SimpleTs.DamageType prio = SimpleTs.DamageType.True, float extrarange = 0)
        {
            if (!spell.IsReady())
            {
                return(null);
            }
            var target = SimpleTs.GetTarget(spell.Range + extrarange, prio);

            if (target == null)
            {
                return(null);
            }
            if (!target.IsValidTarget(spell.Range + extrarange) || spell.GetPrediction(target).Hitchance < HitChance.Medium)
            {
                return(null);
            }
            spell.UpdateSourcePosition();
            spell.Cast(target, UsePackets());
            return(target);
        }
Exemplo n.º 16
0
        public void Cast_onMinion_nearEnemy(Spell spell, float range, SimpleTs.DamageType damageType = SimpleTs.DamageType.Physical, MinionTypes minionTypes = MinionTypes.All, MinionTeam minionTeam = MinionTeam.All)
        {
            if (!spell.IsReady() || !ManaManagerAllowCast(spell))
            {
                return;
            }
            var target = SimpleTs.GetTarget(spell.Range + range, damageType);

            Obj_AI_Base[] nearstMinion = { null };
            var           allminions   = MinionManager.GetMinions(target.Position, range, minionTypes, minionTeam);

            foreach (var minion in allminions.Where(minion => minion.Distance(ObjectManager.Player) <= spell.Range && minion.Distance(target) <= range).Where(minion => nearstMinion[0] == null || nearstMinion[0].Distance(target) >= minion.Distance(target)))
            {
                nearstMinion[0] = minion;
            }

            if (nearstMinion[0] != null)
            {
                spell.CastOnUnit(nearstMinion[0], Packets());
            }
        }
Exemplo n.º 17
0
        //Credits to Lexxes gave me this function to use
        public static bool Spell_Cast_LineSkillshot(string MainMenu, string Menu, Spell Spell, SimpleTs.DamageType DmgType, string Objekt = "Enemy", bool Condition = true, bool Lasthit = false, DamageLib.StageType Stage = DamageLib.StageType.Default)
        {
            if (Objekt == "Enemy")
            {
                var Target = SimpleTs.GetTarget(Spell.Range, DmgType);
                if (Target != null)
                {
                    if (Target.IsValidTarget(Spell.Range) && Spell.IsReady())
                    {
                        if (Spell.GetPrediction(Target).HitChance >= Prediction.HitChance.HighHitchance)
                        {
                            Spell.Cast(Target, true);

                            return(true);
                        }
                    }
                }
            }
            if (Objekt == "Minion")
            {
                var allMinions = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, Spell.Range, MinionTypes.All, MinionTeam.NotAlly);
                foreach (var Target in allMinions)
                {
                    if (Target != null)
                    {
                        var spelltype = DamageLib.SpellType.AD;

                        if (Spell.Slot.ToString() == "Q")
                        {
                            spelltype = DamageLib.SpellType.Q;
                        }
                        if (Spell.Slot.ToString() == "W")
                        {
                            spelltype = DamageLib.SpellType.W;
                        }
                        if (Spell.Slot.ToString() == "E")
                        {
                            spelltype = DamageLib.SpellType.E;
                        }
                        if (Spell.Slot.ToString() == "R")
                        {
                            spelltype = DamageLib.SpellType.R;
                        }

                        if (Target.IsValidTarget(Spell.Range) && Spell.IsReady())
                        {
                            if ((Lasthit && (DamageLib.getDmg(Target, spelltype, Stage) > Target.Health) || (DamageLib.getDmg(Target, spelltype, Stage) + 100 < Target.Health) && !Lasthit))
                            {
                                Spell.Cast(Target.Position, true);
                                return(true);
                            }
                        }
                    }
                }
            }
            if (Objekt == "KS")
            {
            }


            return(true);
        }
Exemplo n.º 18
0
 public static bool Spell_Cast_onMousePos(string MainMenu, string Menu, Spell spell, SimpleTs.DamageType DmgType, int Range, string Objekt = "Enemy", bool Condition = true, int EnemyNearCastRange = 1)
 {
     if (Menu_IsMenuActive(Menu) && Menu_ManamanagerCheck(MainMenu) && Condition)
     {
         if (Objekt == "Enemy")
         {
             var Target = SimpleTs.GetTarget(Range, DmgType);
             if (spell.IsReady() && Target.IsValidTarget(Range))
             {
                 spell.Cast(Game.CursorPos, Menu_IsMenuActive(t.MenuItem_bool_usePackets));
                 return(true);
             }
         }
         if (Objekt == "Minion")
         {
             var allMinions = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, Range, MinionTypes.All, MinionTeam.NotAlly);
             foreach (var Target in allMinions)
             {
                 if (Target != null)
                 {
                     if (Target.IsValidTarget(Range) && spell.IsReady())
                     {
                         spell.Cast(Game.CursorPos, Menu_IsMenuActive(t.MenuItem_bool_usePackets));
                         return(true);
                     }
                 }
             }
         }
     }
     return(false);
 }
Exemplo n.º 19
0
 public void Cast_BasicLineSkillshot_Enemy(Spell spell, Vector3 sourcePosition, SimpleTs.DamageType damageType = SimpleTs.DamageType.Physical)
 {
     if (!spell.IsReady() || !ManaManagerAllowCast(spell))
     {
         return;
     }
     spell.UpdateSourcePosition(sourcePosition, sourcePosition);
     foreach (var hero in Program.Helper.EnemyTeam
              .Where(hero => (hero.Distance(sourcePosition) < spell.Range) && hero.IsValidTarget()).Where(hero => spell.GetPrediction(hero).Hitchance >= HitChance.High))
     {
         spell.Cast(hero, Packets());
         return;
     }
 }