Ejemplo n.º 1
0
        /// <summary>
        /// Properly updates the Mercurial buff count
        /// </summary>
        /// <param name="player"></param>
        internal static void CheckMercurial(Obj_AI_Hero player)
        {
            foreach (var hero in Activator.Heroes.Where(x => x.Player.NetworkId == player.NetworkId))
            {
                hero.MercurialBuffCount = Buffs.GetAuras(hero.Player, "Mercurial").Count();

                if (hero.MercurialBuffCount > 0)
                {
                    foreach (var buff in Buffs.GetAuras(hero.Player, "Mercurial"))
                    {
                        var duration = (int)(buff.EndTime - buff.StartTime);
                        if (duration > hero.MercurialHighestBuffTime)
                        {
                            hero.MercurialHighestBuffTime = duration * 1000;
                        }
                    }

                    hero.LastDebuffTimestamp = Utils.GameTimeTickCount;
                }

                else
                {
                    if (hero.MercurialHighestBuffTime > 0)
                    {
                        hero.MercurialHighestBuffTime -= hero.MercurialHighestBuffTime;
                    }
                    else
                    {
                        hero.MercurialHighestBuffTime = 0;
                    }
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Properly updates the QSS buff count
        /// </summary>
        /// <param name="player"></param>
        internal static void CheckQSS(AIHeroClient player)
        {
            foreach (var hero in Activator.Heroes.Where(x => x.Player.NetworkId == player.NetworkId))
            {
                hero.QSSBuffCount = Buffs.GetAuras(hero.Player, "Quicksilver").Count();

                if (hero.QSSBuffCount > 0)
                {
                    foreach (var buff in Buffs.GetAuras(hero.Player, "Quicksilver"))
                    {
                        var duration = (int)(buff.EndTime - buff.StartTime);
                        if (duration > hero.QSSHighestBuffTime)
                        {
                            hero.QSSHighestBuffTime = duration * 1000;
                        }
                    }

                    hero.LastDebuffTimestamp = Utils.GameTimeTickCount;
                }

                else
                {
                    if (hero.QSSHighestBuffTime > 0)
                    {
                        hero.QSSHighestBuffTime -= hero.QSSHighestBuffTime;
                    }
                    else
                    {
                        hero.QSSHighestBuffTime = 0;
                    }
                }
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Properly updates the Mikaels buff count
        /// </summary>
        /// <param name="player"></param>
        internal static void CheckMikaels(Obj_AI_Hero player)
        {
            foreach (var hero in Activator.Heroes.Where(x => x.Player.NetworkId == player.NetworkId))
            {
                hero.MikaelsBuffCount = Buffs.GetAuras(hero.Player, "Mikaels").Count();

                if (hero.MikaelsBuffCount > 0)
                {
                    foreach (var buff in Buffs.GetAuras(hero.Player, "Mikaels"))
                    {
                        var duration = (int)(buff.EndTime - buff.StartTime);
                        if (duration > hero.MikaelsHighestBuffTime)
                        {
                            hero.MikaelsHighestBuffTime = duration * 1000;
                        }
                    }

                    hero.LastDebuffTimestamp = Utils.GameTimeTickCount;
                }

                else
                {
                    if (hero.MikaelsHighestBuffTime > 0)
                    {
                        hero.MikaelsHighestBuffTime -= hero.MikaelsHighestBuffTime;
                    }
                    else
                    {
                        hero.MikaelsHighestBuffTime = 0;
                    }
                }

                foreach (var aura in Auradata.BuffList.Where(au => hero.Player.HasBuff(au.Name)))
                {
                    if (aura.DoT && hero.Player.Health / hero.Player.MaxHealth * 100 <=
                        Activator.Origin.Item("useMikaelsdot").GetValue <Slider>().Value)
                    {
                        hero.ForceQSS = true;
                        Utility.DelayAction.Add(100, () => hero.ForceQSS = false);
                    }
                }
            }
        }