Ejemplo n.º 1
0
        public NpcFileReference(System.IO.Stream stream, uint refStringStart)
        {
            uint refStringLocation1 = stream.ReadUInt32().SwapEndian();
            uint refStringLocation2 = stream.ReadUInt32().SwapEndian();

            Filesize = stream.ReadUInt32().SwapEndian();
            stream.ReadUInt32();

            long pos = stream.Position;

            stream.Position = refStringStart + refStringLocation1;
            Map             = stream.ReadAsciiNullterm();
            stream.Position = refStringStart + refStringLocation2;
            Filename        = stream.ReadAsciiNullterm();
            stream.Position = pos;
        }
Ejemplo n.º 2
0
        public SynopsisEntry(System.IO.Stream stream, EndianUtils.Endianness endian)
        {
            ID              = stream.ReadUInt32().FromEndian(endian);
            StoryIdMin      = stream.ReadUInt32().FromEndian(endian);
            StoryIdMax      = stream.ReadUInt32().FromEndian(endian);
            NameStringDicId = stream.ReadUInt32().FromEndian(endian);
            TextStringDicId = stream.ReadUInt32().FromEndian(endian);
            stream.DiscardBytes(0xC);

            long pos = stream.Position;

            RefString1      = stream.ReadAsciiNullterm();
            stream.Position = pos + 0x10;
            RefString2      = stream.ReadAsciiNullterm();
            stream.Position = pos + 0x20;
        }
Ejemplo n.º 3
0
        public StrategyOption(System.IO.Stream stream, uint refStringStart)
        {
            uint entrySize = stream.PeekUInt32().SwapEndian();

            Data = new uint[entrySize / 4];
            for (int i = 0; i < Data.Length; ++i)
            {
                Data[i] = stream.ReadUInt32().SwapEndian();
            }

            Category = Data[1];
            InGameID = Data[2];
            uint refStringLocation = Data[3];

            NameStringDicID = Data[4];
            DescStringDicID = Data[5];
            Characters      = Data[6];
            ID = Data[7];

            long pos = stream.Position;

            stream.Position = refStringStart + refStringLocation;
            RefString       = stream.ReadAsciiNullterm();
            stream.Position = pos;
        }
Ejemplo n.º 4
0
        public Skill(System.IO.Stream stream, uint refStringStart)
        {
            uint entrySize = stream.ReadUInt32().SwapEndian();

            ID       = stream.ReadUInt32().SwapEndian();
            InGameID = stream.ReadUInt32().SwapEndian();
            uint refStringLocation = stream.ReadUInt32().SwapEndian();

            NameStringDicID    = stream.ReadUInt32().SwapEndian();
            DescStringDicID    = stream.ReadUInt32().SwapEndian();
            Unknown7           = stream.ReadUInt32().SwapEndian();
            LearnableByBitmask = stream.ReadUInt32().SwapEndian();

            EquipCost = stream.ReadUInt32().SwapEndian();
            LearnCost = stream.ReadUInt32().SwapEndian();
            Category  = stream.ReadUInt32().SwapEndian();
            // Game sums up this value per category, then figures out the OVL-symbol from the totals
            SymbolValue = stream.ReadUInt32().SwapEndian();

            Unknown13 = stream.ReadUInt32().SwapEndian().UIntToFloat();
            Unknown14 = stream.ReadUInt32().SwapEndian().UIntToFloat();
            Unknown15 = stream.ReadUInt32().SwapEndian().UIntToFloat();
            Inactive  = stream.ReadUInt32().SwapEndian();

            long pos = stream.Position;

            stream.Position = refStringStart + refStringLocation;
            RefString       = stream.ReadAsciiNullterm();
            stream.Position = pos;
        }
Ejemplo n.º 5
0
        public SkitInfo(System.IO.Stream stream, uint refStringStart)
        {
            // first 16 bytes are always null in the existing files
            stream.DiscardBytes(0x10);

            SkitFlagUnique = stream.ReadUInt16().SwapEndian();
            Unknown2       = stream.ReadUInt16().SwapEndian();

            Data = new uint[11];
            for (int i = 0; i < Data.Length; ++i)
            {
                Data[i] = stream.ReadUInt32().SwapEndian();
            }


            FlagTrigger      = Data[0];
            FlagCancel       = Data[1];
            Category         = Data[2];
            CharacterBitmask = Data[3];
            SkitConditionForwarderReference = (int)Data[5];
            SkitConditionRelated            = Data[6];
            SkitFlag = Data[7];
            uint refStringPos = Data[8];

            StringDicIdName      = Data[9];
            StringDicIdCondition = Data[10];

            long pos = stream.Position;

            stream.Position = refStringStart + refStringPos;
            RefString       = stream.ReadAsciiNullterm();
            stream.Position = pos;

            return;
        }
Ejemplo n.º 6
0
        public EncounterGroup(System.IO.Stream stream, uint refStringStart)
        {
            uint[] Data;
            uint   entryLength = stream.PeekUInt32().SwapEndian();

            Data = new uint[entryLength / 4];
            for (int i = 0; i < Data.Length; ++i)
            {
                Data[i] = stream.ReadUInt32().SwapEndian();
            }

            ID          = Data[1];
            StringDicID = Data[2];
            InGameID    = Data[3];

            EnemyGroupIDs = new uint[10];
            for (int i = 0; i < 10; ++i)
            {
                EnemyGroupIDs[i] = Data[5 + i];
            }

            long pos = stream.Position;

            stream.Position = refStringStart + Data[4];
            RefString       = stream.ReadAsciiNullterm();
            stream.Position = pos;
        }
Ejemplo n.º 7
0
        public FloorInfo(System.IO.Stream stream, uint refStringStart)
        {
            EntrySize = stream.ReadUInt32().SwapEndian();
            RestData  = new uint[(EntrySize - 4) / 4];

            for (int i = 0; i < RestData.Length; ++i)
            {
                RestData[i] = stream.ReadUInt32().SwapEndian();
            }

            long pos = stream.Position;

            stream.Position = refStringStart + RestData[2];
            RefString1      = stream.ReadAsciiNullterm();
            stream.Position = refStringStart + RestData[4];
            RefString2      = stream.ReadAsciiNullterm();
            stream.Position = pos;
        }
Ejemplo n.º 8
0
        public EnemyGroup(System.IO.Stream stream, uint refStringStart)
        {
            uint entryLength = stream.PeekUInt32().SwapEndian();

            Data = new uint[entryLength / 4];
            for (int i = 0; i < Data.Length; ++i)
            {
                Data[i] = stream.ReadUInt32().SwapEndian();
            }

            ID          = Data[1];
            StringDicID = Data[2];
            InGameID    = Data[3];

            EnemyIDs = new int[8];
            for (int i = 0; i < EnemyIDs.Length; ++i)
            {
                EnemyIDs[i] = (int)Data[5 + i];
            }

            UnknownFloats = new float[8];
            for (int i = 0; i < UnknownFloats.Length; ++i)
            {
                UnknownFloats[i] = Data[13 + i].UIntToFloat();
            }
            PosX = new float[8];
            for (int i = 0; i < PosX.Length; ++i)
            {
                PosX[i] = Data[21 + i].UIntToFloat();
            }
            PosY = new float[8];
            for (int i = 0; i < PosY.Length; ++i)
            {
                PosY[i] = Data[29 + i].UIntToFloat();
            }
            Scale = new float[8];
            for (int i = 0; i < Scale.Length; ++i)
            {
                Scale[i] = Data[37 + i].UIntToFloat();
            }

            SomeFlag    = Data[45];
            UnknownInts = new uint[8];
            for (int i = 0; i < UnknownInts.Length; ++i)
            {
                UnknownInts[i] = Data[46 + i];
            }

            long pos = stream.Position;

            stream.Position = refStringStart + Data[4];
            RefString       = stream.ReadAsciiNullterm();
            stream.Position = pos;
        }
Ejemplo n.º 9
0
        public Location(System.IO.Stream stream, EndianUtils.Endianness endian)
        {
            uint[] Data = new uint[0x74 / 4];             // + 0x20*4 strings, + 4*4 StringDicIDs

            for (int i = 0; i < Data.Length; ++i)
            {
                Data[i] = stream.ReadUInt32().FromEndian(endian);
            }

            LocationID         = Data[0];
            DefaultStringDicID = Data[1];
            Unused2            = Data[2];
            Category           = Data[3];
            DescStringDicIDs   = new uint[4];
            for (int i = 0; i < 4; ++i)
            {
                DescStringDicIDs[i] = Data[5 + i];
            }

            ShopsOrEnemyGroups = new uint[16];
            for (int i = 0; i < 16; ++i)
            {
                ShopsOrEnemyGroups[i] = Data[9 + i];
            }

            // Data[26 ~ 28] appear to be references to event triggers for when an area advances to its next 'state'
            // Data[25] is always 0, which makes sense as the initial state of a location should not have a required trigger
            ChangeEventTriggers = new uint[4];
            for (int i = 0; i < 4; ++i)
            {
                ChangeEventTriggers[i] = Data[25 + i];
            }

            long pos = stream.Position;

            RefStrings = new string[4];
            for (int i = 0; i < 4; ++i)
            {
                RefStrings[i]   = stream.ReadAsciiNullterm();
                stream.Position = pos + 0x20 * (i + 1);
            }

            stream.Position  = pos + 0x20 * 4;
            NameStringDicIDs = new uint[4];
            for (int i = 0; i < 4; ++i)
            {
                NameStringDicIDs[i] = stream.ReadUInt32().FromEndian(endian);
            }
        }
Ejemplo n.º 10
0
        public NpcDialogueDefinition(System.IO.Stream stream, uint refStringStart)
        {
            Unknown1    = stream.ReadUInt32().SwapEndian();
            Unknown2    = stream.ReadUInt32().SwapEndian();
            StringDicId = stream.ReadUInt32().SwapEndian();
            Unknown4    = stream.ReadUInt32().SwapEndian();

            Unknown5a1 = (byte)stream.ReadByte();
            Unknown5a2 = (byte)stream.ReadByte();
            Unknown5b1 = (byte)stream.ReadByte();
            Unknown5b2 = (byte)stream.ReadByte();
            Unknown6a  = (short)stream.ReadUInt16().SwapEndian();
            Unknown6b  = (short)stream.ReadUInt16().SwapEndian();
            Unknown7a1 = (byte)stream.ReadByte();
            Unknown7a2 = (byte)stream.ReadByte();
            Unknown7b  = stream.ReadUInt16().SwapEndian();
            Unknown8   = stream.ReadUInt32().SwapEndian();

            RefStringLocation1 = stream.ReadUInt32().SwapEndian();
            RefStringLocation2 = stream.ReadUInt32().SwapEndian();
            Unknown11          = stream.ReadUInt32().SwapEndian();
            Unknown12          = stream.ReadUInt32().SwapEndian();

            Unknown13 = stream.ReadUInt32().SwapEndian();
            Unknown14 = stream.ReadUInt32().SwapEndian();
            Unknown15 = stream.ReadUInt32().SwapEndian();
            Unknown16 = stream.ReadUInt32().SwapEndian();

            long pos = stream.Position;

            stream.Position = refStringStart + RefStringLocation1;
            RefString1      = stream.ReadAsciiNullterm();
            stream.Position = refStringStart + RefStringLocation2;
            RefString2      = stream.ReadAsciiNullterm();
            stream.Position = pos;
        }
Ejemplo n.º 11
0
        public StrategySet(System.IO.Stream stream, uint refStringStart)
        {
            uint[] Data;
            uint   entrySize = stream.PeekUInt32().SwapEndian();

            Data = new uint[entrySize / 4];
            for (int i = 0; i < Data.Length; ++i)
            {
                Data[i] = stream.ReadUInt32().SwapEndian();
            }

            ID = Data[1];
            uint refStringLocation = Data[2];

            NameStringDicID = Data[3];
            DescStringDicID = Data[4];

            StrategyDefaults = new uint[8, 9];
            for (uint x = 0; x < 8; ++x)
            {
                for (uint y = 0; y < 9; ++y)
                {
                    StrategyDefaults[x, y] = Data[x * 9 + y + 5];
                }
            }

            ID2 = Data[77];

            UnknownFloats1 = new float[9];
            for (int i = 0; i < UnknownFloats1.Length; ++i)
            {
                UnknownFloats1[i] = Data[78 + i].UIntToFloat();
            }
            UnknownFloats2 = new float[9];
            for (int i = 0; i < UnknownFloats2.Length; ++i)
            {
                UnknownFloats2[i] = Data[87 + i].UIntToFloat();
            }

            long pos = stream.Position;

            stream.Position = refStringStart + refStringLocation;
            RefString       = stream.ReadAsciiNullterm();
            stream.Position = pos;
        }
Ejemplo n.º 12
0
        public GradeShopEntry(System.IO.Stream stream, uint refStringStart)
        {
            uint entrySize = stream.ReadUInt32().SwapEndian();

            ID       = stream.ReadUInt32().SwapEndian();
            InGameID = stream.ReadUInt32().SwapEndian();
            uint refStringLocation = stream.ReadUInt32().SwapEndian();

            NameStringDicID = stream.ReadUInt32().SwapEndian();
            DescStringDicID = stream.ReadUInt32().SwapEndian();
            GradeCost       = stream.ReadUInt32().SwapEndian();

            long pos = stream.Position;

            stream.Position = refStringStart + refStringLocation;
            RefString       = stream.ReadAsciiNullterm();
            stream.Position = pos;
        }
Ejemplo n.º 13
0
        public TreasureInfo(System.IO.Stream stream, uint refStringStart)
        {
            EntrySize         = stream.ReadUInt32().SwapEndian();
            ID                = stream.ReadUInt32().SwapEndian();
            IDAgain           = stream.ReadUInt32().SwapEndian();
            RefStringLocation = stream.ReadUInt32().SwapEndian();

            ChestTypes = new uint[4];
            for (int i = 0; i < ChestTypes.Length; ++i)
            {
                ChestTypes[i] = stream.ReadUInt32().SwapEndian();
            }

            ChestPositions = new float[8];
            for (int i = 0; i < ChestPositions.Length; ++i)
            {
                ChestPositions[i] = stream.ReadUInt32().SwapEndian().UIntToFloat();
            }

            Items = new uint[12];
            for (int i = 0; i < Items.Length; ++i)
            {
                Items[i] = stream.ReadUInt32().SwapEndian();
            }
            Chances = new uint[12];
            for (int i = 0; i < Chances.Length; ++i)
            {
                Chances[i] = stream.ReadUInt32().SwapEndian();
            }

            long pos = stream.Position;

            stream.Position = refStringStart + RefStringLocation;
            RefString       = stream.ReadAsciiNullterm();
            stream.Position = pos;
        }
Ejemplo n.º 14
0
        /*
         * public static int[] KnownValues = new int[] { 32, 46, 47, 48, 49, 50, 55, 58, 3, 4, 68, 69, 56, 51, 52, 53, 54, 14, 1, 20, 21, 22, 0, 2, 5, 57, 7, 8, 9, 10, 11, 12, 13, 15, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 60, 61, 6, 24, 59, 17, 18, 19 };
         * //*/
        // 14 is always zero
        // 16 is zero except on the new giganto monsters and spiral draco
        // 76 is on PS3 only, StringDicID for the dummy description

        public Enemy(System.IO.Stream stream, uint refStringStart)
        {
            uint entryLength = stream.ReadUInt32().SwapEndian();

            Data      = new uint[entryLength / 4];
            DataFloat = new float[entryLength / 4];
            Data[0]   = entryLength;

            for (int i = 1; i < Data.Length; ++i)
            {
                Data[i]      = stream.ReadUInt32().SwapEndian();
                DataFloat[i] = Data[i].UIntToFloat();
            }

            ID = Data[1];
            NameStringDicID = Data[2];
            InGameID        = Data[5];
            IconID          = Data[57];

            Level    = Data[7];
            Category = Data[24];

            HP   = Data[8];
            TP   = Data[9];
            PATK = Data[10];
            PDEF = Data[11];
            MATK = Data[12];
            MDEF = Data[13];
            AGL  = Data[15];

            FatalBlue         = DataFloat[17];
            FatalRed          = DataFloat[18];
            FatalGreen        = DataFloat[19];
            FatalBlueRelated  = DataFloat[20];
            FatalRedRelated   = DataFloat[21];
            FatalGreenRelated = DataFloat[22];

            // > 100 weak, < 100 resist, 0 nullify, negative absorb
            // effectively a damage multiplier in percent
            Attributes    = new int[7];
            Attributes[0] = (int)Data[26];
            Attributes[1] = (int)Data[27];
            Attributes[2] = (int)Data[28];
            Attributes[3] = (int)Data[29];
            Attributes[4] = (int)Data[30];
            Attributes[5] = (int)Data[31];
            Attributes[6] = (int)Data[32];

            EXP  = Data[33];
            Gald = Data[34];
            LP   = Data[35];

            DropItems      = new uint[4];
            DropItems[0]   = Data[36];
            DropItems[1]   = Data[37];
            DropItems[2]   = Data[38];
            DropItems[3]   = Data[39];
            DropChances    = new uint[4];
            DropChances[0] = Data[40];
            DropChances[1] = Data[41];
            DropChances[2] = Data[42];
            DropChances[3] = Data[43];
            StealItem      = Data[44];
            StealChance    = Data[45];

            FatalTypeExp    = Data[46];
            EXPModifier     = Data[47];
            FatalTypeLP     = Data[48];
            LPModifier      = Data[49];
            FatalTypeDrop   = Data[50];
            DropModifier    = new uint[4];
            DropModifier[0] = Data[51];
            DropModifier[1] = Data[52];
            DropModifier[2] = Data[53];
            DropModifier[3] = Data[54];

            KillableWithFS = Data[56];

            InMonsterBook = Data[59];
            Location      = Data[60];
            // -1: None shown, 0: Sun, 1: Rain, 2: Snow, 3: Windy, 4: Night, 5: Cloudy
            LocationWeather = (int)Data[61];

            SecretMissionDrop       = Data[68];
            SecretMissionDropChance = Data[69];

            long pos = stream.Position;

            stream.Position = refStringStart + Data[6];
            RefString       = stream.ReadAsciiNullterm();
            stream.Position = refStringStart + Data[3];
            RefString2      = stream.ReadAsciiNullterm();
            stream.Position = refStringStart + Data[4];
            RefString3      = stream.ReadAsciiNullterm();
            stream.Position = refStringStart + Data[55];
            RefString4      = stream.ReadAsciiNullterm();
            stream.Position = refStringStart + Data[58];
            RefString5      = stream.ReadAsciiNullterm();

            stream.Position = pos;
        }
Ejemplo n.º 15
0
        public Recipe(System.IO.Stream stream)
        {
            Data = new uint[0xCC / 4];             // + 0x20

            for (int i = 0; i < Data.Length; ++i)
            {
                Data[i] = stream.ReadUInt32().SwapEndian();
            }
            long pos = stream.Position;

            RefString       = stream.ReadAsciiNullterm();
            stream.Position = pos + 0x20;

            ID = Data[0];
            NameStringDicID        = Data[1];
            DescriptionStringDicID = Data[2];
            EffectStringDicID      = Data[3];

            HP                  = Data[4];
            TP                  = Data[5];
            DeathHeal           = Data[6];
            PhysicalAilmentHeal = Data[7];

            Ingredients = new uint[6];
            for (int i = 0; i < 6; ++i)
            {
                Ingredients[i] = Data[30 + i];
            }
            IngredientCount = new uint[6];
            for (int i = 0; i < 6; ++i)
            {
                IngredientCount[i] = Data[42 + i];
            }
            IngredientGroups = new uint[6];
            for (int i = 0; i < 6; ++i)
            {
                IngredientGroups[i] = Data[24 + i];
            }
            IngredientGroupCount = new uint[6];
            for (int i = 0; i < 6; ++i)
            {
                IngredientGroupCount[i] = Data[36 + i];
            }

            CharactersLike         = Data[8];
            CharactersDislike      = Data[9];
            CharactersGoodAtMaking = Data[10];
            CharactersBadAtMaking  = Data[11];

            RecipeCreationCharacter = new uint[6];
            for (int i = 0; i < 6; ++i)
            {
                RecipeCreationCharacter[i] = Data[12 + i];
            }
            RecipeCreationRecipe = new uint[6];
            for (int i = 0; i < 6; ++i)
            {
                RecipeCreationRecipe[i] = Data[18 + i];
            }
            StatType  = Data[48];
            StatValue = Data[49];
            StatTime  = Data[50];
        }