Exemple #1
0
 private static void Teleport_OnTeleport(Obj_AI_Base sender, EloBuddy.SDK.Events.Teleport.TeleportEventArgs args)
 {
     if (sender.NetworkId == p.NetworkId && args.Type == TeleportType.Recall)
     {
         recalling = args.Status == TeleportStatus.Start;
     }
 }
Exemple #2
0
        private void OnObjAiBaseTeleport(Obj_AI_Base sender, EloBuddy.SDK.Events.Teleport.TeleportEventArgs args)
        {
            try
            {
                //var packet = Packet.S2C.Teleport.Decoded(sender, args);
                var lastPosition = _lastPositions.FirstOrDefault(e => e.Hero.NetworkId == sender.NetworkId);
                if (lastPosition != null)
                {
                    switch (args.Status)
                    {
                    case TeleportStatus.Start:
                        lastPosition.IsTeleporting = true;
                        break;

                    case TeleportStatus.Abort:
                        lastPosition.IsTeleporting = false;
                        break;

                    case TeleportStatus.Finish:
                        lastPosition.Teleported    = true;
                        lastPosition.IsTeleporting = false;
                        lastPosition.LastSeen      = Game.Time;
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
        }
Exemple #3
0
        private void Obj_AI_Base_OnTeleport(Obj_AI_Base sender, EloBuddy.SDK.Events.Teleport.TeleportEventArgs args)
        {
            //Packet.S2C.Teleport.Struct decoded = Packet.S2C.Teleport.Decoded(sender, args);
            if (sender.NetworkId == _hero.NetworkId && args.Type == TeleportType.Recall)
            {
                switch (args.Status)
                {
                case TeleportStatus.Start:
                    _begin    = Game.Time;
                    _duration = args.Duration;
                    _active   = true;
                    break;

                case TeleportStatus.Finish:
                    int    colorIndex = (int)((_hero.HealthPercent / 100) * 255);
                    string color      = (255 - colorIndex).ToString("X2") + colorIndex.ToString("X2") + "00";
                    Program.Instance().Notify(_hero.ChampionName + " has recalled with <font color='#" + color + "'>" + (int)_hero.HealthPercent + "&#37; HP</font>");
                    _active = false;
                    break;

                case TeleportStatus.Abort:
                    _active = false;
                    break;

                case TeleportStatus.Unknown:
                    Program.Instance()
                    .Notify(
                        _hero.ChampionName + " is <font color='#ff3232'>unknown</font> (" +
                        _hero.Spellbook.GetSpell(SpellSlot.Recall).Name + ")");
                    _active = false;
                    break;
                }
            }
        }
Exemple #4
0
 private void OnObjAiBaseTeleport(Obj_AI_Base sender, EloBuddy.SDK.Events.Teleport.TeleportEventArgs args)
 {
     try
     {
         //var packet = Packet.S2C.Teleport.Decoded(sender, args);
         var enemyObject = _enemyObjects.FirstOrDefault(e => e.Unit.NetworkId == sender.NetworkId);
         if (enemyObject != null)
         {
             if (args.Type == TeleportType.Teleport &&
                 (args.Status == TeleportStatus.Finish ||
                  args.Status == TeleportStatus.Abort))
             {
                 var time = Game.Time;
                 LeagueSharp.Common.Utility.DelayAction.Add(
                     250, delegate
                 {
                     var cd = args.Status == TeleportStatus.Finish ? 300 : 200;
                     _teleports[sender.NetworkId] = time + cd;
                 });
             }
             enemyObject.TeleportStatus = args.Status;
         }
     }
     catch (Exception ex)
     {
         Global.Logger.AddItem(new LogItem(ex));
     }
 }
Exemple #5
0
        private static void Obj_AI_Base_OnTeleport(GameObject sender, EloBuddy.SDK.Events.Teleport.TeleportEventArgs args)
        {
            var unit = sender as AIHeroClient;

            if (unit == null || !unit.IsValid || unit.IsAlly)
            {
                return;
            }

            var ChampionInfoOne = ChampionInfoList.Find(x => x.Hero.NetworkId == sender.NetworkId);

            //var recall = Packet.S2C.Teleport.Decoded(unit, args);

            if (args.Type == EloBuddy.SDK.Enumerations.TeleportType.Recall)
            {
                switch (args.Status)
                {
                case EloBuddy.SDK.Enumerations.TeleportStatus.Start:
                    ChampionInfoOne.StartRecallTime = Game.Time;
                    break;

                case EloBuddy.SDK.Enumerations.TeleportStatus.Abort:
                    ChampionInfoOne.AbortRecallTime = Game.Time;
                    break;

                case EloBuddy.SDK.Enumerations.TeleportStatus.Finish:
                    ChampionInfoOne.FinishRecallTime = Game.Time;
                    var spawnPos = ObjectManager.Get <Obj_SpawnPoint>().FirstOrDefault(x => x.IsEnemy).Position;
                    ChampionInfoOne.LastVisablePos = spawnPos;
                    ChampionInfoOne.PredictedPos   = spawnPos;
                    ChampionInfoOne.LastWayPoint   = spawnPos;
                    break;
                }
            }
        }
Exemple #6
0
        private void Obj_AI_Base_OnTeleport(GameObject sender, EloBuddy.SDK.Events.Teleport.TeleportEventArgs args)
        {
            var unit = sender as AIHeroClient;

            if (unit == null || !unit.IsValid || unit.IsAlly)
            {
                return;
            }

            var recallinfo = new RecallInf(unit.NetworkId, args.Status, args.Type, args.Duration, args.Start);
            var enemyInfo  = this.EnemyInfo.Find(x => x.Player.NetworkId == unit.NetworkId).RecallInfo.UpdateRecall(recallinfo);

            if (args.Type == TeleportType.Recall)
            {
                switch (args.Status)
                {
                case TeleportStatus.Abort:
                    if (this.Menu.Item("notifRecAborted").GetValue <bool>())
                    {
                        this.ShowNotification(
                            enemyInfo.Player.ChampionName + ": Recall ABORTED",
                            Color.Orange,
                            4000);
                    }

                    break;

                case TeleportStatus.Finish:
                    if (this.Menu.Item("notifRecFinished").GetValue <bool>())
                    {
                        this.ShowNotification(
                            enemyInfo.Player.ChampionName + ": Recall FINISHED",
                            Color.White,
                            4000);
                    }
                    break;

                case TeleportStatus.Start:
                    if (this.Menu.Item("notifRecFinished").GetValue <bool>())
                    {
                        this.ShowNotification(
                            enemyInfo.Player.ChampionName + ": Recall STARTED",
                            Color.White,
                            4000);
                    }

                    break;
                }
            }
        }
Exemple #7
0
 private void Obj_AI_Base_OnTeleport(Obj_AI_Base sender, EloBuddy.SDK.Events.Teleport.TeleportEventArgs args)
 {
     //Packet.S2C.Teleport.Struct decoded = Packet.S2C.Teleport.Decoded(sender, args);
     if (sender.NetworkId == Hero.NetworkId && args.Type == TeleportType.Recall)
     {
         RecallStatus = args.Status;
         if (args.Status == TeleportStatus.Finish)
         {
             BeforeRecallLocation = Hero.ServerPosition;
             Obj_SpawnPoint enemySpawn = ObjectManager.Get <Obj_SpawnPoint>().FirstOrDefault(x => x.IsEnemy);
             if (enemySpawn != null)
             {
                 LastLocation      = enemySpawn.Position;
                 PredictedLocation = enemySpawn.Position;
             }
             LastSeen = Game.Time;
         }
     }
 }
Exemple #8
0
Fichier : Lux.cs Projet : koyvn/hay
        /// <summary>
        ///     Fired when a unit teleports.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="args">The <see cref="GameObjectTeleportEventArgs" /> instance containing the event data.</param>
        private void ObjAiHeroOnOnTeleport(Obj_AI_Base sender, EloBuddy.SDK.Events.Teleport.TeleportEventArgs args)
        {
            if (!this.GetBool("rKSRecall"))
            {
                return;
            }

            //var decoded = Packet.S2C.Teleport.Decoded(sender, args);
            var hero = ObjectManager.GetUnitByNetworkId <AIHeroClient>((uint)sender.NetworkId);

            if (hero.IsAlly || args.Type != TeleportType.Recall ||
                args.Status != TeleportStatus.Start)
            {
                return;
            }

            var rDamage = this.Player.GetSpellDamage(hero, SpellSlot.R);

            if (rDamage > hero.Health)
            {
                R.Cast(hero);
            }
        }
Exemple #9
0
        private void OnObjAiBaseTeleport(GameObject sender, EloBuddy.SDK.Events.Teleport.TeleportEventArgs packet)
        {
            try
            {
                var teleport = _teleportObjects.FirstOrDefault(r => r.Hero.NetworkId == sender.NetworkId);
                if (teleport != null)
                {
                    var duration = packet.Duration;
                    if (packet.Type == EloBuddy.SDK.Enumerations.TeleportType.Recall)
                    {
                        duration = teleport.Hero.HasBuff("exaltedwithbaronnashor") ? 4000 : 8000;
                        if (LeagueSharp.Common.Utility.Map.GetMap().Type == LeagueSharp.Common.Utility.Map.MapType.CrystalScar)
                        {
                            duration = 4500;
                        }
                    }
                    if (packet.Type == EloBuddy.SDK.Enumerations.TeleportType.Shen)
                    {
                        duration = 3000;
                    }
                    if (packet.Type == EloBuddy.SDK.Enumerations.TeleportType.TwistedFate)
                    {
                        duration = 1500;
                    }
                    if (packet.Type == EloBuddy.SDK.Enumerations.TeleportType.Teleport)
                    {
                        duration = 4000;
                    }
                    teleport.Duration   = duration;
                    teleport.LastStatus = packet.Status;
                    teleport.LastType   = packet.Type;

                    if (packet.Status == EloBuddy.SDK.Enumerations.TeleportStatus.Finish)
                    {
                        if (Menu.Item(Name + "NotificationFinished").GetValue <bool>())
                        {
                            Notifications.AddNotification(teleport.Hero.ChampionName + " Finished.", 5000)
                            .SetTextColor(Color.GreenYellow);
                        }
                        if (Menu.Item(Name + "ChatFinished").GetValue <bool>())
                        {
                            Chat.Print(
                                string.Format("<font color='#8ACC25'>Finished: {0}</font>", teleport.Hero.ChampionName));
                        }
                    }

                    if (packet.Status == EloBuddy.SDK.Enumerations.TeleportStatus.Abort)
                    {
                        if (Menu.Item(Name + "NotificationAborted").GetValue <bool>())
                        {
                            Notifications.AddNotification(teleport.Hero.ChampionName + " Aborted.", 5000)
                            .SetTextColor(Color.Orange);
                        }
                        if (Menu.Item(Name + "ChatAborted").GetValue <bool>())
                        {
                            Chat.Print(
                                string.Format("<font color='#CC0000'>Aborted: {0}</font>", teleport.Hero.ChampionName));
                        }
                    }

                    if (packet.Status == EloBuddy.SDK.Enumerations.TeleportStatus.Start)
                    {
                        if (Menu.Item(Name + "NotificationStarted").GetValue <bool>())
                        {
                            Notifications.AddNotification(teleport.Hero.ChampionName + " Started.", 5000)
                            .SetTextColor(Color.White);
                        }
                        if (Menu.Item(Name + "ChatStarted").GetValue <bool>())
                        {
                            Chat.Print(
                                string.Format("<font color='#FFFFFF'>Started: {0}</font>", teleport.Hero.ChampionName));
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Global.Logger.AddItem(new LogItem(ex));
            }
        }