public void CheckForOffside()
        {
            float curPuckZ = Puck.Position.Z;

            Player[] players = PlayerManager.Players;
            float    pos     = FindLastBluePlayer().Position.Z;

            //0x7D3495C - id of last player to touch the puck
            if (FindRedsOffside(pos).Contains(MemoryEditor.ReadInt(0x7D3495C)) && !m_OffsideCalled)
            {
                Chat.SendMessage("Offside!");
                m_OffsideCalled = true;
                PuckCollision(true);
                //m_OffsideCalled = false;
            }
            //touching = MemoryEditor.ReadInt(0x1893E1C);

            /*
             * if (lastPlayerToTouch != MemoryEditor.ReadInt(0x7D3495C) && !m_OffsideCalled)
             * {
             *  lastPlayerToTouch = MemoryEditor.ReadInt(0x7D3495C);
             *  if (LastTeamToTouch == 0)
             *  {
             *      float pos = FindLastBluePlayer().Position.Z;
             *      if (FindRedsOffside(pos).Contains(MemoryEditor.ReadInt(0x7D3495C)))
             *      {
             *          Chat.SendMessage("Offside!");
             *          m_OffsideCalled = true;
             *          PuckTempDisable();
             *      }
             *  }
             * }
             */
            System.Threading.Thread.Sleep(500);
        }
Beispiel #2
0
        private static void FindGame()
        {
            while (true)
            {
                switch (ThreadState)
                {
                case State.FindGame:
                    string         error;
                    FindGameResult result = MemoryEditor.FindGame("League of Legends (TM) Client", out error);
                    //MemoryEditor.Context context = MemoryEditor.GetThreadContext();
                    if (result == FindGameResult.GameFound)
                    {
                        ThreadState = State.LoadWads;
                    }
                    break;

                case State.LoadWads:
                    uint addr;
                    if (MemoryEditor.FindPattern(@"\xE8\x00\x00\x00\x00\x8B\x4C\x24\x2C\x8A\xD8\x85\xC9",
                                                 "x????xxxxxxxx", out addr))
                    {
                        uint thisFunc;
                        MemoryEditor.FindPatternReverse(@"\x81\xEC\x3C\x01\x00\x00\xA1", "xxxxxxx", (IntPtr)addr, out thisFunc);
                        uint ECDSA;
                        MemoryEditor.FindPattern(@"\xE8\x00\x00\x00\x00\x84\xC0\x75\x34\x8D\x84\x24\x00\x00\x00\x00", @"x????xxxxxxx????",
                                                 out ECDSA);
                        int offset;
                        MemoryEditor.ReadInt((IntPtr)ECDSA + 1, out offset);
                        ECDSA = (uint)(ECDSA + offset + 5);
                        int callOffset = (int)addr - (int)thisFunc;
                        MemoryEditor.ReadInt((IntPtr)addr + 1, out offset);
                        addr = (uint)(addr + offset + 5);
                        LoadWadFiles((IntPtr)thisFunc, callOffset, (IntPtr)addr, (IntPtr)ECDSA);
                        ThreadState = State.WaitForNewGame;
                    }
                    break;
                }
                Thread.Sleep(1);
            }
        }
        public void Detection()
        {
            LastTeamToTouch = MemoryEditor.ReadInt(0x7D34958);
            faceoffstate    = Convert.ToBoolean(MemoryEditor.ReadInt(0x7D33C9C));
            if (Puck.Position.X >= 74.7f)
            {
                Puck.Position = new HQMVector(74.6f, Puck.Position.Y, Puck.Position.Z);
                ThrowIn();
                ResetPuck();
            }
            if (Puck.Position.X <= 4.4f)
            {
                Puck.Position = new HQMVector(4.5f, Puck.Position.Y, Puck.Position.Z);
                ThrowIn();
                ResetPuck();
            }
            //blue goalkick
            if (Puck.Position.X >= 43.38f | Puck.Position.X <= 35.6f && Puck.Position.Z <= 3.8f && LastTeamToTouch == 0)
            {
                Chat.SendMessage("Blue Goal Kick");
                Puck.Position = new HQMVector(39.5f, Puck.Position.Y, 10f);
                BlueGoalKick();
                ResetPuck();
            }

            //behind blue goal goalkick
            if (Puck.Position.X >= 35.6f && Puck.Position.X <= 43.38f && Puck.Position.Z <= 1.2f && LastTeamToTouch == 0)
            {
                Chat.SendMessage("Blue Goal Kick");
                Puck.Position = new HQMVector(39.5f, Puck.Position.Y, 10f);
                BlueGoalKick();
                ResetPuck();
            }
            //behind blue goal red cornerkick
            if (Puck.Position.X >= 35.6f && Puck.Position.X <= 43.38f && Puck.Position.Z <= 1.2f && LastTeamToTouch == 1)
            {
                Chat.SendMessage("Red Corner");
                Puck.Position = new HQMVector(74.1f, Puck.Position.Y, 4.6f);
                RedCorner();
                ResetPuck();
            }
            //red cornerkick 1
            if (Puck.Position.X >= 43.38f && Puck.Position.Z <= 3.8f && LastTeamToTouch == 1)
            {
                Chat.SendMessage("Red Corner");
                Puck.Position = new HQMVector(74.1f, Puck.Position.Y, 4.6f);
                RedCorner();
                ResetPuck();
            }
            //red cornerkick 2
            if (Puck.Position.X <= 35.6f && Puck.Position.Z <= 3.8f && LastTeamToTouch == 1)
            {
                Chat.SendMessage("Red Corner");
                Puck.Position = new HQMVector(5.2f, Puck.Position.Y, 4.6f);
                RedCorner();
                ResetPuck();
            }
            //behind red goal red goalkick
            if (Puck.Position.X >= 35.6f && Puck.Position.X <= 43.38f && Puck.Position.Z >= 112f && LastTeamToTouch == 1)
            {
                Chat.SendMessage("Read Goal Kick");
                Puck.Position = new HQMVector(39.5f, Puck.Position.Y, 100f);
                RedGoalKick();
                ResetPuck();
            }
            //behind red goal blue cornerkick
            if (Puck.Position.X >= 35.6f && Puck.Position.X <= 43.38f && Puck.Position.Z >= 112f && LastTeamToTouch == 0)
            {
                Chat.SendMessage("Blue Corner");
                Puck.Position = new HQMVector(73.8f, Puck.Position.Y, 108.5f);
                BlueCorner();
                ResetPuck();
            }
            //red goal kick
            if (Puck.Position.X >= 43.38f | Puck.Position.X <= 35.6f && Puck.Position.Z >= 109.2f && LastTeamToTouch == 1)
            {
                Chat.SendMessage("Red Goal Kick");
                Puck.Position = new HQMVector(39.5f, Puck.Position.Y, 100f);
                RedGoalKick();
                ResetPuck();
            }
            //blue cornerkick
            if (Puck.Position.X >= 43.38f && Puck.Position.Z >= 109.2f && LastTeamToTouch == 0)
            {
                Chat.SendMessage("Blue Corner");
                Puck.Position = new HQMVector(73.8f, Puck.Position.Y, 108.5f);
                BlueCorner();
                ResetPuck();
            }
            //blue cornerkick 2
            if (Puck.Position.X <= 35.6f && Puck.Position.Z >= 109.2f && LastTeamToTouch == 0)
            {
                Chat.SendMessage("Blue Corner");
                Puck.Position = new HQMVector(5.2f, Puck.Position.Y, 108.5f);
                BlueCorner();
                ResetPuck();
            }
            if (!faceoffstate && FaceOffState2 && faceoff)
            {
                Debug.Print("try to enable puck");
                PuckCollision(false);
                FaceOffState2 = false;
                faceoff       = false;
            }
            if (MemoryEditor.ReadInt(0x7D3489C) == 1 && faceoff)
            {
                Debug.Print("try to enable puck");
                PuckCollision(false);
                MemoryEditor.WriteInt(0, 0x7D3489C);
                faceoff = false;
            }
            //warmuptime gamestate
            if (GameInfo.IntermissionTime > 100 && !GameInfo.GameState && !faceoff)
            {
                Debug.Print("new half kickoff");
                Chat.SendMessage("Kick Off in 20s");
                ResetPuck();
                Puck.Position = new HQMVector(39.5f, 0.1f, 56.5f); //center
                PuckCollision(true);
                faceoff = true;
            }
            if (faceoffstate && GameInfo.IntermissionTime <= 1800 && !faceoff)
            {
                Debug.Print("after goal kickoff");
                Chat.SendMessage("Kick Off in 20s");
                FaceOffState2 = true;
                ResetPuck();
                Puck.Position = new HQMVector(39.5f, 0.1f, 56.5f); //center
                PuckCollision(true);
                faceoff = true;
            }
            System.Threading.Thread.Sleep(500);
        }