Example #1
0
        public static void DrawAllSpellRange(Color RGB)
        {
            foreach (string RangeSlot in RangeSlotList)
            {
                float SpellRange = SpellBook.SpellDB[RangeSlot].ToObject <JObject>()["Range"][0]
                                   .ToObject <float>();

                if (UsedRangeSlotsList.Count != 0)
                {
                    if (!UsedRangeSlotsList.Contains(SpellRange))
                    {
                        UsedRangeSlotsList.Add(SpellRange);
                    }
                }
                else
                {
                    UsedRangeSlotsList.Add(SpellRange);
                }
            }

            foreach (float Range in UsedRangeSlotsList)
            {
                DrawFactory.DrawCircleRange(GetPosition(), Range, RGB, 2.5f);
            }
        }
Example #2
0
        public static void DrawPlayerDetils(AActor player, Vector2 screenSize, Color color)
        {
            Vector3 vecLocalPlayer = Main.cameraManager.CameraCache.POV.Location;
            Vector3 Headd          = player.GetBoneLocation(6);

            Headd.Z += 30;
            Vector2 Headw2s          = WorldToScreen(Headd, screenSize);
            Vector2 Center           = WorldToScreen(player.GetBoneLocation(1), screenSize);
            Vector2 Root             = WorldToScreen(player.GetBoneLocation(0), screenSize);
            float   curDist          = (Headd - vecLocalPlayer).Length();
            float   flWidth          = Math.Abs((Root.Y - Headw2s.Y) / 4);
            Vector2 LeftUpperCorner  = new Vector2((Center.X - flWidth), Headw2s.Y);
            Vector2 LeftDownCorner   = new Vector2((Center.X - flWidth), Root.Y);
            Vector2 RightUpperCorner = new Vector2((Center.X + flWidth), Headw2s.Y);
            Vector2 RightDownCorner  = new Vector2((Center.X + flWidth), Root.Y);
            float   Height           = Vector2.Distance(RightDownCorner, RightUpperCorner);
            int     fontSize         = ((int)Height) / 20;


            //Modules.LogService.Log(fontSize.ToString());



            Vector2 feetScreenLocation = WorldToScreen(player.GetBoneLocation(0), screenSize);
            Vector2 headScreenLocation = WorldToScreen(Headd, screenSize);
            float   xHeight            = feetScreenLocation.Y - headScreenLocation.Y;
            float   xWidth             = xHeight / 2.5f;

            float x = Headw2s.X; float y = Headw2s.Y;
            float flX = x - 7 - Height / 4f; float flY = y - 1;

            DrawFactory.DrawText(player.PlayerName.ToString(), fontSize, new Vector2(Headw2s.X, Headw2s.Y - 5), color);
            DrawFactory.DrawText("[" + (int)curDist / 100 + "M]", 7, new Vector2(Root.X, Root.Y + 10), color);
            DrawHealthBar(Headw2s, xHeight, player.Health);
        }
Example #3
0
        public static void DrawSkelton(AActor player, Vector2 screenSize, Color color)
        {
            if (!PlayerBonesESP)
            {
                return;
            }
            Vector2[][] bones = GetBonesLocations(player, screenSize);

            Vector2 prev, current;

            for (int ii = 0; ii < bones.Length; ii++)
            {
                prev    = new Vector2(0, 0);
                current = new Vector2(0, 0);
                for (int j = 0; j < bones[ii].Length; j++)
                {
                    if (prev.X == 0 && prev.Y == 0)
                    {
                        prev = bones[ii][j];
                        continue;
                    }
                    current = bones[ii][j];
                    //   renderer.DrawText(j + " " + ii, current, 12, color);
                    DrawFactory.DrawLine(prev.X, prev.Y, current.X, current.Y, 2, color);
                    prev = current;
                }
            }
        }
Example #4
0
 public static void DrawSpellRange(SpellBook.SpellSlot Slot, Color Colour, float Thickness)
 {
     if (IsVisible() && GetCurrentHealth() > 1.0f)
     {
         DrawFactory.DrawCircleRange(GetPosition(), SpellBook.GetSpellRadius(Slot),
                                     Colour, Thickness);
     }
 }
Example #5
0
 public static void DrawAttackRange(Color Colour, float Thickness)
 {
     if (IsVisible() && GetCurrentHealth() > 1.0f)
     {
         DrawFactory.DrawCircleRange(GetPosition(), GetBoundingRadius() + GetAttackRange(),
                                     Colour, Thickness);
     }
 }
Example #6
0
 /* Method that converts a Draw Service into a Draw Factory */
 public void ToDrawServiceToToDrawFactory(WorldObject wObji, WorldObject wObjf)
 {
     if (wObji.ContainService(typeof(DrawService)))
     {
         DrawFactory toDrawFact = new DrawFactory();
         /* Save the factory in the object builder list */
         wObjf.objectBuilder.Add(toDrawFact);
     }
 }
Example #7
0
        public static void DrawItem(AActor item, Vector2 screenSize)
        {
            Vector2 location = WorldToScreen(item.RootComponent().RelativeLocation, screenSize);

            if (location.X > screenSize.X || location.Y > screenSize.Y)
            {
                return;
            }
            DrawFactory.DrawText(item.IsItem, 7, new Vector2(location.X, location.Y), Color.Red);
        }
Example #8
0
        public static void DrawVehicle(AActor Vehicle, Vector2 screenSize)
        {
            Vector2 location = WorldToScreen(Vehicle.RootComponent().RelativeLocation, screenSize);

            if (location.X > screenSize.X || location.Y > screenSize.Y)
            {
                return;
            }

            DrawFactory.DrawText(Vehicle.IsVehicle, 18, new Vector2(location.X, location.Y), Color.Red);
        }
Example #9
0
        public static void DrawBox(AActor player, Vector2 screenSize, Color color)
        {
            Vector2 feetScreenLocation = WorldToScreen(player.GetBoneLocation(0), screenSize);
            Vector3 Headd = player.GetBoneLocation(6);

            Headd.Z += 30;
            Vector2 headScreenLocation = WorldToScreen(Headd, screenSize);
            float   xHeight            = feetScreenLocation.Y - headScreenLocation.Y;
            float   xWidth             = xHeight / 2.5f;
            Vector2 xx = new Vector2(headScreenLocation.X - xWidth / 2, headScreenLocation.Y);

            DrawFactory.DrawBox(xx.X, xx.Y, xWidth, xHeight, color);
        }
Example #10
0
        internal void OnLoad()
        {
            NativeImport.SetWindowLong(this.Handle, DrawFactory.GWL_EXSTYLE, (IntPtr)(NativeImport.GetWindowLong(this.Handle, DrawFactory.GWL_EXSTYLE) ^ (DrawFactory.WS_EX_LAYERED ^ DrawFactory.WS_EX_TRANSPARENT)));/*(IntPtr)(NativeImport.GetWindowLong(this.Handle, DrawFactory.GWL_EXSTYLE) ^*/
            NativeImport.SetLayeredWindowAttributes(this.Handle, 0, 255, DrawFactory.LWA_ALPHA);
            NativeImport.RECT rct = default;
            NativeImport.GetWindowRect(Utils.GetPubgWindow(), out rct);

            this.Width    = rct.Right - rct.Left;
            this.Height   = rct.Bottom - rct.Top;
            this.Location = new System.Drawing.Point(rct.Left, rct.Top);

            if (IsInitialised == false)
            {
                PresentParameters presentParameters = new PresentParameters();
                presentParameters.Windowed         = true;
                presentParameters.SwapEffect       = SwapEffect.Discard;
                presentParameters.BackBufferFormat = Format.A8R8G8B8;

                DrawFactory.device = new Device(DrawFactory.D3D, 0, DeviceType.Hardware, this.Handle, CreateFlags.HardwareVertexProcessing, presentParameters);

                DrawFactory.drawLine          = new Line(DrawFactory.device);
                DrawFactory.drawBoxLine       = new Line(DrawFactory.device);
                DrawFactory.drawCircleLine    = new Line(DrawFactory.device);
                DrawFactory.drawFilledBoxLine = new Line(DrawFactory.device);
                DrawFactory.drawTriLine       = new Line(DrawFactory.device);

                FontDescription fontDescription = new FontDescription()
                {
                    FaceName        = "Fixedsys Regular",
                    CharacterSet    = FontCharacterSet.Default,
                    Height          = 20,
                    Weight          = FontWeight.Regular,
                    MipLevels       = 0,
                    OutputPrecision = FontPrecision.Default,
                    PitchAndFamily  = FontPitchAndFamily.Default,
                    Quality         = FontQuality.ClearType
                };

                DrawFactory.font = new SharpDX.Direct3D9.Font(DrawFactory.device, fontDescription);
                DrawFactory.InitialiseCircleDrawing(DrawFactory.device);

                IsInitialised = true;

                OnDraw();
            }
        }
Example #11
0
        internal void OnLoad()
        {
            NativeImport.SetWindowLong(Handle, DrawFactory.GWL_EXSTYLE,
                                       (IntPtr)(NativeImport.GetWindowLong(Handle, DrawFactory.GWL_EXSTYLE) ^ DrawFactory.WS_EX_LAYERED ^
                                                DrawFactory.WS_EX_TRANSPARENT));

            NativeImport.SetLayeredWindowAttributes(Handle, 0, 255, DrawFactory.LWA_ALPHA);

            if (IsInitialised)
            {
                return;
            }
            var presentParameters = new PresentParameters
            {
                Windowed = true, SwapEffect = SwapEffect.Discard, BackBufferFormat = Format.A8R8G8B8
            };

            DrawFactory.device = new Device(DrawFactory.D3D, 0, DeviceType.Hardware, Handle,
                                            CreateFlags.HardwareVertexProcessing, presentParameters);

            DrawFactory.drawLine          = new Line(DrawFactory.device);
            DrawFactory.drawBoxLine       = new Line(DrawFactory.device);
            DrawFactory.drawCircleLine    = new Line(DrawFactory.device);
            DrawFactory.drawFilledBoxLine = new Line(DrawFactory.device);
            DrawFactory.drawTriLine       = new Line(DrawFactory.device);

            var fontDescription = new FontDescription
            {
                FaceName        = "Fixedsys Regular",
                CharacterSet    = FontCharacterSet.Default,
                Height          = 20,
                Weight          = FontWeight.Bold,
                MipLevels       = 0,
                OutputPrecision = FontPrecision.Default,
                PitchAndFamily  = FontPitchAndFamily.Default,
                Quality         = FontQuality.ClearType
            };

            DrawFactory.font = new Font(DrawFactory.device, fontDescription);
            DrawFactory.InitialiseCircleDrawing(DrawFactory.device);

            IsInitialised = true;

            OnDraw();
        }
Example #12
0
        public static void EvaluateTarget(AActor actor)
        {
            // if (!IsVisiable(actor))
            //      return;
            if (actor.Health < 1f)
            {
                return;
            }

            Vector2 centerScreen      = new Vector2(screensize.X / 2, screensize.Y / 2);
            Vector3 vecLocalPlayer    = Main.cameraManager.CameraCache.POV.Location;
            Vector3 vecTargetPlayer   = actor.GetBoneLocation((int)aimPos);
            Vector2 vecTargetPlayer2d = Main.cameraManager.WorldToScreen(vecTargetPlayer, screensize);


            float   BulletSpeed    = Main.localPawn.EquipWeapon().ShootWeaponEntityComp().BulletFireSpeed / 100;
            Vector3 TargetVelocity = GetPlayerVelocity(actor);
            float   curDist        = (vecTargetPlayer - vecLocalPlayer).Length();
            float   timeToTravel   = (curDist / 100) / BulletSpeed;

            if (timeToTravel > 1f && !float.IsInfinity(timeToTravel))
            {
                vecTargetPlayer   += TargetVelocity * timeToTravel;
                vecTargetPlayer.Z += TargetVelocity.Z * timeToTravel + 0.5f * 588.6f * timeToTravel * timeToTravel;
            }

            Vector2 head       = Main.cameraManager.WorldToScreen(actor.GetBoneLocation((int)aimPos), screensize);
            Vector2 prediction = Main.cameraManager.WorldToScreen(vecTargetPlayer, screensize);

            DrawFactory.DrawLine(head.X, head.Y, prediction.X, prediction.Y, 3, Color.Yellow);



            if (isInside(centerScreen.X, centerScreen.Y, 200, vecTargetPlayer2d))
            {
                if (curDist < distance)
                {
                    Rotator angDelta = ToRotator(vecLocalPlayer, vecTargetPlayer);
                    idealAngDelta = angDelta;
                    bestActor     = actor;
                    distance      = curDist;
                }
            }
        }
Example #13
0
        private static void DrawHealthBar(Vector2 Headw2s, float Height, float Health)
        {
            float x = Headw2s.X; float y = Headw2s.Y;
            float flBoxes = (float)Math.Ceiling(Health / 10f);
            float flX = x - 7 - Height / 4f; float flY = y - 1;
            float flHeight  = Height / 10f;
            Color ColHealth = new Color();

            Health = Math.Max(0, Math.Min(Health, 100));

            ColHealth.R = (byte)Math.Min((510 * (100 - Health)) / 100, 255);
            ColHealth.G = (byte)Math.Min((510 * Health) / 100, 255);
            ColHealth.B = 0;
            ColHealth.A = 255;

            DrawFactory.DrawBox(flX, flY, 4, Height + 2, new Color(80, 80, 80, 125));
            DrawFactory.DrawBox(flX, flY, 4, Height + 2, Color.Black);
            DrawFactory.DrawFilledBox(flX + 1, flY, 2, flHeight * flBoxes + 1, ColHealth);

            for (int i = 0; i < 10; i++)
            {
                DrawFactory.DrawLine(flX, flY + i * flHeight, flX + 4, flY + i * flHeight, 1, Color.Black);
            }
        }
Example #14
0
        public static void DrawBox3d(AActor player, Vector2 screenSize, Color color)
        {
            SceneComponent RootComponent = player.RootComponent();
            Vector3        loclLocation  = Main.localPawn.RootComponent().RelativeLocation;
            Vector3        enimeLocation = RootComponent.RelativeLocation;
            float          distince      = Vector3.Distance(loclLocation, enimeLocation);


            Vector3 Head = player.GetBoneLocation(6);

            Head.Z += 50;
            Vector2 Heads2s = WorldToScreen(Head, screenSize);



            float l, w, h, o;

            l = 80f; o = 50f; //box size for standing player
            h = Vector3.Distance(player.GetBoneLocation(0), Head);
            w = h / 2;        //Vector3.Distance(player.GetBoneLocation(63), player.GetBoneLocation(64));


            float zOffset = -100f;

            //if (actor.Type == ActorTypes.Vehicle) //vehicles have a bigger box
            //{
            //	zOffset = 50;
            //	l = 200f; w = 160f; h = 80f; o = 0f;
            //}

            //build box
            Vector3 p00 = new Vector3(o, -w / 2, 0f);
            Vector3 p01 = new Vector3(o, w / 2, 0f);
            Vector3 p02 = new Vector3(o - l, w / 2, 0f);
            Vector3 p03 = new Vector3(o - l, -w / 2, 0f);

            //rotate rectangle to match actor rotation
            float  theta1 = 2.0f * (float)Math.PI * (Main.cameraManager.CameraCache.POV.Rotation.Pitch) / 180.0f;
            Matrix rotM   = Matrix.RotationZ((float)(theta1 / 2)); // rotate around Z-axis

            Vector3 curPos = new Vector3(RootComponent.RelativeLocation.X, RootComponent.RelativeLocation.Y, RootComponent.RelativeLocation.Z + zOffset);

            p00 = Vector3.TransformCoordinate(p00, rotM) + curPos;
            p01 = Vector3.TransformCoordinate(p01, rotM) + curPos;
            p02 = Vector3.TransformCoordinate(p02, rotM) + curPos;
            p03 = Vector3.TransformCoordinate(p03, rotM) + curPos;

            Vector2 s00 = WorldToScreen(p00, screenSize);
            Vector2 s01 = WorldToScreen(p01, screenSize);
            Vector2 s02 = WorldToScreen(p02, screenSize);
            Vector2 s03 = WorldToScreen(p03, screenSize);

            Vector2[] square0 = { s00, s01, s02, s03, s00 };

            for (int x = 0; x < square0.Length - 1; x++)
            {
                DrawFactory.DrawLine(square0[x].X, square0[x].Y, square0[x + 1].X, square0[x + 1].Y, 2, color);
            }


            // top rectangle
            p00.Z += h; s00 = WorldToScreen(p00, screenSize);
            p01.Z += h; s01 = WorldToScreen(p01, screenSize);
            p02.Z += h; s02 = WorldToScreen(p02, screenSize);
            p03.Z += h; s03 = WorldToScreen(p03, screenSize);

            Vector2[] square1 = { s00, s01, s02, s03, s00 };
            for (int x = 0; x < square1.Length - 1; x++)
            {
                DrawFactory.DrawLine(square1[x].X, square1[x].Y, square1[x + 1].X, square1[x + 1].Y, 2, color);
            }


            // upper/lower rectangles get connected
            DrawFactory.DrawLine(square0[0].X, square0[0].Y, square1[0].X, square1[0].Y, 2, color);
            DrawFactory.DrawLine(square0[1].X, square0[1].Y, square1[1].X, square1[1].Y, 2, color);
            DrawFactory.DrawLine(square0[2].X, square0[2].Y, square1[2].X, square1[2].Y, 2, color);
            DrawFactory.DrawLine(square0[3].X, square0[3].Y, square1[3].X, square1[3].Y, 2, color);
        }
Example #15
0
        public static void OnDeviceDraw()
        {
            if (Utils.IsGameOnDisplay())
            {
                //When ~ key is pressed...
                DrawMenu();
                Aimbot.BeginFrame();
                List <List <AActor> > actors = Main.actors;
                if (actors == null)
                {
                    return;
                }
                if (DrawingProperties["DrawPlayers"])
                {
                    for (int i = 0; i < actors[0].Count; i++)
                    {
                        AActor actor = actors[0][i];
                        if (actor.TeamID != Main.localPawn.TeamID && actor.PlayerName.ToString() != Main.localPawn.PlayerName.ToString() && Main.localPawn.IsPlayer)
                        {
                            Aimbot.EvaluateTarget(actor);
                            if (DrawingProperties["DrawSkelton"])
                            {
                                ESP.DrawSkelton(actor, ScreenSize, SkeltonColor);
                            }
                            if (DrawingProperties["Draw2dBox"])
                            {
                                ESP.DrawBox(actors[0][i], ScreenSize, BoxColor);
                            }
                            if (DrawingProperties["Draw3dBox"])
                            {
                                ESP.DrawBox3d(actors[0][i], ScreenSize, BoxColor);
                            }
                            ESP.DrawPlayerDetils(actors[0][i], ScreenSize, BoxColor);
                        }
                    }
                }
                if (DrawingProperties["DrawCrosshair"])
                {
                    int   crosshairtype = 0;
                    float CenterX       = ScreenSize.X / 2;
                    float CenterY       = ScreenSize.Y / 2;
                    switch (crosshairtype)
                    {
                    case 0:

                        DrawFactory.DrawFilledBox(CenterX - 20, CenterY, 40, 1, Color.Purple); //Purple
                        DrawFactory.DrawFilledBox(CenterX, CenterY - 20, 1, 40, Color.Purple);
                        DrawFactory.DrawFilledBox(CenterX - 17, CenterY, 34, 1, Color.Blue);   //Blue
                        DrawFactory.DrawFilledBox(CenterX, CenterY - 17, 1, 34, Color.Blue);
                        DrawFactory.DrawFilledBox(CenterX - 14, CenterY, 28, 1, Color.Cyan);   //Cyan
                        DrawFactory.DrawFilledBox(CenterX, CenterY - 14, 1, 28, Color.Cyan);
                        DrawFactory.DrawFilledBox(CenterX - 11, CenterY, 22, 1, Color.Green);  //Green
                        DrawFactory.DrawFilledBox(CenterX, CenterY - 11, 1, 22, Color.Green);
                        DrawFactory.DrawFilledBox(CenterX - 9, CenterY, 18, 1, Color.Yellow);  //Yellow
                        DrawFactory.DrawFilledBox(CenterX, CenterY - 9, 1, 18, Color.Yellow);
                        DrawFactory.DrawFilledBox(CenterX - 6, CenterY, 12, 1, Color.Orange);  //Orange
                        DrawFactory.DrawFilledBox(CenterX, CenterY - 6, 1, 12, Color.Orange);
                        DrawFactory.DrawFilledBox(CenterX - 3, CenterY, 6, 1, Color.Red);      //Red
                        DrawFactory.DrawFilledBox(CenterX, CenterY - 3, 1, 6, Color.Red);
                        break;

                    case 1:
                        DrawFactory.DrawCircle((int)CenterX, (int)CenterY, 8, 50, Color.Red); //Circle
                        DrawFactory.DrawFilledBox(CenterX - 17, CenterY, 10, 1, Color.Red);   //Left line
                        DrawFactory.DrawFilledBox(CenterX + 9, CenterY, 10, 1, Color.Red);    // Right line
                        DrawFactory.DrawFilledBox(CenterX, CenterY - 17, 1, 10, Color.Red);   //Top line
                        DrawFactory.DrawFilledBox(CenterX, CenterY + 9, 1, 10, Color.Red);    //Bottom line
                        DrawFactory.DrawPoint(CenterX, CenterY, Color.Green);                 //Dot point
                        break;
                    }
                }
                if (DrawingProperties["DrawFOV"])
                {
                    float CenterX = ScreenSize.X / 2;
                    float CenterY = ScreenSize.Y / 2;
                    DrawFactory.DrawCircle((int)CenterX, (int)CenterY, FOV, 50, Color.Black);
                }
                if (DrawingProperties["DrawLoot"])
                {
                    for (int i = 0; i < actors[1].Count; i++)
                    {
                        AActor actor = actors[1][i];

                        ESP.DrawItem(actor, ScreenSize);
                    }
                }
                if (DrawingProperties["DrawVehicle"])
                {
                    for (int i = 0; i < actors[2].Count; i++)
                    {
                        AActor actor = actors[2][i];
                        ESP.DrawVehicle(actor, ScreenSize);
                    }
                }
                if (DrawingProperties["Aimbot"] || DrawingProperties["MagicBullet"])
                {
                    Vector2 feetScreenLocation = Main.cameraManager.WorldToScreen(Aimbot.bestActor.GetBoneLocation(0), ScreenSize);
                    Vector3 Headd = Aimbot.bestActor.GetBoneLocation(6);
                    Headd.Z += 30;
                    Vector2 headScreenLocation = Main.cameraManager.WorldToScreen(Headd, ScreenSize);
                    float   xHeight            = feetScreenLocation.Y - headScreenLocation.Y;
                    float   xWidth             = xHeight / 2.5f;
                    Vector2 headw2s            = Main.cameraManager.WorldToScreen(Aimbot.bestActor.GetBoneLocation(6), ScreenSize);
                    DrawFactory.DrawCircle((int)headw2s.X, (int)headw2s.Y, xWidth / 6, 50, SkeltonColor);
                    if (Utils.IsKeyPressed(Keys.RButton) || Utils.IsKeyPressed(Keys.LButton))
                    {
                        Aimbot.AimToTarget();
                    }
                }
            }
        }