Beispiel #1
0
        static void MissileClient_OnCreate_Delayed(MissileClient missile, SpellDatabaseEntry spellDatabaseEntry)
        {
            if (!missile.IsValid || !missile.SpellCaster.IsValid)
            {
                return;
            }

            var castTime = Variables.TickCount - Game.Ping / 2 - (spellDatabaseEntry.MissileDelayed ? 0 : spellDatabaseEntry.Delay) -
                           (int)(1000f * missile.Position.Distance(missile.StartPosition) / spellDatabaseEntry.MissileSpeed);

            TriggerOnDetectSkillshot(spellDatabaseEntry, missile.SpellCaster, SkillshotDetectionType.MissileCreate, missile.StartPosition.ToVector2(), missile.EndPosition.ToVector2(), castTime, missile);
        }
Beispiel #2
0
 public SkillshotRing(SpellDatabaseEntry entry)
     : base(entry)
 {
 }
 public SkillshotMissile(SpellDatabaseEntry entry)
     : base(entry)
 {
 }
Beispiel #4
0
 public BaseSpell(SpellDatabaseEntry entry)
 {
     this.SData = entry;
 }
Beispiel #5
0
 public SkillshotCone(SpellDatabaseEntry entry)
     : base(entry)
 {
 }
 public SkillshotMissile(SpellDatabaseEntry entry)
     : base(entry)
 {
 }
Beispiel #7
0
 public SkillshotCircle(SpellDatabaseEntry entry)
     : base(entry)
 {
 }
Beispiel #8
0
        private static void TriggerOnDetectSkillshot(
            SpellDatabaseEntry spellDatabaseEntry,
            Obj_AI_Base caster,
            SkillshotDetectionType detectionType,
            Vector2 start,
            Vector2 end,
            int time,
            MissileClient missile = null)
        {
            Skillshot skillshot = null;

            switch (spellDatabaseEntry.SpellType)
            {
            case SpellType.SkillshotMissileArc:
                skillshot = new SkillshotMissileArc(spellDatabaseEntry);
                break;

            case SpellType.SkillshotMissileCircle:
                skillshot = new SkillshotMissileCircle(spellDatabaseEntry);
                break;

            case SpellType.SkillshotMissileLine:
                skillshot = new SkillshotMissileLine(spellDatabaseEntry);
                break;

            case SpellType.SkillshotCircle:
                skillshot = new SkillshotCircle(spellDatabaseEntry);
                break;

            case SpellType.SkillshotCone:
                skillshot = new SkillshotCone(spellDatabaseEntry);
                break;

            case SpellType.SkillshotLine:
                skillshot = new SkillshotLine(spellDatabaseEntry);
                break;

            case SpellType.SkillshotRing:
                skillshot = new SkillshotRing(spellDatabaseEntry);
                break;
            }

            if (skillshot == null)
            {
                return;
            }

            var type =
                Type.GetType(
                    $"LeagueSharp.SDK.Core.Wrappers.Spells.Detector.Skillshots_{skillshot.SData.ChampionName}{skillshot.SData.Slot}");

            if (type != null)
            {
                skillshot = (Skillshot)Activator.CreateInstance(type);
            }

            skillshot.DetectionType = detectionType;
            skillshot.Caster        = caster;
            skillshot.StartPosition = start;
            skillshot.EndPosition   = end;
            skillshot.StartTime     = time;

            if (missile != null)
            {
                try
                {
                    ((SkillshotMissile)skillshot).Missile = missile;
                }
                catch (Exception)
                {
                    LogManager.GetCurrentClassLogger()
                    .Warn(
                        $"Wrong SpellType for SkillShot {skillshot.SData.SpellName}, a missile type was expected but instead got a {missile.GetType().Name}.");
                }
            }

            if (!skillshot.Process())
            {
                return;
            }

            TriggerOnDetectSkillshot(skillshot);
        }
Beispiel #9
0
        static void MissileClient_OnCreate_Delayed(MissileClient missile, SpellDatabaseEntry spellDatabaseEntry)
        {
            if (!missile.IsValid || !missile.SpellCaster.IsValid)
            {
                return;
            }

            var castTime = Variables.TickCount - Game.Ping / 2 - (spellDatabaseEntry.MissileDelayed ? 0 : spellDatabaseEntry.Delay) -
                           (int)(1000f * missile.Position.Distance(missile.StartPosition) / spellDatabaseEntry.MissileSpeed);

            TriggerOnDetectSkillshot(spellDatabaseEntry, missile.SpellCaster, SkillshotDetectionType.MissileCreate, missile.StartPosition.ToVector2(), missile.EndPosition.ToVector2(), castTime, missile);
        }
Beispiel #10
0
        private static void TriggerOnDetectSkillshot(SpellDatabaseEntry spellDatabaseEntry, Obj_AI_Base caster, SkillshotDetectionType detectionType, Vector2 start, Vector2 end, int time, MissileClient missile = null)
        {
            Skillshot skillshot = null;

            switch (spellDatabaseEntry.SpellType)
            {
                case SpellType.SkillshotMissileArc:
                    skillshot = new SkillshotMissileArc(spellDatabaseEntry);
                    break;
                case SpellType.SkillshotMissileCircle:
                    skillshot = new SkillshotMissileCircle(spellDatabaseEntry);
                    break;
                case SpellType.SkillshotMissileLine:
                    skillshot = new SkillshotMissileLine(spellDatabaseEntry);
                    break;
                case SpellType.SkillshotCircle:
                    skillshot = new SkillshotCircle(spellDatabaseEntry);
                    break;
                case SpellType.SkillshotCone:
                    skillshot = new SkillshotCone(spellDatabaseEntry);
                    break;
                case SpellType.SkillshotLine:
                    skillshot = new SkillshotLine(spellDatabaseEntry);
                    break;
                case SpellType.SkillshotRing:
                    skillshot = new SkillshotRing(spellDatabaseEntry);
                    break;
            }
            
            if (skillshot == null)
            {
                return;
            }

            var type =
                    Type.GetType(
                        $"LeagueSharp.SDK.Core.Wrappers.Spells.Detector.Skillshots_{skillshot.SData.ChampionName}{skillshot.SData.Slot}");
            if (type != null)
            {
                skillshot = (Skillshot)Activator.CreateInstance(type);
            }

            skillshot.DetectionType = detectionType;
            skillshot.Caster = caster;
            skillshot.StartPosition = start;
            skillshot.EndPosition = end;
            skillshot.StartTime = time;

            if (missile != null)
            {
                try
                {
                    ((SkillshotMissile)skillshot).Missile = missile;
                }
                catch (Exception ex)
                {
                    Logging.Write()(Enumerations.LogLevel.Warn, "Wrong SpellType for Skillshot {0}, a Missile Type was expected", skillshot.SData.SpellName);
                }
                
            }

            if (!skillshot.Process())
            {
                return;
            }

            TriggerOnDetectSkillshot(skillshot);
        }
 public SkillshotLine(SpellDatabaseEntry entry)
     : base(entry)
 {
 }
Beispiel #12
0
 public SkillshotRing(SpellDatabaseEntry entry)
     : base(entry)
 {
 }
Beispiel #13
0
 public BaseSpell(string spellName)
 {
     this.SData = SpellDatabase.GetByName(spellName);
 }
 public BaseSpell(SpellDatabaseEntry entry)
 {
     this.SData = entry;
 }