Пример #1
0
 private static void ProcessSpell_jayceshockblast(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
 {
     if (spellData.spellName == "jayceshockblast")
     {
     }
 }
Пример #2
0
        private static void ProcessSpell_XerathArcanopulse2(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
        {
            if (args.SData.Name == "XerathArcanopulseChargeUp")// || spellData.spellName == "xeratharcanopulse2")
            {
                var castTime = -1 * (hero.Spellbook.CastTime - Game.Time) * 1000;

                if (castTime > 0)
                {
                    var dir    = (args.End.To2D() - args.Start.To2D()).Normalized();
                    var endPos = args.Start.To2D() + dir * Math.Min(spellData.range, 750 + castTime / 2);
                    SpellDetector.CreateSpellData(hero, args.Start, endPos.To3D(), spellData);
                }

                specialSpellArgs.noProcess = true;
            }
        }
Пример #3
0
        private static void ProcessSpell_JarvanIVDragonStrike(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
        {
            if (args.SData.Name == "JarvanIVDragonStrike")
            {
                if (SpellDetector.onProcessSpells.TryGetValue("JarvanIVDragonStrike2", out spellData))
                {
                    foreach (KeyValuePair<int, ObjectTrackerInfo> entry in objTracker)
                    {
                        var info = entry.Value;

                        if (info.Name == "Beacon" || info.obj.Name == "Beacon")
                        {
                            if (info.usePosition == false && (info.obj == null || !info.obj.IsValid || info.obj.IsDead))
                            {
                                DelayAction.Add(1, () => objTracker.Remove(info.obj.NetworkId));
                                continue;
                            }

                            var objPosition = info.usePosition ? info.position.To2D() : info.obj.Position.To2D();

                            if (args.End.To2D().Distance(objPosition) < 300)
                            {
                                var dir = (objPosition - args.Start.To2D()).Normalized();
                                var endPosition = objPosition + dir * 110;

                                SpellDetector.CreateSpellData(hero, args.Start, endPosition.To3D(), spellData);
                                specialSpellArgs.noProcess = true;
                                return;
                            }
                        }
                    }

                }
            }
        }
Пример #4
0
        private static void ProcessSpell_ZedShuriken(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData,
            SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.spellName == "ZedShuriken")
            {
                foreach (KeyValuePair<int, ObjectTrackerInfo> entry in objTracker)
                {
                    var info = entry.Value;

                    if (info.obj.Name == "Shadow" || info.Name == "Shadow")
                    {
                        if (info.usePosition == false && (info.obj == null || !info.obj.IsValid || info.obj.IsDead))
                        {
                            DelayAction.Add(1, () => objTracker.Remove(info.obj.NetworkId));
                            continue;
                        }
                        else
                        {
                            Vector3 endPos2;
                            if (info.usePosition == false)
                            {
                                endPos2 = info.obj.Position.Extend(args.End, spellData.range);
                                SpellDetector.CreateSpellData(hero, info.obj.Position, endPos2, spellData, null, 0, false);
                            }
                            else
                            {
                                endPos2 = info.position.Extend(args.End, spellData.range);
                                SpellDetector.CreateSpellData(hero, info.position, endPos2, spellData, null, 0, false);
                            }

                        }
                    }
                }
            }
        }
Пример #5
0
        private void Game_ProcessSpell(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args)
        {
            try
            {
                /*var castTime2 = (hero.Spellbook.CastTime - Game.Time) * 1000;
                if (castTime2 > 0)
                {
                    Console.WriteLine(args.SData.Name + ": " + castTime2);
                }*/

                SpellData spellData;

                if (hero.Team != myHero.Team && onProcessSpells.TryGetValue(args.SData.Name, out spellData))
                {
                    if (spellData.usePackets == false)
                    {
                        var specialSpellArgs = new SpecialSpellEventArgs();
                        if (OnProcessSpecialSpell != null)
                        {
                            OnProcessSpecialSpell(hero, args, spellData, specialSpellArgs);
                        }

                        if (specialSpellArgs.noProcess == false && spellData.noProcess == false)
                        {
                            CreateSpellData(hero, hero.ServerPosition, args.End, spellData, null);

                            /*if (spellData.spellType == SpellType.Line)
                            {
                                var castTime = (hero.Spellbook.CastTime - Game.Time) * 1000;

                                if (Math.Abs(castTime - spellData.spellDelay) > 5)
                                {
                                    Console.WriteLine("Wrong delay " + spellData.spellName + ": "
                                        + spellData.spellDelay + " vs " + castTime);
                                }
                            }*/

                        }
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Пример #6
0
        private static void ProcessSpell_OrianaIzunaCommand(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData,
            SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.spellName == "OrianaIzunaCommand")
            {
                foreach (KeyValuePair<int, ObjectTrackerInfo> entry in objTracker)
                {
                    var info = entry.Value;

                    if (entry.Value.Name == "TheDoomBall")
                    {
                        if (info.usePosition)
                        {
                            SpellDetector.CreateSpellData(hero, info.position, args.End, spellData, null, 0);
                        }
                        else
                        {
                            if (info.obj == null)
                                return;

                            SpellDetector.CreateSpellData(hero, info.obj.Position, args.End, spellData, null, 0);
                        }

                        info.position = args.End;
                        info.usePosition = true;
                    }
                }

                specialSpellArgs.noProcess = true;
            }

            if (spellData.spellName == "OrianaDetonateCommand" || spellData.spellName == "OrianaDissonanceCommand")
            {
                foreach (KeyValuePair<int, ObjectTrackerInfo> entry in objTracker)
                {
                    var info = entry.Value;

                    if (entry.Value.Name == "TheDoomBall")
                    {
                        if (info.usePosition)
                        {
                            Vector3 endPos2 = info.position;
                            SpellDetector.CreateSpellData(hero, endPos2, endPos2, spellData, null, 0);
                        }
                        else
                        {
                            if (info.obj == null)
                                return;

                            Vector3 endPos2 = info.obj.Position;
                            SpellDetector.CreateSpellData(hero, endPos2, endPos2, spellData, null, 0);
                        }
                    }
                }

                specialSpellArgs.noProcess = true;
            }
        }
Пример #7
0
        private static void ProcessSpell_ThreeWay(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData,
            SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.isThreeWay)
            {
                Vector3 endPos2 = MathUtils.RotateVector(args.Start.To2D(), args.End.To2D(), spellData.angle).To3D();
                SpellDetector.CreateSpellData(hero, args.Start, endPos2, spellData, null, 0, false);

                Vector3 endPos3 = MathUtils.RotateVector(args.Start.To2D(), args.End.To2D(), -spellData.angle).To3D();
                SpellDetector.CreateSpellData(hero, args.Start, endPos3, spellData, null, 0, false);
            }
        }
Пример #8
0
        private void Game_ProcessSpell(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args)
        {
            try
            {
                SpellData spellData;
                if (hero.Team != myHero.Team && onProcessSpells.TryGetValue(args.SData.Name, out spellData))
                {
                    if (spellData.usePackets == false)
                    {
                        var specialSpellArgs = new SpecialSpellEventArgs();
                        if (OnProcessSpecialSpell != null)
                        {
                            OnProcessSpecialSpell(hero, args, spellData, specialSpellArgs);
                        }

                        if (specialSpellArgs.noProcess == false && spellData.noProcess == false)
                        {

                            bool foundMissile = false;

                            if (spellData.isThreeWay == false && spellData.isSpecial == false)
                            {
                                foreach (KeyValuePair<int, Spell> entry in detectedSpells)
                                {
                                    Spell spell = entry.Value;

                                    var dir = (args.End.To2D() - args.Start.To2D()).Normalized();

                                    if (spell.spellObject != null && spell.info.spellName == args.SData.Name && spell.heroID == hero.NetworkId && dir.AngleBetween(spell.direction) < 10)
                                    {
                                        foundMissile = true;
                                        break;
                                    }
                                }
                            }
                            if (foundMissile == false)
                            {
                                CreateSpellData(hero, hero.ServerPosition, args.End, spellData, null);
                            }
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Пример #9
0
 private static void ProcessSpell_SionE(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData,
     SpecialSpellEventArgs specialSpellArgs)
 {
     if (spellData.spellName == "SionE")
     {
         //specialSpellArgs.noProcess = true;
     }
 }
Пример #10
0
        private void Game_ProcessSpell(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args)
        {
            try
            {
                if (hero.IsMe)
                {
                    string name;
                    if (channeledSpells.TryGetValue(args.SData.Name, out name))
                    {
                        Evade.isChanneling    = true;
                        Evade.channelPosition = myHero.ServerPosition.To2D();
                    }

                    if (ObjectCache.menuCache.cache["CalculateWindupDelay"].GetValue <bool>())
                    {
                        var castTime = (hero.Spellbook.CastTime - Game.Time) * 1000;


                        if (castTime > 0 && !Orbwalking.IsAutoAttack(args.SData.Name) &&
                            Math.Abs(castTime - myHero.AttackCastDelay * 1000) > 1)
                        {
                            //Console.WriteLine(args.SData.Name + ": " + (castTime - myHero.AttackCastDelay * 1000));
                            //Console.WriteLine(args.SData.Name + ": " + castTime);
                            //var extraDelayBuffer = ObjectCache.menuCache.cache["ExtraPingBuffer"].GetValue<Slider>().Value;
                            Evade.lastWindupTime = EvadeUtils.TickCount + castTime - Game.Ping / 2;
                        }
                    }
                }


                /*var castTime2 = (hero.Spellbook.CastTime - Game.Time) * 1000;
                 * if (castTime2 > 0)
                 * {
                 *  Console.WriteLine(args.SData.Name + ": " + castTime2);
                 * }*/


                SpellData spellData;

                if (hero.Team != myHero.Team && onProcessSpells.TryGetValue(args.SData.Name, out spellData))
                {
                    if (spellData.usePackets == false)
                    {
                        var specialSpellArgs = new SpecialSpellEventArgs();
                        if (OnProcessSpecialSpell != null)
                        {
                            OnProcessSpecialSpell(hero, args, spellData, specialSpellArgs);
                        }

                        if (specialSpellArgs.noProcess == false && spellData.noProcess == false)
                        {
                            CreateSpellData(hero, hero.ServerPosition, args.End, spellData, null);

                            /*if (spellData.spellType == SpellType.Line)
                             * {
                             *  var castTime = (hero.Spellbook.CastTime - Game.Time) * 1000;
                             *
                             *  if (Math.Abs(castTime - spellData.spellDelay) > 5)
                             *  {
                             *      Console.WriteLine("Wrong delay " + spellData.spellName + ": "
                             + spellData.spellDelay + " vs " + castTime);
                             +  }
                             + }*/
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Пример #11
0
        private void Game_ProcessSpell(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args)
        {
            try
            {
                /*var castTime2 = (hero.Spellbook.CastTime - Game.Time) * 1000;
                 * if (castTime2 > 0)
                 * {
                 *  Console.WriteLine(args.SData.Name + ": " + castTime2);
                 * }*/

                // todo: keepo
                //if (hero.IsMe)
                //    Console.WriteLine("Spell: " + args.SData.Name);

                SpellData spellData;

                if (hero.Team != myHero.Team && onProcessSpells.TryGetValue(args.SData.Name, out spellData))
                {
                    if (spellData.usePackets == false)
                    {
                        var specialSpellArgs = new SpecialSpellEventArgs();
                        if (OnProcessSpecialSpell != null)
                        {
                            OnProcessSpecialSpell(hero, args, spellData, specialSpellArgs);
                        }

                        if (specialSpellArgs.noProcess == false && spellData.noProcess == false)
                        {
                            bool foundMissile = false;

                            if (spellData.isThreeWay == false && spellData.isSpecial == false)
                            {
                                foreach (KeyValuePair <int, Spell> entry in detectedSpells)
                                {
                                    Spell spell = entry.Value;

                                    var dir = (args.End.LSTo2D() - args.Start.LSTo2D()).LSNormalized();

                                    if (spell.spellObject != null &&
                                        (spell.info.spellName.Equals(args.SData.Name, StringComparison.InvariantCultureIgnoreCase) ||
                                         (spell.info.spellName.ToLower() + "_urf").Equals(args.SData.Name, StringComparison.InvariantCultureIgnoreCase)) &&
                                        spell.heroID == hero.NetworkId &&
                                        dir.LSAngleBetween(spell.direction) < 10)
                                    {
                                        foundMissile = true;
                                        break;
                                    }
                                }
                            }

                            if (foundMissile == false)
                            {
                                CreateSpellData(hero, hero.ServerPosition, args.End, spellData, null);
                            }

                            /*if (spellData.spellType == SpellType.Line)
                             * {
                             *  var castTime = (hero.Spellbook.CastTime - Game.Time) * 1000;
                             *
                             *  if (Math.Abs(castTime - spellData.spellDelay) > 5)
                             *  {
                             *      Console.WriteLine("Wrong delay " + spellData.spellName + ": "
                             + spellData.spellDelay + " vs " + castTime);
                             +  }
                             + }*/
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Пример #12
0
        private void Game_ProcessSpell(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args)
        {
            try
            {
                if (hero.IsMe)
                {
                    string name;
                    if (channeledSpells.TryGetValue(args.SData.Name, out name))
                    {
                        Evade.isChanneling = true;
                        Evade.channelPosition = myHero.ServerPosition.To2D();
                    }

                    if (ObjectCache.menuCache.cache["CalculateWindupDelay"].GetValue<bool>())
                    {
                        var castTime = (hero.Spellbook.CastTime - Game.Time) * 1000;

                        if (castTime > 0 && !Orbwalking.IsAutoAttack(args.SData.Name)
                            && Math.Abs(castTime - myHero.AttackCastDelay * 1000) > 1)
                        {
                            //Console.WriteLine(args.SData.Name + ": " + (castTime - myHero.AttackCastDelay * 1000));
                            //Console.WriteLine(args.SData.Name + ": " + castTime);
                            //var extraDelayBuffer = ObjectCache.menuCache.cache["ExtraPingBuffer"].GetValue<Slider>().Value;
                            Evade.lastWindupTime = EvadeUtils.TickCount + castTime - Game.Ping / 2;
                        }
                    }

                }

                /*var castTime2 = (hero.Spellbook.CastTime - Game.Time) * 1000;
                if (castTime2 > 0)
                {
                    Console.WriteLine(args.SData.Name + ": " + castTime2);
                }*/

                SpellData spellData;

                if (hero.Team != myHero.Team && onProcessSpells.TryGetValue(args.SData.Name, out spellData))
                {
                    if (spellData.usePackets == false)
                    {
                        var specialSpellArgs = new SpecialSpellEventArgs();
                        if (OnProcessSpecialSpell != null)
                        {
                            OnProcessSpecialSpell(hero, args, spellData, specialSpellArgs);
                        }

                        if (specialSpellArgs.noProcess == false && spellData.noProcess == false)
                        {
                            CreateSpellData(hero, hero.ServerPosition, args.End, spellData, null);

                            /*if (spellData.spellType == SpellType.Line)
                            {
                                var castTime = (hero.Spellbook.CastTime - Game.Time) * 1000;

                                if (Math.Abs(castTime - spellData.spellDelay) > 5)
                                {
                                    Console.WriteLine("Wrong delay " + spellData.spellName + ": "
                                        + spellData.spellDelay + " vs " + castTime);
                                }
                            }*/

                        }
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Пример #13
0
        private static void ProcessSpell_OrianaIzunaCommand(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData,
                                                            SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.spellName == "OrianaIzunaCommand")
            {
                foreach (KeyValuePair <int, ObjectTrackerInfo> entry in objTracker)
                {
                    var info = entry.Value;

                    if (entry.Value.Name == "TheDoomBall")
                    {
                        if (info.usePosition)
                        {
                            SpellDetector.CreateSpellData(hero, info.position, args.End, spellData, null, 0);
                        }
                        else
                        {
                            if (info.obj == null)
                            {
                                return;
                            }

                            SpellDetector.CreateSpellData(hero, info.obj.Position, args.End, spellData, null, 0);
                        }

                        info.position    = args.End;
                        info.usePosition = true;
                    }
                }

                specialSpellArgs.noProcess = true;
            }

            if (spellData.spellName == "OrianaDetonateCommand" || spellData.spellName == "OrianaDissonanceCommand")
            {
                foreach (KeyValuePair <int, ObjectTrackerInfo> entry in objTracker)
                {
                    var info = entry.Value;

                    if (entry.Value.Name == "TheDoomBall")
                    {
                        if (info.usePosition)
                        {
                            Vector3 endPos2 = info.position;
                            SpellDetector.CreateSpellData(hero, endPos2, endPos2, spellData, null, 0);
                        }
                        else
                        {
                            if (info.obj == null)
                            {
                                return;
                            }

                            Vector3 endPos2 = info.obj.Position;
                            SpellDetector.CreateSpellData(hero, endPos2, endPos2, spellData, null, 0);
                        }
                    }
                }

                specialSpellArgs.noProcess = true;
            }
        }
Пример #14
0
 private static void ProcessSpell_jayceshockblast(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
 {
     if (spellData.spellName == "jayceshockblast")
     {
     }
 }
Пример #15
0
        private static void ProcessSpell_LucianQ(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData,
            SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.spellName == "LucianQ")
            {

                if (args.Target.IsValid<Obj_AI_Base>())
                {
                    var target = args.Target as Obj_AI_Base;

                    float spellDelay = ((float)(350 - ObjectCache.gamePing)) / 1000;
                    var heroWalkDir = (target.ServerPosition - target.Position).Normalized();
                    var predictedHeroPos = target.Position + heroWalkDir * target.MoveSpeed * (spellDelay);

                    SpellDetector.CreateSpellData(hero, args.Start, predictedHeroPos, spellData, null, 0);

                    specialSpellArgs.noProcess = true;
                }
            }
        }
Пример #16
0
        private void Game_ProcessSpell(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args)
        {
            try
            {
                /*var castTime2 = (hero.Spellbook.CastTime - Game.Time) * 1000;
                if (castTime2 > 0)
                {
                    Console.WriteLine(args.SData.Name + ": " + castTime2);
                }*/

                // todo: keepo
                //if (hero.IsMe)
                //    Console.WriteLine("Spell: " + args.SData.Name);

                SpellData spellData;

                if (hero.Team != myHero.Team && onProcessSpells.TryGetValue(args.SData.Name, out spellData))
                {
                    if (spellData.usePackets == false)
                    {
                        var specialSpellArgs = new SpecialSpellEventArgs();
                        if (OnProcessSpecialSpell != null)
                        {
                            OnProcessSpecialSpell(hero, args, spellData, specialSpellArgs);
                        }

                        if (specialSpellArgs.noProcess == false && spellData.noProcess == false)
                        {

                            bool foundMissile = false;

                            if (spellData.isThreeWay == false && spellData.isSpecial == false)
                            {
                                if ((from entry in detectedSpells select entry.Value into spell let dir = (args.End.To2D() - args.Start.To2D()).Normalized() where spell.spellObject != null
                                                                                                                                                                   && spell.info.spellName.ToLower() == args.SData.Name.ToLower()
                                                                                                                                                                   && spell.heroID == hero.NetworkId
                                                                                                                                                                   && dir.AngleBetween(spell.direction) < 10 select spell).Any())
                                {
                                    foundMissile = true;
                                }
                            }

                            if (foundMissile == false)
                            {
                                CreateSpellData(hero, hero.ServerPosition, args.End, spellData);
                            }

                            /*if (spellData.spellType == SpellType.Line)
                            {
                                var castTime = (hero.Spellbook.CastTime - Game.Time) * 1000;

                                if (Math.Abs(castTime - spellData.spellDelay) > 5)
                                {
                                    Console.WriteLine("Wrong delay " + spellData.spellName + ": "
                                        + spellData.spellDelay + " vs " + castTime);
                                }
                            }*/

                        }
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Пример #17
0
        private static void ProcessSpell_LuluQ(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData,
            SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.spellName == "LuluQ")
            {
                foreach (KeyValuePair<int, ObjectTrackerInfo> entry in objTracker)
                {
                    var info = entry.Value;

                    if (entry.Value.Name == "RobotBuddy")
                    {
                        if (info.obj == null || !info.obj.IsValid || info.obj.IsDead || info.obj.IsVisible)
                        {
                            continue;
                        }
                        else
                        {
                            Vector3 endPos2 = info.obj.Position.Extend(args.End, spellData.range);
                            SpellDetector.CreateSpellData(hero, info.obj.Position, endPos2, spellData, null, 0, false);
                        }
                    }
                }
            }
        }
Пример #18
0
        private static void ProcessSpell_AlZaharCalloftheVoid(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData,
            SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.spellName == "AlZaharCalloftheVoid")
            {
                var direction = (args.End.To2D() - args.Start.To2D()).Normalized();
                var pDirection = direction.Perpendicular();
                var targetPoint = args.End.To2D();

                var pos1 = targetPoint - pDirection * spellData.sideRadius;
                var pos2 = targetPoint + pDirection * spellData.sideRadius;

                SpellDetector.CreateSpellData(hero, pos1.To3D(), pos2.To3D(), spellData, null, 0, false);
                SpellDetector.CreateSpellData(hero, pos2.To3D(), pos1.To3D(), spellData, null, 0);

                specialSpellArgs.noProcess = true;
            }
        }
Пример #19
0
        private static void ProcessSpell_SionE(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData,
            SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.spellName == "SionE")
            {
                var objList = new List<Obj_AI_Minion>();
                foreach (var obj in ObjectManager.Get<Obj_AI_Minion>())
                {
                    if (obj != null && obj.IsValid && !obj.IsDead && obj.IsAlly)
                    {
                        objList.Add(obj);
                    }
                }

                objList.OrderBy(o => o.Distance(hero.ServerPosition));

                var spellStart = args.Start.To2D();
                var dir = (args.End.To2D() - spellStart).Normalized();
                var spellEnd = spellStart + dir * spellData.range;

                foreach (var obj in objList)
                {
                    var objProjection = obj.ServerPosition.To2D().ProjectOn(spellStart, spellEnd);

                    if (objProjection.IsOnSegment && objProjection.SegmentPoint.Distance(obj.ServerPosition.To2D()) < obj.BoundingRadius + spellData.radius)
                    {
                        //sth happens
                    }
                }

                //specialSpellArgs.noProcess = true;
            }
        }
Пример #20
0
 private static void ProcessSpell_AsheVolley(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData,
     SpecialSpellEventArgs specialSpellArgs)
 {
     if (spellData.spellName == "Volley")
     {
         for (int i = -4; i < 5; i++)
         {
             Vector3 endPos2 = MathUtils.RotateVector(args.Start.To2D(), args.End.To2D(), i * spellData.angle).To3D();
             if (i != 0)
             {
                 SpellDetector.CreateSpellData(hero, args.Start, endPos2, spellData, null, 0, false);
             }
         }
     }
 }
Пример #21
0
        private static void ProcessSpell_XerathArcanopulse2(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
        {
            if (args.SData.Name == "XerathArcanopulseChargeUp")// || spellData.spellName == "xeratharcanopulse2")
            {
                var castTime = -1 * (hero.Spellbook.CastTime - Game.Time) * 1000;

                if (castTime > 0)
                {
                    var dir = (args.End.To2D() - args.Start.To2D()).Normalized();
                    var endPos = args.Start.To2D() + dir * Math.Min(spellData.range, 750 + castTime / 2);
                    SpellDetector.CreateSpellData(hero, args.Start, endPos.To3D(), spellData);
                }

                specialSpellArgs.noProcess = true;
            }
        }
Пример #22
0
        private static void ProcessSpell_EkkoR(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData,
            SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.spellName == "EkkoR")
            {
                foreach (var obj in ObjectManager.Get<Obj_AI_Minion>())
                {
                    if (obj != null && obj.IsValid && !obj.IsDead && obj.Name == "Ekko" && obj.IsEnemy)
                    {
                        var blinkPos = obj.ServerPosition.To2D();

                        SpellDetector.CreateSpellData(hero, args.Start, blinkPos.To3D(), spellData);
                    }
                }

                specialSpellArgs.noProcess = true;
            }
        }
Пример #23
0
        private static void ProcessSpell_ZiggsQ(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData,
            SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.spellName == "ZiggsQ")
            {
                var startPos = hero.ServerPosition.To2D();
                var endPos = args.End.To2D();
                var dir = (endPos - startPos).Normalized();

                if (endPos.Distance(startPos) > 850)
                {
                    endPos = startPos + dir * 850;
                }

                SpellDetector.CreateSpellData(hero, args.Start, endPos.To3D(), spellData, null, 0, false);

                var endPos2 = endPos + dir * 0.4f * startPos.Distance(endPos);
                SpellDetector.CreateSpellData(hero, args.Start, endPos2.To3D(), spellData, null, 250, false);

                var endPos3 = endPos2 + dir * 0.6f * endPos.Distance(endPos2);
                SpellDetector.CreateSpellData(hero, args.Start, endPos3.To3D(), spellData, null, 800);

                specialSpellArgs.noProcess = true;
            }
        }
Пример #24
0
        private static void ProcessSpell_FizzPiercingStrike(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData,
            SpecialSpellEventArgs specialSpellArgs)
        {
            if (spellData.spellName == "FizzPiercingStrike")
            {
                if (args.Target != null && args.Target.IsMe)
                {
                    SpellDetector.CreateSpellData(hero, args.Start, args.End, spellData, null, 0);
                }

                specialSpellArgs.noProcess = true;
            }
        }
Пример #25
0
        private void Game_ProcessSpell(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args)
        {
            try
            {
                /*var castTime2 = (hero.Spellbook.CastTime - Game.Time) * 1000;
                if (castTime2 > 0)
                {
                    Console.WriteLine(args.SData.Name + ": " + castTime2);
                }*/

                // todo: keepo
                //if (hero.IsMe)
                //    Console.WriteLine("Spell: " + args.SData.Name);

                SpellData spellData;

                if (hero.Team != myHero.Team && onProcessSpells.TryGetValue(args.SData.Name, out spellData))
                {
                    if (spellData.usePackets == false)
                    {
                        var specialSpellArgs = new SpecialSpellEventArgs();
                        if (OnProcessSpecialSpell != null)
                        {
                            OnProcessSpecialSpell(hero, args, spellData, specialSpellArgs);
                        }

                        if (specialSpellArgs.noProcess == false && spellData.noProcess == false)
                        {
                            bool foundMissile = false;

                            if (spellData.isThreeWay == false && spellData.isSpecial == false)
                            {
                                foreach (KeyValuePair<int, Spell> entry in detectedSpells)
                                {
                                    Spell spell = entry.Value;

                                    var dir = (args.End.LSTo2D() - args.Start.LSTo2D()).LSNormalized();

                                    if (spell.spellObject != null
                                        && (spell.info.spellName.Equals(args.SData.Name, StringComparison.InvariantCultureIgnoreCase) ||
                                           (spell.info.spellName.ToLower() + "_urf").Equals(args.SData.Name, StringComparison.InvariantCultureIgnoreCase))
                                        && spell.heroID == hero.NetworkId
                                        && dir.LSAngleBetween(spell.direction) < 10)
                                    {
                                        foundMissile = true;
                                        break;
                                    }
                                }
                            }

                            if (foundMissile == false)
                            {
                                CreateSpellData(hero, hero.ServerPosition, args.End, spellData, null);
                            }

                            /*if (spellData.spellType == SpellType.Line)
                            {
                                var castTime = (hero.Spellbook.CastTime - Game.Time) * 1000;

                                if (Math.Abs(castTime - spellData.spellDelay) > 5)
                                {
                                    Console.WriteLine("Wrong delay " + spellData.spellName + ": "
                                        + spellData.spellDelay + " vs " + castTime);
                                }
                            }*/

                        }
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Пример #26
0
        private static void ProcessSpell_JarvanIVDragonStrike(Obj_AI_Base hero, GameObjectProcessSpellCastEventArgs args, SpellData spellData, SpecialSpellEventArgs specialSpellArgs)
        {
            if (args.SData.Name == "JarvanIVDragonStrike")
            {
                if (SpellDetector.onProcessSpells.TryGetValue("JarvanIVDragonStrike2", out spellData))
                {
                    foreach (KeyValuePair <int, ObjectTrackerInfo> entry in objTracker)
                    {
                        var info = entry.Value;

                        if (info.Name == "Beacon" || info.obj.Name == "Beacon")
                        {
                            if (info.usePosition == false && (info.obj == null || !info.obj.IsValid || info.obj.IsDead))
                            {
                                DelayAction.Add(1, () => objTracker.Remove(info.obj.NetworkId));
                                continue;
                            }

                            var objPosition = info.usePosition ? info.position.To2D() : info.obj.Position.To2D();

                            if (args.End.To2D().Distance(objPosition) < 300)
                            {
                                var dir         = (objPosition - args.Start.To2D()).Normalized();
                                var endPosition = objPosition + dir * 110;

                                SpellDetector.CreateSpellData(hero, args.Start, endPosition.To3D(), spellData);
                                specialSpellArgs.noProcess = true;
                                return;
                            }
                        }
                    }
                }
            }
        }