コード例 #1
0
        private static void OnUpdate(EventArgs args)
        {
            // SoulBound is not found yet!
            if (SoulBound == null)
            {
                // TODO: Get the buff display name, I'm not at home so I needed to use xQx' method, which I don't like :D
                SoulBound = HeroManager.Allies.Find(h => h.Buffs.Any(b => b.Caster.IsMe && b.Name.Contains("kalistacoopstrikeally")));
            }
            else if (Settings.SaveSouldBound && R.IsReady())
            {
                // Ult casting
                if (SoulBound.HealthPercentage() < 5 && SoulBound.CountEnemiesInRange(500) > 0 ||
                    IncomingDamage > SoulBound.Health)
                {
                    R.Cast();
                }
                // Get enemies
                foreach (var unit in ObjectManager.Get <Obj_AI_Hero>().Where(h => h.IsEnemy && h.IsHPBarRendered))
                {
                    // Get buffs
                    for (int i = 0; i < unit.Buffs.Count(); i++)
                    {
                        // Check if the Soulbound is in a good range
                        var enemy = HeroManager.Enemies.Where(x => SoulBound.Distance(x.Position) > 800);
                        // Check if the Soulbound is a Blitzcrank
                        // Check if the enemy is hooked
                        // Check if target was far enough for ult
                        if (SoulBound.ChampionName == "Blitzcrank" && unit.Buffs[i].Name == "rocketgrab2" && unit.Buffs[i].IsActive && enemy.Count() > 0 && Config.Misc.UseKaliscrank)
                        {
                            R.Cast();
                        }
                    }
                }
            }

            // Check spell arrival
            foreach (var entry in _incomingDamage)
            {
                if (entry.Key < Game.Time)
                {
                    _incomingDamage.Remove(entry.Key);
                }
            }

            // Instant damage removal
            foreach (var entry in _instantDamage)
            {
                if (entry.Key < Game.Time)
                {
                    _instantDamage.Remove(entry.Key);
                }
            }
        }
コード例 #2
0
ファイル: SoulBoundSaver.cs プロジェクト: entiecs/LeagueSharp
        private static void OnUpdate(EventArgs args)
        {
            // SoulBound is not found yet!
            if (SoulBound == null)
            {
                // TODO: Get the buff display name, I'm not at home so I needed to use xQx' method, which I don't like :D
                SoulBound = HeroManager.Allies.Find(h => h.Buffs.Any(b => b.Caster.IsMe && b.Name.Contains("kalistacoopstrikeally")));
            }
            else if (Settings.SaveSouldBound && R.IsReady())
            {
                // Ult casting
                if (SoulBound.HealthPercentage() < 5 && SoulBound.CountEnemiesInRange(500) > 0 ||
                    IncomingDamage > SoulBound.Health)
                {
                    R.Cast();
                }
            }

            // Check spell arrival
            foreach (var entry in _incomingDamage)
            {
                if (entry.Key < Game.Time)
                {
                    _incomingDamage.Remove(entry.Key);
                }
            }

            // Instant damage removal
            foreach (var entry in _instantDamage)
            {
                if (entry.Key < Game.Time)
                {
                    _instantDamage.Remove(entry.Key);
                }
            }
        }