public override void onTick()
        {
            base.onTick();

            SDK.instance.player.velY = 0;
            SDK.instance.player.velY = (float)sliderSettings[1].value / 10;

            if (KeybindHandler.isKeyDown('W'))
            {
                List <float> directionalVec = SDK.instance.directionalVector((SDK.instance.player.yaw + 89.9f) * (float)Math.PI / 178F, (float)Math.PI / 178F);

                SDK.instance.player.velX = (float)sliderSettings[0].value / 10F * directionalVec[0];
                SDK.instance.player.velZ = (float)sliderSettings[0].value / 10F * directionalVec[2];
            }

            Counter += 1;

            if (Counter > sliderSettings[2].value)
            {
                if (distanceTo(SDK.instance.player.currentY1, savedY) <= 12)
                {
                    SDK.instance.player.teleport(SDK.instance.player.currentX1, savedY, SDK.instance.player.currentZ1);
                }
                else
                {
                    savedY = SDK.instance.player.currentY1;
                }
                Counter = 0;
            }
        }
        public override void onTick()
        {
            base.onTick();

            Minecraft.clientInstance.localPlayer.velY = 0;
            Minecraft.clientInstance.localPlayer.velY = (float)sliderSettings[1].value / 10;

            if (KeybindHandler.isKeyDown('W'))
            {
                Utils.Vec3f directionalVec = Utils.directionalVector((Minecraft.clientInstance.localPlayer.yaw + 89.9f) * (float)Math.PI / 178F, (float)Math.PI / 178F);

                Minecraft.clientInstance.localPlayer.velX = (float)sliderSettings[0].value / 10F * directionalVec.x;
                Minecraft.clientInstance.localPlayer.velZ = (float)sliderSettings[0].value / 10F * directionalVec.z;
            }

            Counter += 1;

            if (Counter > sliderSettings[2].value)
            {
                if (distanceTo(Minecraft.clientInstance.localPlayer.currentY1, savedY) <= 12)
                {
                    Minecraft.clientInstance.localPlayer.teleport(Minecraft.clientInstance.localPlayer.currentX1, savedY, Minecraft.clientInstance.localPlayer.currentZ1);
                }
                else
                {
                    savedY = Minecraft.clientInstance.localPlayer.currentY1;
                }
                Counter = 0;
            }
        }
Beispiel #3
0
        public override void onTick()
        {
            base.onTick();
            Minecraft.clientInstance.localPlayer.velY = 0F;

            Counter++;
            Counter2++;

            if (Counter == 1)
            {
                if (KeybindHandler.isKeyDown('W'))
                {
                    Utils.Vec3f directionalVec = Utils.directionalVector((Minecraft.clientInstance.localPlayer.yaw + 89.9f) * (float)Math.PI / 178F, Minecraft.clientInstance.localPlayer.pitch * (float)Math.PI / 178F);
                    Minecraft.clientInstance.localPlayer.velX = sliderSettings[2].value / 10F * directionalVec.x;
                    Minecraft.clientInstance.localPlayer.velZ = sliderSettings[2].value / 10F * directionalVec.z;
                }
                if (Counter2 > 50)
                {
                    Minecraft.clientInstance.localPlayer.teleport(Minecraft.clientInstance.localPlayer.X1, Minecraft.clientInstance.localPlayer.Y1 + sliderSettings[0].value, Minecraft.clientInstance.localPlayer.Z1);
                    Counter2 = 0;
                }
            }

            if (Counter >= 2)
            {
                Minecraft.clientInstance.localPlayer.velY = sliderSettings[1].value;
                Counter = 0;
            }
        }
Beispiel #4
0
        public override void onTick()
        {
            base.onTick();
            SDK.instance.player.velY = 0F;

            Counter++;
            Counter2++;

            if (Counter == 1)
            {
                if (KeybindHandler.isKeyDown('W'))
                {
                    List <float> directionalVec = SDK.instance.directionalVector((SDK.instance.player.yaw + 89.9f) * (float)Math.PI / 178F, SDK.instance.player.pitch * (float)Math.PI / 178F);
                    SDK.instance.player.velX = sliderSettings[2].value / 10F * directionalVec[0];
                    SDK.instance.player.velZ = sliderSettings[2].value / 10F * directionalVec[2];
                }
                if (Counter2 > 50)
                {
                    SDK.instance.player.teleport(SDK.instance.player.X1, SDK.instance.player.Y1 + sliderSettings[0].value, SDK.instance.player.Z1);
                    Counter2 = 0;
                }
            }

            if (Counter >= 2)
            {
                SDK.instance.player.velY = sliderSettings[1].value;
                Counter = 0;
            }
        }
Beispiel #5
0
        public void Subscribe(KeyModifiers mod, Keys key, KeybindHandler handler, string name)
        {
            var sub = new Sub(mod, key);

            if (_kbdSubs.ContainsKey(sub))
            {
                Logger.Error($" The Key Combination `{mod}-{key}` is already bound to action: `{name}`");
                string warning = @$ " The Key Combination `{mod}-{key}` is already bound to action: `{name}`. To fix this go into your config file and compare assignments of hotkeys
You can either change your custom hotkey or reassign the default hotkey";
Beispiel #6
0
        public override void onTick()
        {
            base.onTick();
            float playerYaw = Minecraft.clientInstance.localPlayer.yaw;

            if (Minecraft.clientInstance.localPlayer.onGround_type2 == 257)
            {
                Minecraft.clientInstance.localPlayer.velY = 0.3F;
            }

            if (KeybindHandler.isKeyDown('W'))
            {
                if (!KeybindHandler.isKeyDown('A') && !KeybindHandler.isKeyDown('D'))
                {
                    playerYaw += 90F;
                }
                if (KeybindHandler.isKeyDown('A'))
                {
                    playerYaw += 45F;
                }
                else if (KeybindHandler.isKeyDown('D'))
                {
                    playerYaw += 135F;
                }
            }
            else if (KeybindHandler.isKeyDown('S'))
            {
                if (!KeybindHandler.isKeyDown('A') && !KeybindHandler.isKeyDown('D'))
                {
                    playerYaw -= 90F;
                }
                if (KeybindHandler.isKeyDown('A'))
                {
                    playerYaw -= 45F;
                }
                else if (KeybindHandler.isKeyDown('D'))
                {
                    playerYaw -= 135F;
                }
            }
            else if (!KeybindHandler.isKeyDown('W') && !KeybindHandler.isKeyDown('S'))
            {
                if (!KeybindHandler.isKeyDown('A') && KeybindHandler.isKeyDown('D'))
                {
                    playerYaw += 180F;
                }
            }

            if (KeybindHandler.isKeyDown('W') | KeybindHandler.isKeyDown('A') | KeybindHandler.isKeyDown('D') | KeybindHandler.isKeyDown('S'))
            {
                float calcYaw   = (playerYaw) * ((float)Math.PI / 180F);
                float calcPitch = (Minecraft.clientInstance.localPlayer.pitch) * -((float)Math.PI / 180F);
                Minecraft.clientInstance.localPlayer.velX = (float)Math.Cos(calcYaw) * sliderSettings[0].value / 10F;
                Minecraft.clientInstance.localPlayer.velZ = (float)Math.Sin(calcYaw) * sliderSettings[0].value / 10F;
            }
        }
Beispiel #7
0
        static void Main(string[] args)
        {
            //Dont.Be.A.Scumbag.And.Remove.This.Warn.warn();
            Console.WriteLine("Xri Client");
            Console.WriteLine("Flare port to C#");
            Console.WriteLine("Xri port to C#");
            Console.WriteLine("Discord: https://discord.gg/t8pp4Vm");

            Process.Start("minecraft://");

            try
            {
                MCM.openGame();
                MCM.openWindowHost();

                CommandHook     cmh   = new CommandHook();
                SDK             sdk   = new SDK();
                FileMan         fm    = new FileMan();
                CategoryHandler ch    = new CategoryHandler();
                TabUiHandler    tuih  = new TabUiHandler();
                ModuleHandler   mh    = new ModuleHandler();
                KeybindHandler  kh    = new KeybindHandler();
                Thread          uiApp = new Thread(() => { OverlayHost ui = new OverlayHost(); Application.Run(ui); });
                if (fm.readConfig())
                {
                    Console.WriteLine("Loaded configurations!");
                }
                else
                {
                    Console.WriteLine("Could not load configurations!");
                }
                uiApp.Start();
                while (true)
                {
                    try
                    {
                        mainLoop.Invoke(null, new EventArgs());
                        Thread.Sleep(threadSleep);
                    }
                    catch (Exception)
                    {
                    }
                }
            } catch (Exception ex)
            {
                Console.WriteLine("Message: " + ex.Message);
                Console.WriteLine("Stacktrace: " + ex.StackTrace);
                MessageBox.Show("Xri crashed! Check the console for error details. Click 'Ok' to quit.");
            }
        }
Beispiel #8
0
 public override void OnInteractUp(clientKeyEvent a)
 {
     if (!deleted)
     {
         base.OnInteractUp(a);
         if (a.key == 0x1)
         {
             if (text[text.Length - 1] == '|')
             {
                 text = text.Remove(text.Length - 1);
                 if (text.Length == 0)
                 {
                     deleted = true;
                 }
                 editing = false;
             }
             Point p = new Point(Cursor.Position.X - OverlayHost.ui.Left, Cursor.Position.Y - OverlayHost.ui.Top);
             if (objRect.Contains(p))
             {
                 editing = true;
                 text   += "|";
             }
         }
         if (a.key == 0x8)
         {
             if (editing)
             {
                 text = text.Remove(text.Length - 2) + "|";
             }
         }
         else if (a.key >= 0x30 && a.key <= 0x5A)
         {
             if (editing)
             {
                 char typed = a.key;
                 if (!KeybindHandler.isKeyDown((char)0x10))
                 {
                     typed += (char)0x20;
                 }
                 text = text.Remove(text.Length - 1) + typed + "|";
                 FileMan.man.saveConfig();
             }
         }
     }
 }
Beispiel #9
0
        public void Update()
        {
            //Add Object if its not in the game and its not disabled
            if (Provider.isConnected && goMasterObj == null && bHackEnabled)
            {
                goMasterObj = new GameObject();

                mhHandler = goMasterObj.AddComponent <MenuHandler>();
                khHandler = goMasterObj.AddComponent <KeybindHandler>();
                DontDestroyOnLoad(mhHandler);
                DontDestroyOnLoad(khHandler);

                if (overridden == false)
                {
                    var Orig_AskScreenshot = typeof(Player).GetMethod("askScreenshot", BindingFlags.Instance | BindingFlags.Public);
                    var Over_AskScreenshot = typeof(OV_Player).GetMethod("askScreenshot", BindingFlags.Instance | BindingFlags.Public);
                    RedirectionHelper.RedirectCalls(Orig_AskScreenshot, Over_AskScreenshot);

                    var Orig_sendRaycast = typeof(PlayerInput).GetMethod("sendRaycast", BindingFlags.Instance | BindingFlags.Public);
                    var Over_sendRaycast = typeof(OV_PlayerInput).GetMethod("sendRaycast", BindingFlags.Instance | BindingFlags.Public);
                    RedirectionHelper.RedirectCalls(Orig_sendRaycast, Over_sendRaycast);

                    var Orig_onClickExit = typeof(PlayerPauseUI).GetMethod("onClickedExitButton", BindingFlags.Static | BindingFlags.NonPublic);
                    var Over_onClickExit = typeof(OV_PlayerPauseUI).GetMethod("onClickedExitButton", BindingFlags.Static | BindingFlags.NonPublic);
                    RedirectionHelper.RedirectCalls(Orig_onClickExit, Over_onClickExit);

                    overridden = true;
                }
            }

            if (!Provider.isConnected || !bHackEnabled)
            {
                if (goMasterObj != null)
                {
                    mhHandler.DestroySubMenus();
                    Destroy(goMasterObj);
                    mhHandler = null;
                }
            }
        }
        static void Main(string[] args)
        {
            Console.WriteLine("Flare# Client");
            Console.WriteLine("Flare port to C#");
            Console.WriteLine("Discord: https://discord.gg/Hz3Dxg8");

            try
            {
                MCM.openGame();
                MCM.openWindowHost();

                SDK             sdk = new SDK();
                CategoryHandler ch  = new CategoryHandler();
                ModuleHandler   mh  = new ModuleHandler();
                TabUI           ui  = new TabUI();
                KeybindHandler  kh  = new KeybindHandler();
                Application.Run(ui);
            } catch (Exception ex)
            {
                Console.WriteLine("Message: " + ex.Message);
                Console.WriteLine("Stacktrace: " + ex.StackTrace);
                MessageBox.Show("Flare crashed! Check the console for error details. Click 'Ok' to quit.");
            }
        }
Beispiel #11
0
        public override void onTick()
        {
            base.onTick();
            List <float> directionalVec;
            float        walkSpeed = 0.3F;

            if (SDK.instance.player.inventoryIsOpen)
            {
                if (KeybindHandler.isKeyDown((char)0x27)) //Arrow Key -> Right
                {
                    Pointers.mouseYaw -= 0.02F;
                }
                else if (KeybindHandler.isKeyDown((char)0x25)) //Arrow Key -> Left
                {
                    Pointers.mouseYaw += 0.02F;
                }
                else if (KeybindHandler.isKeyDown((char)0x26)) //Arrow Key -> Up
                {
                    Pointers.mousePitch += 0.02F;
                }
                else if (KeybindHandler.isKeyDown((char)0x28)) //Arrow Key -> Down
                {
                    Pointers.mousePitch -= 0.02F;
                }

                if (KeybindHandler.isKeyDown((char)0x20))
                {
                    if (SDK.instance.player.isInAir > 1 | SDK.instance.player.onGround > 0)
                    {
                        SDK.instance.player.velY = 0.4F;
                    }
                }

                if (KeybindHandler.isKeyDown('W'))
                {
                    if (!KeybindHandler.isKeyDown('A') && !KeybindHandler.isKeyDown('D'))
                    {
                        directionalVec           = SDK.instance.directionalVector((SDK.instance.player.yaw + 90) * (float)Math.PI / 180, (float)Math.PI / 180);
                        SDK.instance.player.velX = walkSpeed * directionalVec[0];
                        SDK.instance.player.velZ = walkSpeed * directionalVec[2];
                    }
                    else if (KeybindHandler.isKeyDown('A'))
                    {
                        directionalVec           = SDK.instance.directionalVector((SDK.instance.player.yaw + 70) * (float)Math.PI / 180, (float)Math.PI / 180);
                        SDK.instance.player.velX = walkSpeed * directionalVec[0];
                        SDK.instance.player.velZ = walkSpeed * directionalVec[2];
                    }
                    else if (KeybindHandler.isKeyDown('D'))
                    {
                        directionalVec           = SDK.instance.directionalVector((SDK.instance.player.yaw + 110) * (float)Math.PI / 180, (float)Math.PI / 180);
                        SDK.instance.player.velX = walkSpeed * directionalVec[0];
                        SDK.instance.player.velZ = walkSpeed * directionalVec[2];
                    }
                }
                else if (KeybindHandler.isKeyDown('S'))
                {
                    if (!KeybindHandler.isKeyDown('A') && !KeybindHandler.isKeyDown('D'))
                    {
                        directionalVec           = SDK.instance.directionalVector((SDK.instance.player.yaw + -90) * (float)Math.PI / 180, (float)Math.PI / 180);
                        SDK.instance.player.velX = walkSpeed * directionalVec[0];
                        SDK.instance.player.velZ = walkSpeed * directionalVec[2];
                    }
                    else if (KeybindHandler.isKeyDown('A'))
                    {
                        directionalVec           = SDK.instance.directionalVector((SDK.instance.player.yaw + -70) * (float)Math.PI / 180, (float)Math.PI / 180);
                        SDK.instance.player.velX = walkSpeed * directionalVec[0];
                        SDK.instance.player.velZ = walkSpeed * directionalVec[2];
                    }
                    else if (KeybindHandler.isKeyDown('D'))
                    {
                        directionalVec           = SDK.instance.directionalVector((SDK.instance.player.yaw + -110) * (float)Math.PI / 180, (float)Math.PI / 180);
                        SDK.instance.player.velX = walkSpeed * directionalVec[0];
                        SDK.instance.player.velZ = walkSpeed * directionalVec[2];
                    }
                }
                else if (!KeybindHandler.isKeyDown('W') && !KeybindHandler.isKeyDown('S'))
                {
                    if (KeybindHandler.isKeyDown('A'))
                    {
                        directionalVec           = SDK.instance.directionalVector((SDK.instance.player.yaw) * (float)Math.PI / 180, (float)Math.PI / 180);
                        SDK.instance.player.velX = walkSpeed * directionalVec[0];
                        SDK.instance.player.velZ = walkSpeed * directionalVec[2];
                    }
                    else if (KeybindHandler.isKeyDown('D'))
                    {
                        directionalVec           = SDK.instance.directionalVector((SDK.instance.player.yaw + 180) * (float)Math.PI / 180, (float)Math.PI / 180);
                        SDK.instance.player.velX = walkSpeed * directionalVec[0];
                        SDK.instance.player.velZ = walkSpeed * directionalVec[2];
                    }
                }
            }
        }
Beispiel #12
0
        public override void onTick()
        {
            base.onTick();
            if (!KeybindHandler.isKeyDown((char)0x20) && SDK.instance.player.isInAir != 0 | !KeybindHandler.isKeyDown((char)0x20) && SDK.instance.player.onGround != 0)
            {
                List <float> directionalVec;
                float        directionalVelocity = sliderSettings[0].value / 10F;
                float        sidewayVelocity     = sliderSettings[1].value / 10F;

                if (KeybindHandler.isKeyDown('W'))
                {
                    if (!KeybindHandler.isKeyDown('A') && !KeybindHandler.isKeyDown('D')) //Only W input
                    {
                        directionalVec           = SDK.instance.directionalVector((SDK.instance.player.yaw + 90) * (float)Math.PI / 180, (float)Math.PI / 180);
                        SDK.instance.player.velX = (float)directionalVelocity * directionalVec[0];
                        SDK.instance.player.velZ = (float)directionalVelocity * directionalVec[2];
                    }
                    else if (KeybindHandler.isKeyDown('A')) //W & A input
                    {
                        directionalVec           = SDK.instance.directionalVector((SDK.instance.player.yaw + 70) * (float)Math.PI / 180, (float)Math.PI / 180);
                        SDK.instance.player.velX = (float)sidewayVelocity * directionalVec[0];
                        SDK.instance.player.velZ = (float)sidewayVelocity * directionalVec[2];
                    }
                    else if (KeybindHandler.isKeyDown('D')) //W & D input
                    {
                        directionalVec           = SDK.instance.directionalVector((SDK.instance.player.yaw + 110) * (float)Math.PI / 180, (float)Math.PI / 180);
                        SDK.instance.player.velX = (float)sidewayVelocity * directionalVec[0];
                        SDK.instance.player.velZ = (float)sidewayVelocity * directionalVec[2];
                    }
                }
                else if (KeybindHandler.isKeyDown('S'))
                {
                    if (!KeybindHandler.isKeyDown('A') && !KeybindHandler.isKeyDown('D')) //Only S input
                    {
                        directionalVec           = SDK.instance.directionalVector((SDK.instance.player.yaw + -90) * (float)Math.PI / 180, (float)Math.PI / 180);
                        SDK.instance.player.velX = (float)sidewayVelocity * directionalVec[0];
                        SDK.instance.player.velZ = (float)sidewayVelocity * directionalVec[2];
                    }
                    else if (KeybindHandler.isKeyDown('A')) //S & A input
                    {
                        directionalVec           = SDK.instance.directionalVector((SDK.instance.player.yaw + -70) * (float)Math.PI / 180, (float)Math.PI / 180);
                        SDK.instance.player.velX = (float)sidewayVelocity * directionalVec[0];
                        SDK.instance.player.velZ = (float)sidewayVelocity * directionalVec[2];
                    }
                    else if (KeybindHandler.isKeyDown('D')) //S & D input
                    {
                        directionalVec           = SDK.instance.directionalVector((SDK.instance.player.yaw + -110) * (float)Math.PI / 180, (float)Math.PI / 180);
                        SDK.instance.player.velX = (float)sidewayVelocity * directionalVec[0];
                        SDK.instance.player.velZ = (float)sidewayVelocity * directionalVec[2];
                    }
                }
                else if (!KeybindHandler.isKeyDown('W') && !KeybindHandler.isKeyDown('S'))
                {
                    if (KeybindHandler.isKeyDown('A'))
                    {
                        directionalVec           = SDK.instance.directionalVector((SDK.instance.player.yaw) * (float)Math.PI / 180, (float)Math.PI / 180);
                        SDK.instance.player.velX = (float)sidewayVelocity * directionalVec[0];
                        SDK.instance.player.velZ = (float)sidewayVelocity * directionalVec[2];
                    }
                    else if (KeybindHandler.isKeyDown('D'))
                    {
                        directionalVec           = SDK.instance.directionalVector((SDK.instance.player.yaw + 180) * (float)Math.PI / 180, (float)Math.PI / 180);
                        SDK.instance.player.velX = (float)sidewayVelocity * directionalVec[0];
                        SDK.instance.player.velZ = (float)sidewayVelocity * directionalVec[2];
                    }
                }
            }
        }
Beispiel #13
0
 public void Subscribe(KeyModifiers mod, Keys key, KeybindHandler handler)
 {
     Subscribe(mod, key, handler, null);
 }
Beispiel #14
0
        public void Subscribe(KeyModifiers mod, Keys key, KeybindHandler handler, string name)
        {
            var sub = new Sub(mod, key);

            _kbdSubs[sub] = new NamedBind <KeybindHandler>(handler, name);
        }
Beispiel #15
0
        public static void Handle(PacketReader packet, MapleClient c)
        {
            if (packet.Length >= 2)
            {
                if (ServerConstants.PrintPackets)
                {
                    ServerConsole.Info("Receiving: {0}", Functions.ByteArrayToStr(packet.ToArray()));
                }
                RecvHeader header = (RecvHeader)packet.ReadHeader();

                if (header <= RecvHeader.ErrorCode)
                {
                    switch (header)
                    {
                        #region Miscellaneous
                    case RecvHeader.ErrorCode:
                        ErrorCodeHandler.Handle(c, packet);
                        break;

                    case RecvHeader.BlackCipher:
                        BlackCipherHandler.Handle(packet.ReadInt(), c);
                        break;

                    case RecvHeader.HandShake:
                        ReceiveHandShakeHandler.Handle(c, packet);
                        break;

                    case RecvHeader.CrashReport:
                        break;

                    case RecvHeader.Pong:
                        PongHandler.Handle(c);
                        break;

                        #endregion
                        #region Login Server
                    case RecvHeader.EnteredLoginScreen:
                        EnteredLoginScreenHandler.Handle(c);
                        break;

                    case RecvHeader.ClientLoaded:
                        ClientLoadedHandler.Handle(c);
                        break;

                    case RecvHeader.ShowServerList:
                    case RecvHeader.ReShowServerList:
                        ServerlistRequestHandler.Handle(c);
                        break;

                    case RecvHeader.WorldSelect:
                        WorldSelectHandler.Handle(packet.ReadShort(), c);
                        break;

                    case RecvHeader.CheckCharacterName:
                        CheckCharnameHandler.Handle(c, packet.ReadMapleString());
                        break;

                    case RecvHeader.CreateCharacter:
                        CreateCharHandler.Handle(c, packet);
                        break;

                    case RecvHeader.DeleteCharacter:
                        DeleteCharacterHandler.Handle(c, packet);
                        break;

                    case RecvHeader.SetAccountPic:
                        SetAccountPicHandler.Handle(c, packet);
                        break;

                    case RecvHeader.ChooseCharacterWithPic:
                        ChooseCharWithPicHandler.Handle(c, packet);
                        break;

                    case RecvHeader.EnterMap:
                        CharacterLoginHandler.Handle(c, packet);
                        break;

                    case RecvHeader.AccountLogin:
                        LoginAccountHandler.Handle(c, packet);
                        break;

                    case RecvHeader.ChooseChannel:
                        ChooseChannelHandler.Handle(c, packet);
                        break;

                        #endregion
                    default:
#if DEBUG
                        ServerConsole.Debug("Unhandled recv packet: {0}", Functions.ByteArrayToStr(packet.ToArray()));
#endif
                        break;
                    }
                }
                else
                {
                    if (c.Account?.Character?.Map == null)
                    {
                        return;
                    }
                    switch (header)
                    {
                        #region GameServer
                    // Spam packets:
                    case RecvHeader.ClickDialog:
                    case RecvHeader.AttackSpam:
                    case RecvHeader.FinalPactEnd:
                        break;

                    case RecvHeader.PartyResponse:
                        PartyResponseHandler.Handle(c, packet);
                        break;

                    case RecvHeader.PartyOperation:
                        PartyHandler.Handle(c, packet);
                        break;

                    case RecvHeader.RequestRecommendedPartyMembers:
                        RecommendedPartyMembersHandler.Handle(c, packet);
                        break;

                    case RecvHeader.CharacterReceiveDamage:
                        CharacterReceiveDamage.Handle(c, packet);
                        break;

                    case RecvHeader.PlayerChat:
                        PlayerChatHandler.Handle(c, packet);
                        break;

                    case RecvHeader.SpecialChat:
                        SpecialChatHandler.Handle(c, packet);
                        break;

                    case RecvHeader.RequestWeeklyMapleStar:
                        WeeklyMapleStarHandler.Handle(c, packet);
                        return;

                    case RecvHeader.MoveCharacter:
                        MoveCharacterHandler.Handle(c, packet);
                        break;

                    case RecvHeader.EnterMapPortal:
                        EnterMapPortalHandler.Handle(c, packet);
                        break;

                    case RecvHeader.EnterDoor:
                        EnterDoorHandler.Handle(c, packet);
                        break;

                    case RecvHeader.MoveMob:
                        MoveMobHandler.Handle(c, packet);
                        break;

                    case RecvHeader.NpcChat:
                        NpcChatHandler.Handle(c, packet);
                        break;

                    case RecvHeader.NpcShopAction:
                        NpcShopActionHandler.Handle(c, packet);
                        break;

                    case RecvHeader.NpcAnimation:
                        NpcAnimationHandler.Handle(c, packet);
                        break;

                    case RecvHeader.NpcChatMore:
                        NpcChatMoreHandler.Handle(c, packet);
                        break;

                    case RecvHeader.FacialExpression:
                        FacialExpressionHandler.Handle(c, packet);
                        break;

                    case RecvHeader.MeleeAttack:
                        DealDamageHandler.HandleMelee(c, packet, header);
                        break;

                    case RecvHeader.RangedAttack:
                        DealDamageHandler.HandleRanged(c, packet);
                        break;

                    case RecvHeader.PassiveAttack:
                    case RecvHeader.MagicAttack:
                        DealDamageHandler.HandleMagic(c, packet);
                        break;

                    case RecvHeader.DistributeAp:
                        DistributeAPHandler.HandleSingle(c, packet);
                        break;

                    case RecvHeader.AutoAssignAp:
                        DistributeAPHandler.HandleDistribute(c, packet);
                        break;

                    case RecvHeader.DistributeSp:
                        DistributeSPHandler.Handle(c, packet);
                        break;

                    case RecvHeader.UseSkill:
                        UseSkillHandler.Handle(c, packet);
                        break;

                    case RecvHeader.MoveItem:
                        MoveItemHandler.Handle(c, packet);
                        break;

                    case RecvHeader.SlotMerge:
                        InventorySortHandler.HandleSlotMerge(c, packet);
                        break;

                    case RecvHeader.ItemSort:
                        InventorySortHandler.HandleItemSort(c, packet);
                        break;

                    case RecvHeader.ChangeChannel:
                        ChangeChannelHandler.Handle(c, packet);
                        break;

                    case RecvHeader.EnterCashShop:
                        EnterCSHandler.Handle(c, packet);
                        break;

                    case RecvHeader.AutoAggroMob:
                        AutoAggroHandler.Handle(c, packet);
                        break;

                    case RecvHeader.LootMapItem:
                        LootItemHandler.HandlePlayer(c, packet);
                        break;

                    case RecvHeader.RegenerateHpMp:
                        RegenerateHPMPHandler.Handle(c, packet);
                        break;

                    case RecvHeader.ChangeKeybind:
                        KeybindHandler.HandleKeyMapChange(c, packet);
                        break;

                    case RecvHeader.QuickSlotKeyMap:
                        KeybindHandler.HandleQuickSlotKeysChange(c, packet);
                        break;

                    case RecvHeader.CancelBuff:
                        CancelBuffHandler.Handle(c, packet);
                        break;

                    case RecvHeader.CharacterInfoRequest:
                        CharacterInfoRequest.Handle(c, packet);
                        break;

                    case RecvHeader.QuestAction:
                        QuestActionHandler.Handle(c, packet);
                        break;

                    case RecvHeader.EnterMapPortalSpecial:
                        EnterMapPortalSpecialHandler.Handle(c, packet);
                        break;

                    case RecvHeader.GuildAction:
                        GuildActionHandler.Handle(c, packet);
                        break;

                    case RecvHeader.DropMeso:
                        DropMesoHandler.Handle(c, packet);
                        break;

                    case RecvHeader.Trade:
                        TradeHandler.Handle(c, packet);
                        break;

                    case RecvHeader.UseConsumable:
                        UseItemHandler.Handle(c, packet);
                        break;

                    case RecvHeader.UseReturnScroll:
                        UseItemHandler.HandleReturnScroll(c, packet);
                        break;

                    case RecvHeader.UseEquipScroll:
                        UseScrollHandler.HandleRegularEquipScroll(c, packet);
                        break;

                    case RecvHeader.UseSpecialEquipScroll:
                        UseScrollHandler.HandleSpecialEquipScroll(c, packet);
                        break;

                    case RecvHeader.UseEquipEnhancementScroll:
                        UseScrollHandler.HandleEquipEnhancementScroll(c, packet);
                        break;

                    case RecvHeader.UseCashItem:
                        UseSpecialItemHandler.Handle(c, packet);
                        break;

                    case RecvHeader.UsePotentialScroll:
                        UseScrollHandler.HandlePotentialScroll(c, packet);
                        break;

                    case RecvHeader.UseBonusPotentialScroll:
                        UseScrollHandler.HandleBonusPotentialScroll(c, packet);
                        break;

                    case RecvHeader.UseCube:
                        UseScrollHandler.HandleCube(c, packet);
                        break;

                    case RecvHeader.UseMagnifyGlass:
                        UseMagnifyingGlassHandler.Handle(c, packet);
                        break;

                    case RecvHeader.SetSkillMacro:
                        SetSkillMacroHandler.Handle(c, packet);
                        break;

                    case RecvHeader.ProffesionReactorAction:
                        ProfessionReactorActionHandler.Handle(c, packet);
                        break;

                    case RecvHeader.ProffesionReactorDestroy:
                        ProfessionReactorActionHandler.HandleDestroy(c, packet);
                        break;

                    case RecvHeader.ReactorAction:
                        ReactorActionHandler.Handle(c, packet);
                        break;

                    case RecvHeader.CraftDone:
                        CraftHandler.HandleCraftDone(c, packet);
                        break;

                    case RecvHeader.CraftEffect:
                        CraftHandler.HandleCraftEffect(c, packet);
                        break;

                    case RecvHeader.CraftMake:
                        CraftHandler.HandleCraftMake(c, packet);
                        break;

                    case RecvHeader.CraftUnk:
                        CraftHandler.HandleUnk(c, packet);
                        break;

                    case RecvHeader.GainAranCombo:
                        AranComboHandler.HandleGain(c);
                        break;

                    case RecvHeader.DecayAranCombo:
                        AranComboHandler.HandleDecay(c);
                        break;

                    case RecvHeader.BlackBlessing:
                        BlackBlessingHandler.Handle(c);
                        break;

                    case RecvHeader.RequestHyperskillInfo:
                        HyperskillInfoRequestHandler.Handle(c, packet);
                        return;

                    case RecvHeader.SkillSwipe:
                        StealSkillHandler.HandleSkillSwipe(c, packet);
                        break;

                    case RecvHeader.ChooseStolenSkill:
                        StealSkillHandler.HandleChooseSkill(c, packet);
                        break;

                    case RecvHeader.StealSkill:
                        StealSkillHandler.HandleStealSkill(c, packet);
                        break;

                    case RecvHeader.MessengerOperation:
                        MapleMessengerHandler.Handle(c, packet);
                        break;

                    case RecvHeader.MoveSummon:
                        SummonHandler.HandleMove(c, packet);
                        break;

                    case RecvHeader.SummonAttack:
                        SummonHandler.HandleAttack(c, packet);
                        break;

                    case RecvHeader.SummonUseSkill:
                        SummonHandler.HandleSkill(c, packet);
                        break;

                    case RecvHeader.RemoveSummon:
                        SummonHandler.HandleRemove(c, packet);
                        break;

                    case RecvHeader.FindPlayer:
                        FindPlayerHandler.Handle(c, packet);
                        break;

                    case RecvHeader.BuddyOperation:
                        BuddyOperationHandler.Handle(c, packet);
                        break;

                    case RecvHeader.UseGoldenHammer:
                        UseGoldenHammerHandler.Handle(c, packet);
                        break;

                        #endregion
                        #region CashShop
                    case RecvHeader.CashshopSelect:
                        CashShop.Select(c, packet);
                        break;

                        #endregion
                    default:
#if DEBUG
                        ServerConsole.Debug("Unhandled recv packet: {0}", Functions.ByteArrayToStr(packet.ToArray()));
#endif
                        c.Account.Character.EnableActions();
                        break;
                    }
                }
            }
        }
Beispiel #16
0
        static void Main(string[] args)
        {
            //Dont.Be.A.Scumbag.And.Remove.This.Warn.warn();
            Console.WriteLine("Flare# Client");
            Console.WriteLine("Flare port to C#");
            Console.WriteLine("Discord: https://discord.gg/Hz3Dxg8");

            Process.Start("minecraft://");

            try
            {
                MCM.openGame();
                MCM.openWindowHost();

                CommandHook     cmh   = new CommandHook();
                FileMan         fm    = new FileMan();
                CategoryHandler ch    = new CategoryHandler();
                ModuleHandler   mh    = new ModuleHandler();
                KeybindHandler  kh    = new KeybindHandler();
                Thread          uiApp = new Thread(() => { OverlayHost ui = new OverlayHost(); Application.Run(ui); });
                if (fm.readConfig())
                {
                    Console.WriteLine("Loaded config!");
                }
                else
                {
                    Console.WriteLine("Could not load config!");
                }
                uiApp.Start();
                if (args != null)
                {
                    if (args.Length > 0)
                    {
                        if (args[0] == "dualThread")
                        {
                            Thread moduleThread = new Thread(() => { while (true)
                                                                     {
                                                                         try { ModuleHandler.registry.tickModuleThread(); Thread.Sleep(1); } catch (Exception) { }
                                                                     }
                                                             });
                            moduleThread.Start();
                        }
                    }
                }
                while (true)
                {
                    try
                    {
                        mainLoop.Invoke(null, new EventArgs());
                        if (limitCpu)
                        {
                            Thread.Sleep(1);
                        }
                    }
                    catch (Exception)
                    {
                    }
                }
            } catch (Exception ex)
            {
                Console.WriteLine("Message: " + ex.Message);
                Console.WriteLine("Stacktrace: " + ex.StackTrace);
                MessageBox.Show("Flare crashed! Check the console for error details. Click 'Ok' to quit.");
            }
        }
        public override void onTick()
        {
            base.onTick();
            Utils.Vec3f directionalVec;
            float       walkSpeed = 0.3F;

            if (Minecraft.clientInstance.localPlayer.inventoryIsOpen)
            {
                if (KeybindHandler.isKeyDown((char)0x27)) //Arrow Key -> Right
                {
                    Minecraft.clientInstance.localPlayer.level.firstPersonCamera.cameraYaw -= 0.02F;
                }
                else if (KeybindHandler.isKeyDown((char)0x25)) //Arrow Key -> Left
                {
                    Minecraft.clientInstance.localPlayer.level.firstPersonCamera.cameraYaw += 0.02F;
                }
                else if (KeybindHandler.isKeyDown((char)0x26)) //Arrow Key -> Up
                {
                    Minecraft.clientInstance.localPlayer.level.firstPersonCamera.cameraPitch += 0.02F;
                }
                else if (KeybindHandler.isKeyDown((char)0x28)) //Arrow Key -> Down
                {
                    Minecraft.clientInstance.localPlayer.level.firstPersonCamera.cameraPitch -= 0.02F;
                }

                if (KeybindHandler.isKeyDown((char)0x20))
                {
                    if (Minecraft.clientInstance.localPlayer.isInAir > 1 | Minecraft.clientInstance.localPlayer.onGround > 0)
                    {
                        Minecraft.clientInstance.localPlayer.velY = 0.4F;
                    }
                }

                if (KeybindHandler.isKeyDown('W'))
                {
                    if (!KeybindHandler.isKeyDown('A') && !KeybindHandler.isKeyDown('D'))
                    {
                        directionalVec = Utils.directionalVector((Minecraft.clientInstance.localPlayer.yaw + 90) * (float)Math.PI / 180, (float)Math.PI / 180);
                        Minecraft.clientInstance.localPlayer.velX = walkSpeed * directionalVec.x;
                        Minecraft.clientInstance.localPlayer.velZ = walkSpeed * directionalVec.z;
                    }
                    else if (KeybindHandler.isKeyDown('A'))
                    {
                        directionalVec = Utils.directionalVector((Minecraft.clientInstance.localPlayer.yaw + 70) * (float)Math.PI / 180, (float)Math.PI / 180);
                        Minecraft.clientInstance.localPlayer.velX = walkSpeed * directionalVec.x;
                        Minecraft.clientInstance.localPlayer.velZ = walkSpeed * directionalVec.z;
                    }
                    else if (KeybindHandler.isKeyDown('D'))
                    {
                        directionalVec = Utils.directionalVector((Minecraft.clientInstance.localPlayer.yaw + 110) * (float)Math.PI / 180, (float)Math.PI / 180);
                        Minecraft.clientInstance.localPlayer.velX = walkSpeed * directionalVec.x;
                        Minecraft.clientInstance.localPlayer.velZ = walkSpeed * directionalVec.z;
                    }
                }
                else if (KeybindHandler.isKeyDown('S'))
                {
                    if (!KeybindHandler.isKeyDown('A') && !KeybindHandler.isKeyDown('D'))
                    {
                        directionalVec = Utils.directionalVector((Minecraft.clientInstance.localPlayer.yaw + -90) * (float)Math.PI / 180, (float)Math.PI / 180);
                        Minecraft.clientInstance.localPlayer.velX = walkSpeed * directionalVec.x;
                        Minecraft.clientInstance.localPlayer.velZ = walkSpeed * directionalVec.z;
                    }
                    else if (KeybindHandler.isKeyDown('A'))
                    {
                        directionalVec = Utils.directionalVector((Minecraft.clientInstance.localPlayer.yaw + -70) * (float)Math.PI / 180, (float)Math.PI / 180);
                        Minecraft.clientInstance.localPlayer.velX = walkSpeed * directionalVec.x;
                        Minecraft.clientInstance.localPlayer.velZ = walkSpeed * directionalVec.z;
                    }
                    else if (KeybindHandler.isKeyDown('D'))
                    {
                        directionalVec = Utils.directionalVector((Minecraft.clientInstance.localPlayer.yaw + -110) * (float)Math.PI / 180, (float)Math.PI / 180);
                        Minecraft.clientInstance.localPlayer.velX = walkSpeed * directionalVec.x;
                        Minecraft.clientInstance.localPlayer.velZ = walkSpeed * directionalVec.z;
                    }
                }
                else if (!KeybindHandler.isKeyDown('W') && !KeybindHandler.isKeyDown('S'))
                {
                    if (KeybindHandler.isKeyDown('A'))
                    {
                        directionalVec = Utils.directionalVector((Minecraft.clientInstance.localPlayer.yaw) * (float)Math.PI / 180, (float)Math.PI / 180);
                        Minecraft.clientInstance.localPlayer.velX = walkSpeed * directionalVec.x;
                        Minecraft.clientInstance.localPlayer.velZ = walkSpeed * directionalVec.z;
                    }
                    else if (KeybindHandler.isKeyDown('D'))
                    {
                        directionalVec = Utils.directionalVector((Minecraft.clientInstance.localPlayer.yaw + 180) * (float)Math.PI / 180, (float)Math.PI / 180);
                        Minecraft.clientInstance.localPlayer.velX = walkSpeed * directionalVec.x;
                        Minecraft.clientInstance.localPlayer.velZ = walkSpeed * directionalVec.z;
                    }
                }
            }
        }