private void Game_OnGameUpdate(EventArgs args) { if (Hero.ServerPosition != LastLocation && Hero.ServerPosition != BeforeRecallLocation) { LastLocation = Hero.ServerPosition; PredictedLocation = Hero.ServerPosition; LastSeen = Game.ClockTime; } if (!Hero.IsVisible && RecallStatus != Packet.S2C.Teleport.Status.Start) { PredictedLocation = new Vector3( LastLocation.X + ((Game.ClockTime - LastSeen) * Hero.MoveSpeed), LastLocation.Y, LastLocation.Z); } if (Hero.IsVisible && !Hero.IsDead) { Pinged = false; LastSeen = Game.ClockTime; } if (LastSeen > 0f && MinimapHack.Instance().Menu.Ping&& !Hero.IsVisible) { if (Game.ClockTime - LastSeen >= MinimapHack.Instance().Menu.MinPing&& !Pinged) { Packet.S2C.Ping.Encoded( new Packet.S2C.Ping.Struct( LastLocation.X, LastLocation.Y, Hero.NetworkId, ObjectManager.Player.NetworkId, Packet.PingType.EnemyMissing)).Process(); Pinged = true; } } }
private void Game_OnGameUpdate(EventArgs args) { if (Hero.ServerPosition != LastLocation && Hero.ServerPosition != BeforeRecallLocation) { LastLocation = Hero.ServerPosition; PredictedLocation = Hero.ServerPosition; LastSeen = Game.Time; } if (!Hero.IsVisible && RecallStatus != Packet.S2C.Teleport.Status.Start) { PredictedLocation = new Vector3( LastLocation.X + ((Game.Time - LastSeen) * Hero.MoveSpeed), LastLocation.Y, LastLocation.Z); } if (Hero.IsVisible && !Hero.IsDead) { Pinged = false; LastSeen = Game.Time; } if (LastSeen > 0f && MinimapHack.Instance().Menu.Ping&& !Hero.IsVisible) { if (Game.Time - LastSeen >= MinimapHack.Instance().Menu.MinPing&& !Pinged) { TacticalMap.ShowPing(PingCategory.EnemyMissing, Hero, true); Pinged = true; } } }
private void Drawing_OnEndScene(EventArgs args) { if (!Hero.IsVisible && !Hero.IsDead) { float radius = Math.Abs(LastLocation.X - PredictedLocation.X); if (radius < MinimapHack.Instance().Menu.SSCircleSize&& MinimapHack.Instance().Menu.SSCircle) { Utility.DrawCircle(LastLocation, radius, MinimapHack.Instance().Menu.SSCircleColor, 1, 30, true); } } if (Text.Visible) { Text.OnEndScene(); } }
private static Bitmap ChangeOpacity(Bitmap img) { var bmp = new Bitmap(img.Width, img.Height); // Determining Width and Height of Source Image Graphics graphics = Graphics.FromImage(bmp); var colormatrix = new ColorMatrix { Matrix33 = MinimapHack.Instance().Menu.IconOpacity }; var imgAttribute = new ImageAttributes(); imgAttribute.SetColorMatrix(colormatrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap); graphics.DrawImage( img, new Rectangle(0, 0, bmp.Width, bmp.Height), 0, 0, img.Width, img.Height, GraphicsUnit.Pixel, imgAttribute); graphics.Dispose(); // Releasing all resource used by graphics img.Dispose(); return(bmp); }
public HeroTracker(Obj_AI_Hero hero, Bitmap bmp) { Hero = hero; RecallStatus = Packet.S2C.Teleport.Status.Unknown; Hero = hero; var image = new Render.Sprite(bmp, new Vector2(0, 0)); image.GrayScale(); image.Scale = new Vector2(MinimapHack.Instance().Menu.IconScale, MinimapHack.Instance().Menu.IconScale); image.VisibleCondition = sender => !hero.IsVisible && !hero.IsDead; image.PositionUpdate = delegate { Vector2 v2 = Drawing.WorldToMinimap(LastLocation); v2.X -= image.Width / 2f; v2.Y -= image.Height / 2f; return(v2); }; image.Add(0); LastSeen = 0; LastLocation = hero.ServerPosition; PredictedLocation = hero.ServerPosition; BeforeRecallLocation = hero.ServerPosition; Text = new Render.Text(0, 0, "", MinimapHack.Instance().Menu.SSTimerSize, Color.White) { VisibleCondition = sender => !hero.IsVisible && !Hero.IsDead && MinimapHack.Instance().Menu.SSTimer&& LastSeen > 20f && MinimapHack.Instance().Menu.SSTimerStart <= Game.ClockTime - LastSeen, PositionUpdate = delegate { Vector2 v2 = Drawing.WorldToMinimap(LastLocation); v2.Y += MinimapHack.Instance().Menu.SSTimerOffset; return(v2); }, TextUpdate = () => Program.Format(Game.ClockTime - LastSeen), OutLined = true, Centered = true }; Text.Add(0); Obj_AI_Base.OnTeleport += Obj_AI_Base_OnTeleport; Game.OnUpdate += Game_OnGameUpdate; Drawing.OnEndScene += Drawing_OnEndScene; }
private void Drawing_OnEndScene(EventArgs args) { if (!Hero.IsVisible && !Hero.IsDead) { float radius = Math.Abs(LastLocation.X - PredictedLocation.X); if (radius < MinimapHack.Instance().Menu.SSCircleSize&& MinimapHack.Instance().Menu.SSCircle) { System.Drawing.Color c = System.Drawing.Color.Green; if (RecallStatus == Packet.S2C.Teleport.Status.Start) { c = System.Drawing.Color.LightBlue; } LeagueSharp.Common.Utility.DrawCircle(LastLocation, radius, c, 1, 30, true); } } if (Text.Visible) { Text.OnEndScene(); } }
private static void Game_OnGameLoad(EventArgs args) { Resources.ResourceManager.IgnoreCase = true; MinimapHack.Instance().Load(); Print("Loaded!"); }
public static void Game_OnGameLoad() { Resources.ResourceManager.IgnoreCase = true; MinimapHack.Instance().Load(); Print("Loaded!"); }