/// <summary>
        ///     Checks if healthrelic or traps are created and add them to the list.
        /// </summary>
        public static void GameObject_OnCreate(GameObject sender, EventArgs args)
        {
            var caster = sender as Obj_AI_Base;

            if (caster != null)
            {
                if (TrapsNames.Contains(sender.Name) && sender.IsEnemy)
                {
                    var trap = new traps {
                        Trap = caster, IsSpecial = false
                    };
                    EnemyTraps.Add(trap);
                    Logger.Send("Create " + sender.Name, Logger.LogLevel.Info);
                } /*
                   * if (SpecialTrapsNames.Contains(caster.Name) && caster.IsEnemy)
                   * {
                   * var trap = new traps { Trap = caster, IsSpecial = true };
                   * EnemyTraps.Add(trap);
                   * Logger.Send("Create " + sender.Name, Logger.LogLevel.Info);
                   * }*/
            }
            if (sender.Name.ToLower().Contains("healthrelic"))
            {
                HealthRelics.Add(sender);
                Logger.Send("Create  " + sender.Name, Logger.LogLevel.Info);
            }
        }
Exemple #2
0
        public static void Init()
        {
            // Clears and adds new HealthRelics and bardhealthshrines.
            HealthRelics.Clear();
            foreach (var hr in ObjectManager.Get <GameObject>().Where(o => o != null && o.Name.ToLower().Contains("healthrelic") && o.IsValid && !o.IsDead))
            {
                var validrelic = ObjectManager.GetUnitByNetworkId <Obj_AI_Base>((uint)hr.NetworkId)?.PredictHealth() > 0;
                if (validrelic)
                {
                    HealthRelics.Add(hr);
                }
            }

            // Clears and adds new EnemyTraps.
            EnemyTraps.Clear();
            foreach (var trap in ObjectManager.Get <Obj_AI_Minion>().Where(trap => trap.IsEnemy && !trap.IsDead && trap.IsValid))
            {
                if (TrapsNames.Contains(trap.Name))
                {
                    var ttrap = new traps {
                        Trap = trap, IsSpecial = false
                    };
                    EnemyTraps.Add(ttrap);
                } /*
                   * if (SpecialTrapsNames.Contains(trap.Name))
                   * {
                   * var ttrap = new traps { Trap = trap, IsSpecial = true };
                   * EnemyTraps.Add(ttrap);
                   * }*/
            }

            var lastupdate = 0f;

            Game.OnTick += delegate
            {
                if (Core.GameTickCount - lastupdate > Misc.ProtectFPS + 200)
                {
                    foreach (var bardhs in ObjectManager.Get <GameObject>()
                             .Where(o => o.Name.Equals("bardhealthshrine", StringComparison.CurrentCultureIgnoreCase) && o.IsAlly && o.IsValid && !o.IsDead && !HealthRelics.Contains(o)))
                    {
                        HealthRelics.Add(bardhs);
                        if (Config.EnableDebug)
                        {
                            Logger.Send("Added " + bardhs.Name);
                        }
                    }

                    // Removes HealthRelics and Enemy Traps.
                    HealthRelics.RemoveAll(h => h == null || !h.IsValid || h.IsDead || EntityManager.Heroes.AllHeroes.Any(a => a.IsValidTarget() && a.Distance(h) <= a.BoundingRadius + h.BoundingRadius));
                    EnemyTraps.RemoveAll(t => t.Trap == null || !t.Trap.IsValid || t.Trap.IsDead || EntityManager.Heroes.Allies.Any(a => a.IsValidTarget() && a.Distance(t.Trap) <= a.BoundingRadius + t.Trap.BoundingRadius));
                    lastupdate = Core.GameTickCount;
                    ZacPassives.RemoveAll(p => p.IsDead || !p.IsValid);
                }
            };

            GameObject.OnCreate += GameObject_OnCreate;
            GameObject.OnDelete += GameObject_OnDelete;
        }
Exemple #3
0
        /// <summary>
        ///     Checks if healthrelic or traps are created and add them to the list.
        /// </summary>
        public static void GameObject_OnCreate(GameObject sender, EventArgs args)
        {
            var @base = sender as Obj_AI_Base;

            if (@base != null && @base.BaseSkinName.Equals("OlafAxe") || sender.Name.Contains("Olaf_Base_Q_Axe_Ally"))
            {
                OlafAxeObject = new Objects.OlafAxe(sender);
            }

            if (sender.Name.Contains("Draven_Base_Q_reticle_self"))
            {
                if (!DravenAxes.Any(a => a.Axe.IdEquals(sender)))
                {
                    DravenAxes.Add(new Objects.DravenAxe(sender));
                }
            }

            if (sender.GetType() == typeof(Obj_GeneralParticleEmitter))
            {
                var gameObject = (Obj_GeneralParticleEmitter)sender;
                if (ZacPassiveNames.Contains(gameObject.Name) && !ZacPassives.Contains(gameObject) && Player.Instance.Hero == Champion.Zac)
                {
                    ZacPassives.Add(gameObject);
                    Logger.Send("Create " + gameObject.Name);
                }
            }

            var caster = sender as Obj_AI_Base;

            if (caster != null)
            {
                if (TrapsNames.Contains(sender.Name) && sender.IsEnemy)
                {
                    var trap = new traps {
                        Trap = caster, IsSpecial = false
                    };
                    EnemyTraps.Add(trap);
                    Logger.Send("Create " + sender.Name);
                } /*
                   * if (SpecialTrapsNames.Contains(caster.Name) && caster.IsEnemy)
                   * {
                   * var trap = new traps { Trap = caster, IsSpecial = true };
                   * EnemyTraps.Add(trap);
                   * Logger.Send("Create " + sender.Name);
                   * }*/
            }
            if (sender.Name.ToLower().Contains("healthrelic"))
            {
                HealthRelics.Add(sender);
                Logger.Send("Create " + sender.Name);
            }
        }
Exemple #4
0
        /// <summary>
        ///     Checks if healthrelic is created and add it to the list.
        /// </summary>
        public static void GameObject_OnCreate(GameObject sender, EventArgs args)
        {
            if (sender.Name.ToLower().Contains("healthrelic"))
            {
                HealthRelics.Add(sender);
                Chat.Print("create healthrelic");
            }

            if (TrapsNames.Contains(sender.Name) && sender.IsEnemy)
            {
                Chat.Print("create trap");
                EnemyTraps.Add((Obj_AI_Minion)sender);
            }
        }
        public static void Init()
        {
            // Clears and adds new HealthRelics and bardhealthshrines.
            HealthRelics.Clear();
            foreach (var hr in ObjectManager.Get <GameObject>().Where(o => o != null && o.Name.ToLower().Contains("healthrelic") && o.IsValid && !o.IsDead))
            {
                HealthRelics.Add(hr);
            }

            // Clears and adds new EnemyTraps.
            EnemyTraps.Clear();
            foreach (var trap in ObjectManager.Get <Obj_AI_Minion>().Where(trap => trap.IsEnemy && !trap.IsDead && trap.IsValid))
            {
                if (TrapsNames.Contains(trap.Name))
                {
                    var ttrap = new traps {
                        Trap = trap, IsSpecial = false
                    };
                    EnemyTraps.Add(ttrap);
                } /*
                   * if (SpecialTrapsNames.Contains(trap.Name))
                   * {
                   * var ttrap = new traps { Trap = trap, IsSpecial = true };
                   * EnemyTraps.Add(ttrap);
                   * }*/
            }

            Game.OnTick += delegate
            {
                HealthRelics.AddRange(
                    ObjectManager.Get <GameObject>()
                    .Where(o => o.Name.Equals("bardhealthshrine", StringComparison.CurrentCultureIgnoreCase) && o.IsAlly && o.IsValid && !o.IsDead)
                    .Where(hr => hr != null && !HealthRelics.Contains(hr) && Logger.Send("Added " + hr.Name, Logger.LogLevel.Info)));

                // Removes HealthRelics and Enemy Traps.

                HealthRelics.RemoveAll(h => h == null || !h.IsValid || h.IsDead || EntityManager.Heroes.AllHeroes.Any(a => !a.IsDead && a.IsValidTarget() && a.Distance(h) <= a.BoundingRadius + h.BoundingRadius));
                EnemyTraps.RemoveAll(t => t.Trap == null || !t.Trap.IsValid || t.Trap.IsDead || EntityManager.Heroes.Allies.Any(a => !a.IsDead && a.IsValidTarget() && a.Distance(t.Trap) <= a.BoundingRadius + t.Trap.BoundingRadius));
            };

            GameObject.OnCreate += GameObject_OnCreate;
            GameObject.OnDelete += GameObject_OnDelete;
        }
Exemple #6
0
        /// <summary>
        ///     Checks if healthrelic or traps are created and add them to the list.
        /// </summary>
        public static void GameObject_OnCreate(GameObject sender, EventArgs args)
        {
            if (sender.GetType() == typeof(Obj_GeneralParticleEmitter))
            {
                var gameObject = (Obj_GeneralParticleEmitter)sender;
                if (ZacPassiveNames.Contains(gameObject.Name) && !ZacPassives.Contains(gameObject) && Player.Instance.Hero == Champion.Zac)
                {
                    ZacPassives.Add(gameObject);
                    Logger.Send("Create " + gameObject.Name);
                }
            }

            var caster = sender as Obj_AI_Base;

            if (caster != null)
            {
                if (TrapsNames.Contains(sender.Name) && sender.IsEnemy)
                {
                    var trap = new traps {
                        Trap = caster, IsSpecial = false
                    };
                    EnemyTraps.Add(trap);
                    Logger.Send("Create " + sender.Name);
                } /*
                   * if (SpecialTrapsNames.Contains(caster.Name) && caster.IsEnemy)
                   * {
                   * var trap = new traps { Trap = caster, IsSpecial = true };
                   * EnemyTraps.Add(trap);
                   * Logger.Send("Create " + sender.Name);
                   * }*/
            }
            if (sender.Name.ToLower().Contains("healthrelic"))
            {
                HealthRelics.Add(sender);
                Logger.Send("Create " + sender.Name);
            }
        }