Exemplo n.º 1
0
 private static void TriggerOnDetectSkillshot(
     DetectionType detectionType,
     SpellData spellData,
     int startT,
     Vector2 start,
     Vector2 end,
     Obj_AI_Base unit)
 {
     if (OnDetectSkillshot != null)
     {
         OnDetectSkillshot(new Skillshot(detectionType, spellData, startT, start, end, unit));
     }
 }
Exemplo n.º 2
0
        private static void ObjSpellMissileOnCreate(GameObject sender, EventArgs args)
        {
            var missile = sender as MissileClient;
            if (missile == null || !missile.IsValid)
            {
                return;
            }
            var caster = missile.SpellCaster as AIHeroClient;
            if (caster == null || !caster.IsValid || caster.Team == ObjectManager.Player.Team || !(missile.Target != null && missile.Target.IsMe))
            {
                return;
            }

            var spellData = Spells.FirstOrDefault(i => i.SpellNames.Contains(missile.SData.Name.ToLower()) && evadeMenu[i.MissileName] != null ? getCheckBoxItem(evadeMenu, i.MissileName) : false);
            if (spellData == null && Orbwalking.IsAutoAttack(missile.SData.Name) && (!missile.SData.Name.ToLower().Contains("crit")
                        ? getCheckBoxItem(evadeMenu, "B")
                          && ObjectManager.Player.HealthPercent < getSliderItem(evadeMenu, "BHpU")
                        : getCheckBoxItem(evadeMenu, "C")
                          && ObjectManager.Player.HealthPercent < getSliderItem(evadeMenu, "CHpU")))
            {
                spellData = new SpellData { ChampionName = caster.ChampionName, SpellNames = new[] { missile.SData.Name } };
            }
            if (spellData == null)
            {
                return;
            }
            DetectedTargets.Add(new Targets { Start = caster.ServerPosition, Obj = missile });
        }
Exemplo n.º 3
0
 private static void ObjSpellMissileOnCreate(GameObject sender, EventArgs args)
 {
     var missile = sender as MissileClient;
     if (missile == null || !missile.IsValid)
     {
         return;
     }
     var caster = missile.SpellCaster as Obj_AI_Hero;
     if (caster == null || !caster.IsValid || caster.Team == Player.Team || !(missile.Target != null && missile.Target.IsMe))
     {
         return;
     }
     var spellData =
         Spells.FirstOrDefault(
             i =>
             i.SpellNames.Contains(missile.SData.Name.ToLower())
             && Menu.SubMenu("EvadeTarget").SubMenu(i.ChampionName.ToLowerInvariant()).Item(i.MissileName).GetValue<bool>());
     if (spellData == null && Orbwalking.IsAutoAttack(missile.SData.Name)
         && (!missile.SData.Name.ToLower().Contains("crit")
                 ? Menu.SubMenu("EvadeTarget").SubMenu("AA").Item("B").GetValue<bool>()
                   && Player.HealthPercent < Menu.SubMenu("EvadeTarget").SubMenu("AA").Item("BHpU").GetValue<Slider>().Value
                 : Menu.SubMenu("EvadeTarget").SubMenu("AA").Item("C").GetValue<bool>()
                   && Player.HealthPercent < Menu.SubMenu("EvadeTarget").SubMenu("AA").Item("CHpU").GetValue<Slider>().Value))
     {
         spellData = new SpellData { ChampionName = caster.ChampionName, SpellNames = new[] { missile.SData.Name } };
     }
     if (spellData == null)
     {
         return;
     }
     DetectedTargets.Add(new Targets { Start = caster.ServerPosition, Obj = missile });
 }
Exemplo n.º 4
0
 public Skillshot(
     DetectionType detectionType,
     SpellData spellData,
     int startT,
     Vector2 start,
     Vector2 end,
     Obj_AI_Base unit)
 {
     this.DetectionType = detectionType;
     this.SpellData = spellData;
     this.StartTick = startT;
     this.Start = start;
     this.End = end;
     this.Direction = (end - start).Normalized();
     this.Unit = unit;
     switch (spellData.Type)
     {
         case SkillShotType.SkillshotCircle:
             this.Circle = new Geometry.Circle(this.CollisionEnd, spellData.Radius);
             break;
         case SkillShotType.SkillshotLine:
             this.Rectangle = new Geometry.Rectangle(this.Start, this.CollisionEnd, spellData.Radius);
             break;
         case SkillShotType.SkillshotMissileLine:
             this.Rectangle = new Geometry.Rectangle(this.Start, this.CollisionEnd, spellData.Radius);
             break;
         case SkillShotType.SkillshotCone:
             this.Sector = new Geometry.Sector(
                 start,
                 this.CollisionEnd - start,
                 spellData.Radius * (float)Math.PI / 180,
                 spellData.Range);
             break;
         case SkillShotType.SkillshotRing:
             this.Ring = new Geometry.Ring(this.CollisionEnd, spellData.Radius, spellData.RingRadius);
             break;
         case SkillShotType.SkillshotArc:
             this.Arc = new Geometry.Arc(
                 start,
                 end,
                 Config.SkillShotsExtraRadius + (int)ObjectManager.Player.BoundingRadius);
             break;
     }
     this.UpdatePolygon();
 }