Ejemplo n.º 1
0
        void MainTick(object sender, EventArgs e)
        {
            SeekPCSX2(Title);
            GameStateACK();
            if (!IsTitlePassed)
            {
                return;
            }
            WorldPicUpdate();
            WarpLock();
            RelachementTouches();
            MusicUpdate();

            //Detect the language of the ISO
            if (ReadBytes(Pointer(Pointer(0x20347EA8, 0x20024c58), 0x20000000), 1)[0] == 0x2E)
            {
                ISO_Language = 1;
            }

            //Tells the game current character is not coming from a drive
            WriteInteger(0x2032F054, (byte)0);

            //Get current keyblade digit
            if (keybladeDigit == 0)
            {
                keybladeDigit = ReadBytes(0x2032E020, 1)[0];
            }

            //Get distance between jump-height of current character and floor
            float positionSolTmp = DistanceSol(player_Ptr);

            positionSol = Math.Round(positionSolTmp, 2).ToString() != "320000" ? positionSolTmp : positionSol;

            if (enTrainDeFaireFusion())
            {
                HPInitWaitCount = 0;
                msetAddress     = -1;
                arriveParFusion = true;
                do
                {
                    msetAddress = SearchResource("obj/" + personnageActuel.getMsetName() + ".mset");
                }while (IsTitlePassed && msetAddress == -1);
                mdlxAddress = SearchResource("obj/" + personnageActuel.getMdlxName() + ".mdlx");
                CharacterCollisionWidth();
                DriveApparition();
                while (enTrainDeFaireFusion() || (IsTitlePassed && ReadString(Pointer(Pointer(player_Ptr, 0x2000014C), 0x1fffffd0), 3) != "BAR"))
                {
                }
                DebutDeMap();
            }

            //Which character ?
            if (IsMapLoaded)
            {
                switch (GetModelName(player_Ptr))
                {
                case "B_EX390":                 //Organisation Roxas
                    OrganisationRoxasSection();
                    break;

                case "B_EX400":                 //Larxene
                    LarxeneSection();
                    break;

                case "N_CM000_BTL":                 //Marluxia
                    MarluxiaSection();
                    break;

                case "B_EX150_LV99":                 //Luxord
                    LuxordSection();
                    break;

                case "B_EX120_HB_LV99":                 //Demyx
                    DemyxSection();
                    break;

                case "B_EX110_LV99":                 //Axel
                    AxelSection();
                    break;

                case "B_EX160_LV99":                 //Saix
                    SaixSection();
                    break;

                case "B_EX370":                 //Zexion
                    ZexionSection();
                    break;

                case "N_CM020_BTL":                 //Lexaeus
                    LexaeusSection();
                    break;

                case "N_CM040_BTL":                 //Vexen
                    VexenSection();
                    break;

                case "B_EX130_LV99":                 //Xaldin
                    XaldinSection();
                    break;

                case "B_EX140_LV99":                 //Xigbar
                    XigbarSection();
                    break;

                case "B_EX170_LV99":                 //Xemnas
                    XemnasSection();
                    break;
                }
            }

            if (isModelNPC(player_Ptr))
            {
                var sonnnaAddress = Pointer(Pointer(0x20347EA8, 0x20000dd8), 0x20000000);
                if (ReadUShort(sonnnaAddress) == 0xBD9E)
                {
                    WriteBytes(sonnnaAddress, new byte[1]);
                }
                KillBitches();
                WriteBytes(0x21C5FF48, new byte[12]);                //Deactivate Reaction commands
                WatchTStance(player_Ptr);
            }
            if (GetModelName(player_Ptr) == personnageActuel.getMdlxName())
            {
                UpdateCutomizedHP();
            }

            ChangeGameSettings();
        }