Exemplo n.º 1
0
 private static void PreAtack(AttackableUnit target, Orbwalker.PreAttackArgs args)
 {
     if (Player.Instance.Mana > SpellData.GetSpellData(E.Name).Mana&& Combo["DisAA"].Cast <CheckBox>().CurrentValue&& Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
     {
         Orbwalker.DisableAttacking = true;
     }
     if (Player.Instance.Mana < SpellData.GetSpellData(E.Name).Mana&& Combo["DisAA"].Cast <CheckBox>().CurrentValue&& Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
     {
         Orbwalker.DisableAttacking = false;
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Returns a circle with center at hero position and radius of the highest impact range a hero has.
        /// </summary>
        /// <param name="hero">The target hero.</param>
        internal static Geometry.Circle GetChampionRangeCircle(Obj_AI_Hero hero)
        {
            var heroSpells = new List <SpellData>
            {
                SpellData.GetSpellData(hero.GetSpell(SpellSlot.Q).Name),
                SpellData.GetSpellData(hero.GetSpell(SpellSlot.W).Name),
                SpellData.GetSpellData(hero.GetSpell(SpellSlot.E).Name),
            };
            var spellsOrderedByRange = heroSpells.OrderBy(s => s.CastRange);

            if (spellsOrderedByRange.FirstOrDefault() != null)
            {
                var highestSpellRange = spellsOrderedByRange.FirstOrDefault().CastRange;
                return(new Geometry.Circle(hero.ServerPosition.To2D(), highestSpellRange > hero.AttackRange ? highestSpellRange : hero.AttackRange));
            }
            return(new Geometry.Circle(hero.ServerPosition.To2D(), hero.AttackRange));
        }
Exemplo n.º 3
0
        public Default()
        {
            //initializing spells
            Q = new Spell(SpellSlot.Q);
            W = new Spell(SpellSlot.W);
            E = new Spell(SpellSlot.E);
            R = new Spell(SpellSlot.R);

            //add them to a list to process them later on for voodoo magic
            Spells.Add(Q);
            Spells.Add(W);
            Spells.Add(E);
            Spells.Add(R);

            //find skillshots in evade spelldb
            List <Data.SpellData> MySkillShots =
                Data.SpellDatabase.Spells.FindAll(s => s.ChampionName == ObjectHandler.Player.ChampionName);

            //set skillshots
            foreach (var ss in MySkillShots)
            {
                var theSpell = Spells.First(s => s.Slot == ss.Slot);
                if (theSpell != null)
                {
                    theSpell.Range = ss.Range;
                    theSpell.SetSkillshot(ss.Delay, ss.RawRadius, ss.MissileSpeed, true, ss.Type);
                }
            }

            //spell is not a skillshot? make it targettable.
            foreach (var spell in Spells)
            {
                var sd = SpellData.GetSpellData(ObjectManager.Player.GetSpell(spell.Slot).Name);
                if (!spell.IsSkillshot && sd != null)
                {
                    spell.Range = sd.CastRange;
                    spell.SetTargetted(sd.DelayTotalTimePercent, sd.SpellCastTime);
                }
            }

            //initialize combo menu
            ComboConfig.AddBool("ComboQ", "Use Q", true);
            ComboConfig.AddBool("ComboW", "Use W", true);
            ComboConfig.AddBool("ComboE", "Use E", true);
            ComboConfig.AddBool("ComboR", "Use R", true);
        }
Exemplo n.º 4
0
        public Default()
        {
            Q = new LeagueSharp.Common.Spell(SpellSlot.Q, 600);
            W = new LeagueSharp.Common.Spell(SpellSlot.W, 450);
            E = new LeagueSharp.Common.Spell(SpellSlot.E, 200);
            R = new LeagueSharp.Common.Spell(SpellSlot.R, 600);

            var q = SpellData.GetSpellData(ObjectManager.Player.GetSpell(SpellSlot.Q).Name);
            var w = SpellData.GetSpellData(ObjectManager.Player.GetSpell(SpellSlot.W).Name);
            var e = SpellData.GetSpellData(ObjectManager.Player.GetSpell(SpellSlot.E).Name);
            var r = SpellData.GetSpellData(ObjectManager.Player.GetSpell(SpellSlot.R).Name);

            Q.SetSkillshot(q.SpellCastTime, q.LineWidth, q.MissileSpeed, true, SkillshotType.SkillshotLine);
            W.SetSkillshot(w.SpellCastTime, w.LineWidth, w.MissileSpeed, true, SkillshotType.SkillshotLine);
            E.SetTargetted(e.SpellCastTime, e.SpellCastTime);
            R.SetTargetted(r.SpellCastTime, r.SpellCastTime);
        }
Exemplo n.º 5
0
        public Default()
        {
            Author = "imsosharp";
            Q      = new Spell(SpellSlot.Q, 600);
            W      = new Spell(SpellSlot.W, 450);
            E      = new Spell(SpellSlot.E, 200);
            R      = new Spell(SpellSlot.R, 600);

            var q = SpellData.GetSpellData(ObjectHandler.Player.GetSpell(SpellSlot.Q).Name);
            var w = SpellData.GetSpellData(ObjectHandler.Player.GetSpell(SpellSlot.W).Name);
            var e = SpellData.GetSpellData(ObjectHandler.Player.GetSpell(SpellSlot.E).Name);
            var r = SpellData.GetSpellData(ObjectHandler.Player.GetSpell(SpellSlot.R).Name);

            Q.SetSkillshot(q.SpellCastTime, q.LineWidth, q.MissileSpeed, true, SkillshotType.SkillshotLine);
            W.SetSkillshot(w.SpellCastTime, w.LineWidth, w.MissileSpeed, true, SkillshotType.SkillshotLine);
            E.SetTargetted(e.SpellCastTime, e.SpellCastTime);
            R.SetTargetted(r.SpellCastTime, r.SpellCastTime);
        }
Exemplo n.º 6
0
Arquivo: Util.cs Projeto: issang2/AIM
        /// <summary>
        /// Returns a circle with center at hero position and radius of the highest impact range a hero has.
        /// </summary>
        /// <param name="hero">The target hero.</param>
        internal static Geometry.Circle GetChampionRangeCircle(Obj_AI_Hero hero)
        {
            var heroSpells = new List <SpellData>();

            heroSpells.Add(SpellData.GetSpellData(hero.GetSpell(SpellSlot.Q).Name));
            heroSpells.Add(SpellData.GetSpellData(hero.GetSpell(SpellSlot.W).Name));
            heroSpells.Add(SpellData.GetSpellData(hero.GetSpell(SpellSlot.E).Name));

            /*var ultimate = hero.GetSpell(SpellSlot.R);
             * var ultimateSpellData = SpellData.GetSpellData(ultimate.Name);
             * if (ultimate.IsReady() && ultimateSpellData.CastRange.FirstOrDefault() < 1500)
             * {
             *  heroSpells.Add(ultimateSpellData);
             * }*/
            var highestSpellRange =
                heroSpells.OrderBy(s => s.CastRange).FirstOrDefault().CastRange.OrderByDescending(lvl => Convert.ToInt32(lvl.ToString())).FirstOrDefault();

            return(new Geometry.Circle(hero.ServerPosition.To2D(), highestSpellRange > hero.AttackRange ? highestSpellRange : hero.AttackRange));
        }
Exemplo n.º 7
0
 /// <summary>
 /// Initialise les joueurs avec une potentielle sauvegarde et leur nombre.
 /// </summary>
 /// <param name="nbPlayers"> Le nombre de joueurs </param>
 /// <param name="save"> La potentielle sauvegarde </param>
 private void InitPlayers(int nbPlayers, GameSave save = null)
 {
     for (var i = 0; i < nbPlayers; ++i)
     {
         if (save == null)
         {
             _players.Add(new Knight(Map.PlayerSpawns[i], i));
         }
         else
         {
             _players.Add(new Knight(Map.PlayerSpawns[i], i, save.Stats[i]));
             var numSpell = 0;
             while (numSpell < save.Spells[i].Count)
             {
                 _players[i].CreateSpell(numSpell, SpellData.GetSpellData(save.Spells[i][numSpell].Id));
                 ++numSpell;
             }
         }
     }
 }
Exemplo n.º 8
0
        /// <summary>
        /// Retire les informations du fichier de sauvegarde donné pour obtenir le nom de la sauvegarde, le numéro de
        /// la carte, le niveau et score de la partie et, pour chaque joueur, ses statistiques et ses sorts.
        /// </summary>
        /// <param name="filePath"> Le fichier de sauvegarde </param>
        private GameSave(string filePath)
        {
            var file = new StreamReader(filePath);
            var line = file.ReadLine();

            // Debute par le nom de la sauvegarde
            Name = line;

            Stats  = new List <PlayerStats>();
            Spells = new List <List <SpellData> >();

            var numLine   = 0;
            var numPlayer = 0;

            while ((line = file.ReadLine()) != null)
            {
                ++numLine;
                // Ligne 1 : numéro de la map
                if (numLine == 1)
                {
                    NumMap = int.Parse(line);
                }
                // Ligne 2 : niveau de la sauvegarde
                else if (numLine == 2)
                {
                    Level = int.Parse(line);
                }
                // Ligne 3 : score initial des joueurs
                else if (numLine == 3)
                {
                    Score = int.Parse(line);
                }
                // Ligne 3 : nombre de joueurs
                else if (numLine == 4)
                {
                    NumberOfPlayers = int.Parse(line);
                    for (var i = 0; i < NumberOfPlayers; ++i)
                    {
                        Spells.Add(new List <SpellData>());
                    }
                }
                // Permière ligne des données d'un joueur : ses statistiques
                else if ((numLine - 5) % 2 == 0)
                {
                    Stats.Add(PlayerStats.Load(line));
                }
                // Seconde ligne des données d'un joueur : ses sorts
                else if ((numLine - 5) % 2 == 1)
                {
                    var args = line.Split(' ');
                    foreach (var id in args)
                    {
                        if (id != "")
                        {
                            Spells[numPlayer].Add(SpellData.GetSpellData(long.Parse(id)));
                        }
                    }
                    ++numPlayer;
                }
            }
            file.Close();
        }
Exemplo n.º 9
0
        private static void OnUpdate(EventArgs args)
        {
            // Check spell arrival
            foreach (var entry in IncDamage.Where(entry => entry.Key < Game.Time).ToArray())
            {
                IncDamage.Remove(entry.Key);
            }

            // Instant damage removal
            foreach (var entry in InstDamage.Where(entry => entry.Key < Game.Time).ToArray())
            {
                InstDamage.Remove(entry.Key);
            }
            foreach (var skillshot in Evade.Evade.GetSkillshotsAboutToHit(Player.Instance, 200))
            {
                AIHeroClient caster = null;
                foreach (var e in EntityManager.Heroes.Enemies.Where(t => t.ChampionName == skillshot.SpellData.ChampionName))
                {
                    caster = e;
                }
                if (caster != null && (skillshot.IsGlobal || caster.Distance(Player.Instance) <= skillshot.SpellData.Range + 50))
                {
                    if (Settings.useZhonyasDmg && (DamageLibrary.GetSpellDamage(caster, Player.Instance, skillshot.SpellData.Slot) > Settings.minDmgZhonyas / 100 * Player.Instance.MaxHealth))
                    {
                        if (castZhonyas())
                        {
                            return;
                        }
                    }
                    if (Settings.useSeraphsDmg && (DamageLibrary.GetSpellDamage(caster, Player.Instance, skillshot.SpellData.Slot) > Settings.minDmgSerpaphs / 100 * Player.Instance.MaxHealth))
                    {
                        if (castSeraphs())
                        {
                            return;
                        }
                    }
                    if (dangerousSpell(SpellData.GetSpellData(skillshot.SpellData.SpellName), caster))
                    {
                        if (Settings.useZhonyasDmg)
                        {
                            if (castZhonyas())
                            {
                                return;
                            }
                        }
                        if (Settings.useSeraphsDmg)
                        {
                            if (castSeraphs())
                            {
                                return;
                            }
                        }
                    }
                }
            }
            if (Settings.useZhonyasDmg)
            {
                if (Player.Instance.HealthPercent < 5 && Player.Instance.CountEnemiesInRange(500) > 0 ||
                    IncomingDamage > Player.Instance.Health || IncomingDamage > Player.Instance.MaxHealth * Settings.minDmgZhonyas / 100)
                {
                    if (castZhonyas())
                    {
                        return;
                    }
                }
            }
            if (Settings.useSeraphsDmg)
            {
                if (Player.Instance.HealthPercent < 5 && Player.Instance.CountEnemiesInRange(500) > 0 ||
                    IncomingDamage > Player.Instance.Health || IncomingDamage > Player.Instance.MaxMana * 0.2 ||
                    IncomingDamage > Player.Instance.MaxHealth * Settings.minDmgZhonyas / 100)
                {
                    if (castSeraphs())
                    {
                        return;
                    }
                }
            }
        }