Ejemplo n.º 1
0
        public static void AimAt(int entity, int boneId, int pEntity, int moduleAddr)
        {
            int addrTemp    = pEntity + Statics.netvars.m_aimPunchAngle;
            int engineState = (int)m.GetInsufficentMaterials("engine.dll");

            float[] punch = SimpleMath.Multiply(m.DeployRopes <float>((IntPtr)addrTemp, Marshal.SizeOf <float>()), 2);
            addrTemp = pEntity + Statics.netvars.m_vecOrigin;
            float[] eyePos = m.DeployRopes <float>((IntPtr)addrTemp, Marshal.SizeOf <float>());
            eyePos[2] += m.DeployRope <float>((IntPtr)(pEntity + Statics.netvars.m_vecViewOffset + 0x8));
            int clientState = m.DeployRope <int>((IntPtr)engineState + Statics.signatures.dwClientState);

            /* float oAng1 = m.DeployRope<float>((IntPtr)clientState + Statics.signatures.dwClientState_ViewAngles);
             * float oAng2 = m.DeployRope<float>((IntPtr)clientState + Statics.signatures.dwClientState_ViewAngles + 0x4);
             * float oAng3 = m.DeployRope<float>((IntPtr)clientState + Statics.signatures.dwClientState_ViewAngles + 0x8);
             * Vector3D oAng = new Vector3D();
             * oAng.X = oAng1;
             * oAng.Y = oAng2;
             * oAng.Z = oAng3;*/
            float[] oAng = m.DeployRopes <float>((IntPtr)clientState + Statics.signatures.dwClientState_ViewAngles, 0);
            Console.WriteLine("" + string.Join("; ", oAng));
            float[] newAngles = SimpleMath.Normalized(
                SimpleMath.SmoothnNormalize(oAng,
                                            SimpleMath.DifferenceBetween(punch,
                                                                         SimpleMath.Normalized(SimpleMath.CalculateAngles(eyePos, GetBonePos(entity, boneId))
                                                                                               )), 20));
            Console.WriteLine("" + string.Join("; ", newAngles));
            float[] nAng = newAngles;

            m.CraftRope <float>((IntPtr)(clientState + Statics.signatures.dwClientState_ViewAngles), nAng, 0);
        }
Ejemplo n.º 2
0
        public static void BCircle()
        {
            int    currentTarget = 0x420;
            IntPtr moduleAddr    = module;
            int    entity        = 0;

            entity = m.DeployRope <int>((moduleAddr + Statics.signatures.dwLocalPlayer));
            int   addr = (int)moduleAddr + Statics.signatures.dwEntityList;
            int   team = 0;
            int   ourTeam = m.DeployRope <int>((IntPtr)(entity + Statics.netvars.m_iTeamNum));
            int   closest = 0;
            float cDist = 0.0f;
            int   cId = 0; int addrTemp = entity + 0x302C;
            int   engineState = (int)m.GetInsufficentMaterials("engine.dll");

            float[] punch = SimpleMath.Multiply(m.DeployRopes <float>((IntPtr)addrTemp, 3), 2);
            Console.WriteLine("Punch: " + string.Join("; ", punch));
            addrTemp = entity + Statics.netvars.m_vecOrigin;
            float[] eyePos = m.DeployRopes <float>((IntPtr)addrTemp, Marshal.SizeOf <float>());
            eyePos[2] += m.DeployRope <float>((IntPtr)(entity + Statics.netvars.m_vecViewOffset + 0x8));
            //Console.WriteLine("Position: " + string.Join("; ", eyePos));
            int clientState = m.DeployRope <int>((IntPtr)engineState + Statics.signatures.dwClientState);

            /* DWriteText newD = new DWriteText($"Searching for Target!" +
             *       $"\nClosest Entity Address: {currentTarget}" +
             *       $"\nClosest Entity Team: {team}" +
             *       $"\nOur Position: {string.Join(','.ToString(), eyePos)}" +
             *       $"\nPunch Angle: {string.Join(','.ToString(), punch)}"
             *       );
             * newD.Draw(Screen.PrimaryScreen.Bounds.Top, Screen.PrimaryScreen.Bounds.Left);*/
            if (GetAsyncKeyState(Keys.LButton) != 0)
            {
                int health = 0;
                if (currentTarget == 0x420)
                {
                    cId           = m.DeployRope <int>((IntPtr)(entity + Statics.netvars.m_iCrosshairId));
                    currentTarget = m.DeployRope <int>((IntPtr)(addr + (cId - 1) * 0x10));
                    team          = m.DeployRope <int>((IntPtr)(currentTarget + Statics.netvars.m_iTeamNum));
                }

                health = m.DeployRope <int>((IntPtr)(currentTarget + Statics.netvars.m_iHealth));
                if (ourTeam != team && health > 0 && cId >= 0 && cId < 65 && currentTarget != 0x420) //ako celta ima validni parametri za igrach
                {
                    // Console.WriteLine("Client State: " + clientState);

                    /*float oAng1 = m.DeployRope<float>((IntPtr)clientState + Statics.signatures.dwClientState_ViewAngles);
                     * float oAng2 = m.DeployRope<float>((IntPtr)clientState + Statics.signatures.dwClientState_ViewAngles + 0x4);
                     * float oAng3 = m.DeployRope<float>((IntPtr)clientState + Statics.signatures.dwClientState_ViewAngles + 0x8);
                     * Vector3D oAng = new Vector3D();
                     * oAng.X = oAng1;
                     * oAng.Y = oAng2;
                     * oAng.Z = oAng3;*/
                    float[] oAng = m.DeployRopes <float>((IntPtr)clientState + Statics.signatures.dwClientState_ViewAngles, 3);
                    Console.WriteLine("" + string.Join("; ", oAng));
                    float[] newAngles = SimpleMath.Normalized(
                        SimpleMath.SmoothnNormalize(oAng,
                                                    SimpleMath.DifferenceBetween(punch,
                                                                                 SimpleMath.Normalized(SimpleMath.CalculateAngles(eyePos, GetBonePos(entity, 8))
                                                                                                       )), 20));
                    float[] calcAng    = SimpleMath.CalculateAngles(eyePos, GetBonePos(currentTarget, 8));
                    float[] normalized = SimpleMath.Normalized(calcAng);
                    float[] diff       = SimpleMath.DifferenceBetween(punch, normalized);
                    float[] smth       = SimpleMath.SmoothnNormalize(oAng, diff, 20);
                    float[] norm2      = SimpleMath.Normalized(smth);
                    float[] nAng       = norm2;


                    m.CraftRope <float>((IntPtr)(clientState + Statics.netvars.m_viewPunchAngle), nAng, 0);
                    Console.WriteLine("" + string.Join("; ", nAng));
                    // AimAt(currentTarget, 6, entity, (int)module);
                }
                else if ((cId < 1 || cId >= 65))
                {
                    currentTarget = 0x00;
                }
            }
            else
            {
                currentTarget = 0x00;
            }
        }