Ejemplo n.º 1
0
 internal static void TriggerOnPredictDamage(Unit unit, PredictDamageEventArgs args)
 {
     try
     {
         OnPredictDamage?.Invoke(unit, args);
     }
     catch (Exception e)
     {
         if (Menu["logerror"].As <MenuBool>().Enabled)
         {
             Console.WriteLine("== Error at ZLib.TriggerOnPredictDamage");
             Console.WriteLine(e);
         }
     }
 }
Ejemplo n.º 2
0
        public static int AddDamage(HPInstance hpi, Base.Champion hero, string notes)
        {
            Id++;
            var id = Id;

            var aiHero = Activator.Allies().Find(x => x.Player.NetworkId == hero.Player.NetworkId);

            if (aiHero != null && !IncomeDamage.ContainsKey(id))
            {
                aiHero.Attacker = hpi.Attacker;
                if (aiHero.Player.IsValidTarget(float.MaxValue, false) && !aiHero.Player.IsZombie)
                {
                    bool checkmenu = false;

                    switch (hpi.HitType)
                    {
                    case HitType.Spell:
                        aiHero.AbilityDamage += hpi.PredictedDmg;
                        aiHero.HitTypes.Add(HitType.Spell);
                        checkmenu = true;
                        break;

                    case HitType.Buff:
                        aiHero.BuffDamage += hpi.PredictedDmg;
                        aiHero.HitTypes.Add(HitType.Buff);
                        if (notes == "aura.Evade")
                        {
                            aiHero.HitTypes.Add(HitType.Ultimate);
                        }
                        break;

                    case HitType.Troy:
                        aiHero.TroyDamage += hpi.PredictedDmg;
                        aiHero.HitTypes.Add(HitType.Troy);
                        aiHero.HitTypes.AddRange(hpi.Data.HitTypes);
                        break;

                    case HitType.Item:
                        aiHero.ItemDamage += hpi.PredictedDmg;
                        aiHero.HitTypes.Add(HitType.Spell);
                        break;

                    case HitType.TurretAttack:
                        aiHero.TowerDamage += hpi.PredictedDmg;
                        aiHero.HitTypes.Add(HitType.TurretAttack);
                        break;

                    case HitType.MinionAttack:
                        aiHero.MinionDamage += hpi.PredictedDmg;
                        aiHero.HitTypes.Add(HitType.MinionAttack);
                        break;

                    case HitType.AutoAttack:
                        aiHero.AbilityDamage += hpi.PredictedDmg;
                        aiHero.HitTypes.Add(HitType.AutoAttack);
                        break;

                    case HitType.Stealth:
                        aiHero.HitTypes.Add(HitType.Stealth);
                        break;
                    }

                    if (notes == "debug.Test")
                    {
                        if (!Activator.Origin.Item("acdebug").GetValue <bool>())
                        {
                            Chat.Print("<b><font color=\"#FF3366\">Activator#</font></b> - Damage debugging is not enabled!");
                            return(id);
                        }

                        aiHero.AbilityDamage += hpi.PredictedDmg;
                        aiHero.HitTypes.Add(hpi.HitType);
                    }

                    if (checkmenu && !string.IsNullOrEmpty(hpi.Name)) // QWER Only
                    {
                        if (notes != "debug.Test")
                        {
                            // add spell flags
                            hero.HitTypes.AddRange(
                                Lists.MenuTypes.Where(
                                    x => Activator.Origin.Item(
                                        hpi.Name.ToLower() + x.ToString().ToLower()).GetValue <bool>()));
                        }
                    }

                    if (hpi.HitType == HitType.Stealth)
                    {
                        hpi.PredictedDmg = 0;
                    }

                    if (Activator.Origin.Item("acdebug").GetValue <bool>())
                    {
                        Console.WriteLine(
                            hpi.TargetHero.ChampionName + " << [added]: " + hpi.Name + " - "
                            + hpi.PredictedDmg + " / " + hpi.HitType + " / " + notes);
                    }

                    hpi.Id = id;
                    OnPredictDamage?.Invoke();
                    IncomeDamage.Add(id, hpi);
                }
            }

            return(id);
        }
Ejemplo n.º 3
0
        public static int AddDamage(HPInstance hpi, Champion hero, string notes)
        {
            Id++;
            var id = Id;

            var aiHero = Activator.Allies().Find(x => x.Player.NetworkId == hero.Player.NetworkId);

            if (aiHero != null && !IncomeDamage.ContainsKey(id))
            {
                bool checkmenu = false;

                switch (hpi.HitType)
                {
                case HitType.Spell:
                    aiHero.AbilityDamage += hpi.PredictedDmg;
                    aiHero.HitTypes.Add(HitType.Spell);
                    checkmenu = true;
                    break;

                case HitType.Buff:
                    aiHero.BuffDamage += hpi.PredictedDmg;
                    aiHero.HitTypes.Add(HitType.Buff);
                    break;

                case HitType.Troy:
                    aiHero.TroyDamage += hpi.PredictedDmg;
                    aiHero.HitTypes.Add(HitType.Troy);
                    checkmenu = true;
                    break;

                case HitType.Item:
                    aiHero.ItemDamage += hpi.PredictedDmg;
                    aiHero.HitTypes.Add(HitType.Spell);
                    break;

                case HitType.TurretAttack:
                    aiHero.TowerDamage += hpi.PredictedDmg;
                    aiHero.HitTypes.Add(HitType.TurretAttack);
                    break;

                case HitType.MinionAttack:
                    aiHero.MinionDamage += hpi.PredictedDmg;
                    aiHero.HitTypes.Add(HitType.MinionAttack);
                    break;

                case HitType.AutoAttack:
                    aiHero.AbilityDamage += hpi.PredictedDmg;
                    aiHero.HitTypes.Add(HitType.AutoAttack);
                    break;

                case HitType.Stealth:
                    aiHero.HitTypes.Add(HitType.Stealth);
                    checkmenu = true;
                    break;
                }

                if (checkmenu && !string.IsNullOrEmpty(hpi.Name)) // QWER Only
                {
                    // add spell flags
                    hero.HitTypes.AddRange(
                        Lists.MenuTypes.Where(
                            x => Activator.Origin.Item(
                                hpi.Name.ToLower() + x.ToString().ToLower()).GetValue <bool>()));
                }

                if (hpi.HitType == HitType.Stealth)
                {
                    hpi.PredictedDmg = 0;
                }

                if (Activator.Origin.Item("acdebug").GetValue <bool>())
                {
                    Console.WriteLine(hpi.TargetHero.ChampionName + " [added]: " + hpi.Name + " - "
                                      + hpi.PredictedDmg + " / " + hpi.HitType + " / " + notes);
                }

                if (hero.Player.IsValidTarget(float.MaxValue, false))
                {
                    hpi.Id = id;
                    OnPredictDamage?.Invoke();
                    IncomeDamage.Add(id, hpi);
                }
            }

            return(id);
        }