public static GamePacket Encoded(Packet.C2S.Cast.Struct packetStruct) { var result = new GamePacket(Packet.C2S.Cast.Header); result.WriteInteger(packetStruct.SourceNetworkId); result.WriteByte(GetSpellByte(packetStruct.Slot)); result.WriteByte(GetFixedByte(packetStruct.Slot)); result.WriteFloat(packetStruct.FromX); result.WriteFloat(packetStruct.FromY); result.WriteFloat(packetStruct.ToX); result.WriteFloat(packetStruct.ToY); result.WriteInteger(packetStruct.TargetNetworkId); return result; }
public EnemyInfo UpdateRecall(Packet.S2C.Teleport.Struct newRecall) { this.LockedTarget = false; this.EstimatedShootT = 0; if (newRecall.Type == Packet.S2C.Teleport.Type.Recall && newRecall.Status == Packet.S2C.Teleport.Status.Abort) { this.AbortedRecall = this.Recall; this.AbortedT = Utils.TickCount; } else { this.AbortedT = 0; } this.Recall = newRecall; return this.EnemyInfo; }
public EnemyInfo UpdateRecall(Packet.S2C.Recall.Struct newRecall) { Recall = newRecall; return EnemyInfo; }
public Positions Update(Packet.S2C.Teleport.Struct newData) { if (newData.Type == Packet.S2C.Teleport.Type.Recall && newData.Status == Packet.S2C.Teleport.Status.Abort) { Aborted = Recall; AbortTime = System.Environment.TickCount; started = false; } else { AbortTime = 0; } if (newData.Type == Packet.S2C.Teleport.Type.Recall && newData.Status == Packet.S2C.Teleport.Status.Finish) { started = false; } if (newData.Type == Packet.S2C.Teleport.Type.Recall && newData.Status == Packet.S2C.Teleport.Status.Start) { if (!started) { RecallStartTime = System.Environment.TickCount; } started = true; } Recall = newData; return Positions; }
void HandleRecall(Packet.S2C.Recall.Struct recallEx) { int time = Environment.TickCount - Game.Ping; foreach (RecallInfo recall in _recalls) { if (recall == null) continue; if (recallEx.Type == Packet.S2C.Recall.ObjectType.Player) { var obj = ObjectManager.GetUnitByNetworkId<Obj_AI_Hero>(recall.NetworkId); var objEx = ObjectManager.GetUnitByNetworkId<Obj_AI_Hero>(recallEx.UnitNetworkId); if (obj == null) continue; if (obj.NetworkId == objEx.NetworkId) //already existing { recall.Recall = recallEx; recall.Recall2 = new Packet.S2C.Recall.Struct(); StringList t = Menu.RecallDetector.GetMenuItem("SAwarenessRecallDetectorMode").GetValue<StringList>(); if (t.SelectedIndex == 0 || t.SelectedIndex == 2) { if (recallEx.Status == Packet.S2C.Recall.RecallStatus.TeleportStart || recallEx.Status == Packet.S2C.Recall.RecallStatus.RecallStarted) { recall.StartTime = (int)Game.Time; if (Menu.RecallDetector.GetMenuItem("SAwarenessRecallDetectorLocalChat").GetValue<bool>()) { Game.PrintChat(obj.ChampionName + " porting with {0} hp", (int)obj.Health); } else { Game.Say(obj.ChampionName + " porting with {0} hp", (int)obj.Health); } } else if (recallEx.Status == Packet.S2C.Recall.RecallStatus.TeleportEnd || recallEx.Status == Packet.S2C.Recall.RecallStatus.RecallFinished) { //recall.StartTime = 0; if (Menu.RecallDetector.GetMenuItem("SAwarenessRecallDetectorLocalChat").GetValue<bool>()) { Game.PrintChat(obj.ChampionName + " ported with {0} hp", (int)obj.Health); } else { Game.Say(obj.ChampionName + " ported with {0} hp", (int)obj.Health); } } else { //recall.StartTime = 0; if (Menu.RecallDetector.GetMenuItem("SAwarenessRecallDetectorLocalChat").GetValue<bool>()) { Game.PrintChat(obj.ChampionName + " canceled with {0} hp", (int)obj.Health); } else { Game.Say(obj.ChampionName + " canceled with {0} hp", (int)obj.Health); } } } return; } } else if (recallEx.Status == Packet.S2C.Recall.RecallStatus.TeleportStart || recallEx.Status == Packet.S2C.Recall.RecallStatus.TeleportEnd) { if (recall.Recall.Status == Packet.S2C.Recall.RecallStatus.TeleportStart) recall.Recall2 = recallEx; var obj = ObjectManager.GetUnitByNetworkId<GameObject>(recallEx.UnitNetworkId); var pos = obj.Position; for (int i = 0; i < Menu.RecallDetector.GetMenuItem("SAwarenessRecallDetectorPingTimes").GetValue<Slider>().Value; i++) { GamePacket gPacketT; if (Menu.RecallDetector.GetMenuItem("SAwarenessRecallDetectorLocalPing").GetValue<bool>()) { gPacketT = Packet.S2C.Ping.Encoded(new Packet.S2C.Ping.Struct(pos[0], pos[1])); gPacketT.Process(); } else { gPacketT = Packet.C2S.Ping.Encoded(new Packet.C2S.Ping.Struct(pos.X, pos.Y, 0, Packet.PingType.Danger)); gPacketT.Send(); } } } } }
#pragma warning disable 618 public EnemyInfo UpdateRecall(Packet.S2C.Teleport.Struct newRecall) #pragma warning restore 618 { IncomingDamage.Clear(); LockedTarget = false; EstimatedShootT = 0; #pragma warning disable 618 if (newRecall.Type == Packet.S2C.Teleport.Type.Recall && newRecall.Status == Packet.S2C.Teleport.Status.Abort) #pragma warning restore 618 { AbortedRecall = Recall; AbortedT = Utils.TickCount; } else AbortedT = 0; Recall = newRecall; return EnemyInfo; }
private void HandleRecall(Packet.S2C.Teleport.Struct recallEx) { int time = Environment.TickCount - Game.Ping; for (int i = 0; i < Recalls.Count; i++) { Packet.S2C.Teleport.Struct recall = Recalls[i]; if (true/*recallEx.Type == Recall.ObjectType.Player*/) { var obj = ObjectManager.GetUnitByNetworkId<Obj_AI_Hero>(recall.UnitNetworkId); var objEx = ObjectManager.GetUnitByNetworkId<Obj_AI_Hero>(recallEx.UnitNetworkId); if (obj == null) continue; if (obj.NetworkId == objEx.NetworkId) //already existing { recall = recallEx; //recall.Recall2 = new Recall.Struct(); var percentHealth = (int)((obj.Health / obj.MaxHealth) * 100); String sColor; String hColor = (percentHealth > 50 ? "<font color='#00FF00'>" : (percentHealth > 30 ? "<font color='#FFFF00'>" : "<font color='#FF0000'>")); if (recallEx.Status == Packet.S2C.Teleport.Status.Start) { String text = (recallEx.Type == Packet.S2C.Teleport.Type.Recall ? Language.GetString("DETECTORS_RECALL_TEXT_RECALLING") : Language.GetString("DETECTORS_RECALL_TEXT_PORTING")); sColor = "<font color='#FFFF00'>"; recall.Start = (int)Game.Time; if ( RecallDetector.GetMenuItem("SAssembliesDetectorsRecallChatChoice") .GetValue<StringList>() .SelectedIndex == 1) { Game.PrintChat("{0}" + obj.ChampionName + " {1} " + Language.GetString("DETECTORS_RECALL_TEXT_WITH") + " {2} " + Language.GetString("DETECTORS_RECALL_TEXT_HP") + " {3}({4})", sColor, text, (int)obj.Health, hColor, percentHealth); } else if ( RecallDetector.GetMenuItem("SAssembliesDetectorsRecallChatChoice") .GetValue<StringList>() .SelectedIndex == 2 && Menu.GlobalSettings.GetMenuItem("SAssembliesGlobalSettingsServerChatPingActive") .GetValue<bool>()) { Game.Say("{0}" + obj.ChampionName + " {1} " + Language.GetString("DETECTORS_RECALL_TEXT_WITH") + " {2} " + Language.GetString("DETECTORS_RECALL_TEXT_HP") + " {3}({4})", sColor, text, (int)obj.Health, hColor, percentHealth); } for (int j = 0; j < RecallDetector.GetMenuItem("SAssembliesDetectorsRecallPingTimes").GetValue<Slider>().Value; j++) { if (RecallDetector.GetMenuItem("SAssembliesDetectorsRecallLocalPing").GetValue<bool>()) { Game.ShowPing(PingCategory.EnemyMissing, obj.ServerPosition, true); } else if (!RecallDetector.GetMenuItem("SAssembliesDetectorsRecallLocalPing").GetValue<bool>() && Menu.GlobalSettings.GetMenuItem("SAssembliesGlobalSettingsServerChatPingActive") .GetValue<bool>()) { Game.SendPing(PingCategory.EnemyMissing, obj.ServerPosition); } } if (RecallDetector.GetMenuItem("SAssembliesDetectorsRecallSpeech").GetValue<bool>()) { Speech.Speak(obj.ChampionName + " " + text); } if (RecallDetector.GetMenuItem("SAssembliesDetectorsRecallNotification").GetValue<bool>()) { Common.ShowNotification(obj.ChampionName + " " + text + " " + (int)obj.Health + " " + Language.GetString("DETECTORS_RECALL_TEXT_HP") + " (" + percentHealth + ")", System.Drawing.Color.OrangeRed, 3); } } else if (recallEx.Status == Packet.S2C.Teleport.Status.Finish) { String text = (recallEx.Type == Packet.S2C.Teleport.Type.Recall ? Language.GetString("DETECTORS_RECALL_TEXT_RECALLED") : Language.GetString("DETECTORS_RECALL_TEXT_PORTED")); sColor = "<font color='#FF0000'>"; if ( RecallDetector.GetMenuItem("SAssembliesDetectorsRecallChatChoice") .GetValue<StringList>() .SelectedIndex == 1) { Game.PrintChat("{0}" + obj.ChampionName + " {1} " + Language.GetString("DETECTORS_RECALL_TEXT_WITH") + " {2} " + Language.GetString("DETECTORS_RECALL_TEXT_HP") + " {3}({4})", sColor, text, (int)obj.Health, hColor, percentHealth); } else if ( RecallDetector.GetMenuItem("SAssembliesDetectorsRecallChatChoice") .GetValue<StringList>() .SelectedIndex == 2 && Menu.GlobalSettings.GetMenuItem( "SAssembliesGlobalSettingsServerChatPingActive").GetValue<bool>()) { Game.Say("{0}" + obj.ChampionName + " {1} " + Language.GetString("DETECTORS_RECALL_TEXT_WITH") + " {2} " + Language.GetString("DETECTORS_RECALL_TEXT_HP") + " {3}({4})", sColor, text, (int)obj.Health, hColor, percentHealth); } for (int j = 0; j < RecallDetector.GetMenuItem("SAssembliesDetectorsRecallPingTimes").GetValue<Slider>().Value; j++) { if (RecallDetector.GetMenuItem("SAssembliesDetectorsRecallLocalPing").GetValue<bool>()) { Game.ShowPing(PingCategory.Fallback, obj.ServerPosition, true); } else if (!RecallDetector.GetMenuItem("SAssembliesDetectorsRecallLocalPing").GetValue<bool>() && Menu.GlobalSettings.GetMenuItem("SAssembliesGlobalSettingsServerChatPingActive") .GetValue<bool>()) { Game.SendPing(PingCategory.Fallback, obj.ServerPosition); } } if (RecallDetector.GetMenuItem("SAssembliesDetectorsRecallSpeech").GetValue<bool>()) { Speech.Speak(obj.ChampionName + " " + text); } if (RecallDetector.GetMenuItem("SAssembliesDetectorsRecallNotification").GetValue<bool>()) { Common.ShowNotification(obj.ChampionName + " " + text + " " + (int)obj.Health + " " + Language.GetString("DETECTORS_RECALL_TEXT_HP") + " (" + percentHealth + ")", System.Drawing.Color.Red, 3); } } else { sColor = "<font color='#00FF00'>"; if ( RecallDetector.GetMenuItem("SAssembliesDetectorsRecallChatChoice") .GetValue<StringList>() .SelectedIndex == 1) { Game.PrintChat("{0}" + obj.ChampionName + " " + Language.GetString("DETECTORS_RECALL_TEXT_CANCELED") + " " + Language.GetString("DETECTORS_RECALL_TEXT_WITH") + " {1} " + Language.GetString("DETECTORS_RECALL_TEXT_HP") + "", sColor, (int)obj.Health); } else if ( RecallDetector.GetMenuItem("SAssembliesDetectorsRecallChatChoice") .GetValue<StringList>() .SelectedIndex == 2 && Menu.GlobalSettings.GetMenuItem( "SAssembliesGlobalSettingsServerChatPingActive").GetValue<bool>()) { Game.Say("{0}" + obj.ChampionName + " " + Language.GetString("DETECTORS_RECALL_TEXT_CANCELED") + " " + Language.GetString("DETECTORS_RECALL_TEXT_WITH") + " {1} " + Language.GetString("DETECTORS_RECALL_TEXT_HP") + "", sColor, (int)obj.Health); } for (int j = 0; j < RecallDetector.GetMenuItem("SAssembliesDetectorsRecallPingTimes").GetValue<Slider>().Value; j++) { if (RecallDetector.GetMenuItem("SAssembliesDetectorsRecallLocalPing").GetValue<bool>()) { Game.ShowPing(PingCategory.Danger, obj.ServerPosition, true); } else if (!RecallDetector.GetMenuItem("SAssembliesDetectorsRecallLocalPing").GetValue<bool>() && Menu.GlobalSettings.GetMenuItem("SAssembliesGlobalSettingsServerChatPingActive") .GetValue<bool>()) { Game.SendPing(PingCategory.Danger, obj.ServerPosition); } } if (RecallDetector.GetMenuItem("SAssembliesDetectorsRecallSpeech").GetValue<bool>()) { Speech.Speak(obj.ChampionName + " " + Language.GetString("DETECTORS_RECALL_TEXT_CANCELED")); } if (RecallDetector.GetMenuItem("SAssembliesDetectorsRecallNotification").GetValue<bool>()) { Common.ShowNotification(obj.ChampionName + " " + Language.GetString("DETECTORS_RECALL_TEXT_CANCELED") + " " + (int)obj.Health + " " + Language.GetString("DETECTORS_RECALL_TEXT_HP") + " (" + percentHealth + ")", System.Drawing.Color.LawnGreen, 3); } } return; } } } }
public PlayerInfo UpdateRecall(Packet.S2C.Recall.Struct newRecall) { this.Recall = newRecall; return this; }
private void HandleRecall(Packet.S2C.Recall.Struct recallEx) { int time = Environment.TickCount - Game.Ping; foreach (RecallInfo recall in Recalls) { if (recall == null) continue; if (recallEx.Type == Packet.S2C.Recall.ObjectType.Player) { var obj = ObjectManager.GetUnitByNetworkId<Obj_AI_Hero>(recall.NetworkId); var objEx = ObjectManager.GetUnitByNetworkId<Obj_AI_Hero>(recallEx.UnitNetworkId); if (obj == null) continue; if (obj.NetworkId == objEx.NetworkId) //already existing { recall.Recall = recallEx; recall.Recall2 = new Packet.S2C.Recall.Struct(); var t = Menu.RecallDetector.GetMenuItem("SAwarenessRecallDetectorMode").GetValue<StringList>(); if (t.SelectedIndex == 0 || t.SelectedIndex == 2) { var percentHealth = (int) ((obj.Health/obj.MaxHealth)*100); String sColor = "<font color='#FFFFFF'>"; String color = (percentHealth > 50 ? "<font color='#00FF00'>" : (percentHealth > 30 ? "<font color='#FFFF00'>" : "<font color='#FF0000'>")); if (recallEx.Status == Packet.S2C.Recall.RecallStatus.TeleportStart || recallEx.Status == Packet.S2C.Recall.RecallStatus.RecallStarted) { String text = (recallEx.Status == Packet.S2C.Recall.RecallStatus.TeleportStart ? "porting" : "recalling"); recall.StartTime = (int) Game.Time; if ( Menu.RecallDetector.GetMenuItem("SAwarenessRecallDetectorChatChoice") .GetValue<StringList>() .SelectedIndex == 1) { Game.PrintChat(obj.ChampionName + " {0} with {1} hp {2}({3})", text, (int) obj.Health, color, percentHealth); } else if ( Menu.RecallDetector.GetMenuItem("SAwarenessRecallDetectorChatChoice") .GetValue<StringList>() .SelectedIndex == 2 && Menu.GlobalSettings.GetMenuItem("SAwarenessGlobalSettingsServerChatPingActive") .GetValue<bool>()) { Game.Say(obj.ChampionName + " {0} with {1} hp {2}({3})", text, (int) obj.Health, color, percentHealth); } } else if (recallEx.Status == Packet.S2C.Recall.RecallStatus.TeleportEnd || recallEx.Status == Packet.S2C.Recall.RecallStatus.RecallFinished) { String text = (recallEx.Status == Packet.S2C.Recall.RecallStatus.TeleportStart ? "ported" : "recalled"); if ( Menu.RecallDetector.GetMenuItem("SAwarenessRecallDetectorChatChoice") .GetValue<StringList>() .SelectedIndex == 1) { Game.PrintChat(obj.ChampionName + " {0} with {1} hp {2}({3})", text, (int) obj.Health, color, percentHealth); } else if ( Menu.RecallDetector.GetMenuItem("SAwarenessRecallDetectorChatChoice") .GetValue<StringList>() .SelectedIndex == 2 && Menu.GlobalSettings.GetMenuItem( "SAwarenessGlobalSettingsServerChatPingActive").GetValue<bool>()) { Game.Say(obj.ChampionName + " {0} with {1} hp {2}({3})", text, (int) obj.Health, color, percentHealth); } } else { if ( Menu.RecallDetector.GetMenuItem("SAwarenessRecallDetectorChatChoice") .GetValue<StringList>() .SelectedIndex == 1) { Game.PrintChat(obj.ChampionName + " canceled with {0} hp", (int) obj.Health); } else if ( Menu.RecallDetector.GetMenuItem("SAwarenessRecallDetectorChatChoice") .GetValue<StringList>() .SelectedIndex == 2 && Menu.GlobalSettings.GetMenuItem( "SAwarenessGlobalSettingsServerChatPingActive").GetValue<bool>()) { Game.Say(obj.ChampionName + " canceled with {0} hp", (int) obj.Health); } } } return; } } else if (recallEx.Status == Packet.S2C.Recall.RecallStatus.TeleportStart || recallEx.Status == Packet.S2C.Recall.RecallStatus.TeleportEnd) { if (recall.Recall.Status == Packet.S2C.Recall.RecallStatus.TeleportStart) recall.Recall2 = recallEx; var obj = ObjectManager.GetUnitByNetworkId<GameObject>(recallEx.UnitNetworkId); Vector3 pos = obj.Position; for (int i = 0; i < Menu.RecallDetector.GetMenuItem("SAwarenessRecallDetectorPingTimes") .GetValue<Slider>() .Value; i++) { GamePacket gPacketT; if (Menu.RecallDetector.GetMenuItem("SAwarenessRecallDetectorLocalPing").GetValue<bool>()) { gPacketT = Packet.S2C.Ping.Encoded(new Packet.S2C.Ping.Struct(pos[0], pos[1], 0, 0, Packet.PingType.Danger)); gPacketT.Process(); } else { gPacketT = Packet.C2S.Ping.Encoded(new Packet.C2S.Ping.Struct(pos.X, pos.Y, 0, Packet.PingType.Danger)); //gPacketT.Send(); } } } } }
public EnemyInfo UpdateRecall(Packet.S2C.Teleport.Struct newRecall) { IncomingDamage.Clear(); LockedTarget = false; EstimatedShootT = 0; if (newRecall.Type == Packet.S2C.Teleport.Type.Recall && newRecall.Status == Packet.S2C.Teleport.Status.Abort) { AbortedRecall = Recall; AbortedT = Environment.TickCount; } else AbortedT = 0; Recall = newRecall; return EnemyInfo; }
public RecallRender(Packet.S2C.Teleport.Struct recall) { var recWidth = 200; Recall = recall; Rectangle = new Render.Rectangle(Drawing.Width / 2, Drawing.Height / 4, recWidth, 10, SharpDX.Color.Green); Rectangle.PositionUpdate += delegate { float percent = RecallStatusPercent(); var newWidth = (int) (recWidth - (recWidth * percent)); if (!Rectangle.Width.Equals(newWidth)) { Rectangle.Width = newWidth; } ColorBGRA newCol = Common.PercentColorRedToGreen(percent, (int)(255 - (255 * percent))); if (!Equals(newCol, Rectangle.Color)) { Rectangle.Color = newCol; } return new Vector2(Drawing.Width / 2 - recWidth / 2, Drawing.Height / 1.5f); }; Rectangle.VisibleCondition = delegate { return IsActive() && Recall.Status == Packet.S2C.Teleport.Status.Start; }; Rectangle.Add(1); Line = new Render.Line(new Vector2(0, 0), new Vector2(0, 0), 1, SharpDX.Color.WhiteSmoke); Line.StartPositionUpdate += delegate { return new Vector2(Rectangle.X + Rectangle.Width, Rectangle.Y - 5); }; Line.EndPositionUpdate += delegate { return new Vector2(Rectangle.X + Rectangle.Width, Rectangle.Y); }; Line.VisibleCondition = delegate { Color newCol = new Color(255, 255, 255, (int)(255 - (255 * RecallStatusPercent()))); if (!Equals(newCol, Line.Color)) { Line.Color = newCol; } return IsActive() && Recall.Status == Packet.S2C.Teleport.Status.Start; }; Line.Add(); Text = new Render.Text(ObjectManager.GetUnitByNetworkId<Obj_AI_Hero>(Recall.UnitNetworkId).ChampionName, 0 ,0, 18, SharpDX.Color.WhiteSmoke); Text.PositionUpdate += delegate { return new Vector2(Line.Start.X, Line.Start.Y - 15); }; Text.TextUpdate = delegate { Color newCol = new Color(255, 255, 255, (int)(255 - (150 * RecallStatusPercent()))); if (!Equals(newCol, Text.Color)) { Text.Color = newCol; } TimeSpan t = TimeSpan.FromMilliseconds(Recall.Start + Recall.Duration - Environment.TickCount); string time = string.Format("{0:D2},{1:D3}", t.Seconds, t.Milliseconds); return ObjectManager.GetUnitByNetworkId<Obj_AI_Hero>(Recall.UnitNetworkId).ChampionName + "\n" + time; }; Text.Centered = true; Text.VisibleCondition = delegate { return IsActive() && Recall.Status == Packet.S2C.Teleport.Status.Start; }; Text.Add(); }
private static float CalcRecallBar(Packet.S2C.Teleport.Struct recall) { float percent = (100f / recall.Duration * (Environment.TickCount - recall.Start)); return (percent <= 100 ? percent/100 : 1f); }