├── .gitattributes
├── .gitignore
├── BigHat.sln
├── BigHat
├── BigHat.csproj
├── BigHat.csproj.DotSettings
├── BinaryReaderExt.cs
├── CsvExporter.cs
├── FmgEntry.cs
├── FmgImporter.cs
├── GenerateProtobuf.bat
├── Generated
│ └── Ds3Ext.cs
├── IImporter.cs
├── ParamAttributes.cs
├── ParamEntries
│ ├── AtkParam.cs
│ ├── AttackElementCorrectParam.cs
│ ├── BehaviorParam.cs
│ ├── CalcCorrectGraph.cs
│ ├── EquipParamAccessory.cs
│ ├── EquipParamProtector.cs
│ ├── EquipParamWeapon.cs
│ ├── Magic.cs
│ ├── NpcParam.cs
│ ├── ReinforceParamProtector.cs
│ ├── ReinforceParamWeapon.cs
│ └── SpEffectParam.cs
├── ParamEntry.cs
├── ParamImporter.cs
├── Program.cs
├── Properties
│ └── AssemblyInfo.cs
├── ProtoBufDataExporter.cs
├── ProtoBufWriter.cs
├── TableEntry.cs
├── Utils.cs
├── app.config
└── packages.config
└── README.md
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | [Xx]64/
19 | [Xx]86/
20 | [Bb]uild/
21 | bld/
22 | [Bb]in/
23 | [Oo]bj/
24 |
25 | # Visual Studio 2015 cache/options directory
26 | .vs/
27 | # Uncomment if you have tasks that create the project's static files in wwwroot
28 | #wwwroot/
29 |
30 | # MSTest test Results
31 | [Tt]est[Rr]esult*/
32 | [Bb]uild[Ll]og.*
33 |
34 | # NUNIT
35 | *.VisualState.xml
36 | TestResult.xml
37 |
38 | # Build Results of an ATL Project
39 | [Dd]ebugPS/
40 | [Rr]eleasePS/
41 | dlldata.c
42 |
43 | # DNX
44 | project.lock.json
45 | artifacts/
46 |
47 | *_i.c
48 | *_p.c
49 | *_i.h
50 | *.ilk
51 | *.meta
52 | *.obj
53 | *.pch
54 | *.pdb
55 | *.pgc
56 | *.pgd
57 | *.rsp
58 | *.sbr
59 | *.tlb
60 | *.tli
61 | *.tlh
62 | *.tmp
63 | *.tmp_proj
64 | *.log
65 | *.vspscc
66 | *.vssscc
67 | .builds
68 | *.pidb
69 | *.svclog
70 | *.scc
71 |
72 | # Chutzpah Test files
73 | _Chutzpah*
74 |
75 | # Visual C++ cache files
76 | ipch/
77 | *.aps
78 | *.ncb
79 | *.opendb
80 | *.opensdf
81 | *.sdf
82 | *.cachefile
83 | *.VC.db
84 |
85 | # Visual Studio profiler
86 | *.psess
87 | *.vsp
88 | *.vspx
89 | *.sap
90 |
91 | # TFS 2012 Local Workspace
92 | $tf/
93 |
94 | # Guidance Automation Toolkit
95 | *.gpState
96 |
97 | # ReSharper is a .NET coding add-in
98 | _ReSharper*/
99 | *.[Rr]e[Ss]harper
100 | *.DotSettings.user
101 |
102 | # JustCode is a .NET coding add-in
103 | .JustCode
104 |
105 | # TeamCity is a build add-in
106 | _TeamCity*
107 |
108 | # DotCover is a Code Coverage Tool
109 | *.dotCover
110 |
111 | # NCrunch
112 | _NCrunch_*
113 | .*crunch*.local.xml
114 | nCrunchTemp_*
115 |
116 | # MightyMoose
117 | *.mm.*
118 | AutoTest.Net/
119 |
120 | # Web workbench (sass)
121 | .sass-cache/
122 |
123 | # Installshield output folder
124 | [Ee]xpress/
125 |
126 | # DocProject is a documentation generator add-in
127 | DocProject/buildhelp/
128 | DocProject/Help/*.HxT
129 | DocProject/Help/*.HxC
130 | DocProject/Help/*.hhc
131 | DocProject/Help/*.hhk
132 | DocProject/Help/*.hhp
133 | DocProject/Help/Html2
134 | DocProject/Help/html
135 |
136 | # Click-Once directory
137 | publish/
138 |
139 | # Publish Web Output
140 | *.[Pp]ublish.xml
141 | *.azurePubxml
142 |
143 | # TODO: Un-comment the next line if you do not want to checkin
144 | # your web deploy settings because they may include unencrypted
145 | # passwords
146 | #*.pubxml
147 | *.publishproj
148 |
149 | # NuGet Packages
150 | *.nupkg
151 | # The packages folder can be ignored because of Package Restore
152 | **/packages/*
153 | # except build/, which is used as an MSBuild target.
154 | !**/packages/build/
155 | # Uncomment if necessary however generally it will be regenerated when needed
156 | #!**/packages/repositories.config
157 | # NuGet v3's project.json files produces more ignoreable files
158 | *.nuget.props
159 | *.nuget.targets
160 |
161 | # Microsoft Azure Build Output
162 | csx/
163 | *.build.csdef
164 |
165 | # Microsoft Azure Emulator
166 | ecf/
167 | rcf/
168 |
169 | # Microsoft Azure ApplicationInsights config file
170 | ApplicationInsights.config
171 |
172 | # Windows Store app package directory
173 | AppPackages/
174 | BundleArtifacts/
175 |
176 | # Visual Studio cache files
177 | # files ending in .cache can be ignored
178 | *.[Cc]ache
179 | # but keep track of directories ending in .cache
180 | !*.[Cc]ache/
181 |
182 | # Others
183 | ClientBin/
184 | [Ss]tyle[Cc]op.*
185 | ~$*
186 | *~
187 | *.dbmdl
188 | *.dbproj.schemaview
189 | *.pfx
190 | *.publishsettings
191 | node_modules/
192 | orleans.codegen.cs
193 |
194 | # RIA/Silverlight projects
195 | Generated_Code/
196 |
197 | # Backup & report files from converting an old project file
198 | # to a newer Visual Studio version. Backup files are not needed,
199 | # because we have git ;-)
200 | _UpgradeReport_Files/
201 | Backup*/
202 | UpgradeLog*.XML
203 | UpgradeLog*.htm
204 |
205 | # SQL Server files
206 | *.mdf
207 | *.ldf
208 |
209 | # Business Intelligence projects
210 | *.rdl.data
211 | *.bim.layout
212 | *.bim_*.settings
213 |
214 | # Microsoft Fakes
215 | FakesAssemblies/
216 |
217 | # GhostDoc plugin setting file
218 | *.GhostDoc.xml
219 |
220 | # Node.js Tools for Visual Studio
221 | .ntvs_analysis.dat
222 |
223 | # Visual Studio 6 build log
224 | *.plg
225 |
226 | # Visual Studio 6 workspace options file
227 | *.opt
228 |
229 | # Visual Studio LightSwitch build output
230 | **/*.HTMLClient/GeneratedArtifacts
231 | **/*.DesktopClient/GeneratedArtifacts
232 | **/*.DesktopClient/ModelManifest.xml
233 | **/*.Server/GeneratedArtifacts
234 | **/*.Server/ModelManifest.xml
235 | _Pvt_Extensions
236 |
237 | # LightSwitch generated files
238 | GeneratedArtifacts/
239 | ModelManifest.xml
240 |
241 | # Paket dependency manager
242 | .paket/paket.exe
243 |
244 | # FAKE - F# Make
245 | .fake/
--------------------------------------------------------------------------------
/BigHat.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.25123.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BigHat", "BigHat\BigHat.csproj", "{F0FC2CF1-2701-4AE1-8C69-B8144FFDFBF3}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {F0FC2CF1-2701-4AE1-8C69-B8144FFDFBF3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {F0FC2CF1-2701-4AE1-8C69-B8144FFDFBF3}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {F0FC2CF1-2701-4AE1-8C69-B8144FFDFBF3}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {F0FC2CF1-2701-4AE1-8C69-B8144FFDFBF3}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/BigHat/BigHat.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {F0FC2CF1-2701-4AE1-8C69-B8144FFDFBF3}
8 | Exe
9 | Properties
10 | BigHat
11 | BigHat
12 | v4.5
13 | 512
14 |
15 |
16 |
17 | AnyCPU
18 | true
19 | full
20 | false
21 | bin\Debug\
22 | DEBUG;TRACE
23 | prompt
24 | 4
25 | false
26 |
27 |
28 | AnyCPU
29 | pdbonly
30 | true
31 | bin\Release\
32 | TRACE
33 | prompt
34 | 4
35 | false
36 |
37 |
38 |
39 | ..\packages\Google.Protobuf.3.0.0-beta3\lib\dotnet\Google.Protobuf.dll
40 | True
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
93 |
--------------------------------------------------------------------------------
/BigHat/BigHat.csproj.DotSettings:
--------------------------------------------------------------------------------
1 |
2 | True
--------------------------------------------------------------------------------
/BigHat/BinaryReaderExt.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 |
5 | namespace BigHat
6 | {
7 | public class BinaryReaderExt : BinaryReader
8 | {
9 | private readonly Dictionary> _readDictionary = new Dictionary
10 | >
11 | {
12 | {typeof(byte), x => x.ReadByte()},
13 | {typeof(sbyte), x => x.ReadSByte()},
14 | {typeof(char), x => x.ReadChar()},
15 | {typeof(short), x => x.ReadInt16()},
16 | {typeof(ushort), x => x.ReadUInt16()},
17 | {typeof(int), x => x.ReadInt32()},
18 | {typeof(uint), x => x.ReadUInt32()},
19 | {typeof(long), x => x.ReadInt64()},
20 | {typeof(ulong), x => x.ReadUInt64()},
21 | {typeof(bool), x => x.ReadBoolean()},
22 | {typeof(float), x => x.ReadSingle()},
23 | {typeof(double), x => x.ReadDouble()},
24 | {typeof(decimal), x => x.ReadDecimal()}
25 | };
26 |
27 | public BinaryReaderExt(Stream input) : base(input)
28 | {
29 | }
30 |
31 | public object ReadValueType(Type type)
32 | {
33 | return _readDictionary[type](this);
34 | }
35 |
36 |
37 | public void Seek(long offset, SeekOrigin origin)
38 | {
39 | BaseStream.Seek(offset, origin);
40 | }
41 | }
42 | }
--------------------------------------------------------------------------------
/BigHat/CsvExporter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Security.Cryptography.X509Certificates;
6 |
7 | namespace BigHat
8 | {
9 | public class CsvExporter
10 | {
11 | public static void Export(string filename, IList data, bool includeHeaderRow = false,
12 | bool includeOffsetRow = false, bool ignoreHidden = true)
13 | {
14 | if (data.Count < 1)
15 | throw new ArgumentException("The data list is empty, file contains no data");
16 |
17 | var exportFile = File.CreateText(filename);
18 |
19 | if (includeHeaderRow)
20 | {
21 | var fieldNames = data[0].GetFieldNames(ignoreHidden);
22 | if (includeOffsetRow)
23 | {
24 | var fieldOffsets = data[0].GetFieldOffsets(ignoreHidden).Select(x => x == -1 ? string.Empty : x.ToString("X"));
25 | exportFile.WriteLine("{0}", string.Join(",", fieldOffsets));
26 | }
27 | exportFile.WriteLine("{0}", string.Join(",", fieldNames));
28 | }
29 |
30 | foreach (var entry in data)
31 | {
32 | var fieldValues = entry.GetFieldValues(ignoreHidden).Select(x =>
33 | {
34 | if (x is bool)
35 | {
36 | if ((bool) x == true)
37 | return 1;
38 | else return 0;
39 | }
40 | return x;
41 | });
42 | exportFile.WriteLine("{0}", string.Join(",", fieldValues));
43 | }
44 |
45 | exportFile.Close();
46 | }
47 | }
48 | }
--------------------------------------------------------------------------------
/BigHat/FmgEntry.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Reflection;
3 |
4 | namespace BigHat
5 | {
6 | public class FmgEntry : TableEntry
7 | {
8 | public int Id;
9 | public int IdMax;
10 | public int IdMin;
11 | public string Text;
12 |
13 | public FmgEntry()
14 | {
15 | }
16 |
17 | public FmgEntry(int idMin, int idMax, int id, string text)
18 | {
19 | IdMin = idMin;
20 | IdMax = idMax;
21 | Id = id;
22 | Text = text;
23 | }
24 |
25 | public override IReadOnlyList GetFields()
26 | {
27 | return GetType().GetFields();
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/BigHat/FmgImporter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 |
5 | namespace BigHat
6 | {
7 | public class FmgImporter : IImporter
8 | {
9 | private readonly byte[] _data;
10 |
11 | public FmgImporter(string path)
12 | {
13 | _data = Utils.ReadBinaryDataFromFile(path);
14 | Count = BitConverter.ToInt32(_data, 0x0C);
15 | }
16 |
17 | public int Count { get; }
18 |
19 | public IList Import()
20 | {
21 | return ImportFmg().Cast().ToList();
22 | }
23 |
24 | public IList ImportFmg()
25 | {
26 | var stringIndexTableBaseOffset = BitConverter.ToInt32(_data, 0x18);
27 | var ret = new List(Count);
28 |
29 | for (var i = 0; i < Count; i++)
30 | {
31 | var idMin = BitConverter.ToInt32(_data, 0x2C + i*16);
32 | var idMax = BitConverter.ToInt32(_data, 0x30 + i*16);
33 | var offset = BitConverter.ToInt32(_data, 0x28 + i*16);
34 | for (var j = idMin; j <= idMax; j++)
35 | {
36 | var index = j - idMin + offset;
37 | var tableOffset = BitConverter.ToInt32(_data, stringIndexTableBaseOffset + index*8);
38 | if (tableOffset != 0)
39 | {
40 | var str = Utils.ReadNullTerminatedWideString(_data, tableOffset, 2048);
41 | ret.Add(new FmgEntry(idMin, idMax, j, str));
42 | }
43 | }
44 | }
45 | return ret;
46 | }
47 | }
48 | }
--------------------------------------------------------------------------------
/BigHat/GenerateProtobuf.bat:
--------------------------------------------------------------------------------
1 | cd bin/Release
2 | BigHat.exe -g
3 | protoc --csharp_out=../../Generated ds3ext.proto
--------------------------------------------------------------------------------
/BigHat/IImporter.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace BigHat
4 | {
5 | public interface IImporter
6 | {
7 | IList Import();
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/BigHat/ParamAttributes.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace BigHat
4 | {
5 | [AttributeUsage(AttributeTargets.Struct | AttributeTargets.Class)]
6 | public sealed class ParamAttribute : Attribute
7 | {
8 | public readonly int Size;
9 |
10 | public ParamAttribute(int size)
11 | {
12 | Size = size;
13 | }
14 | }
15 |
16 | [AttributeUsage(AttributeTargets.Field)]
17 | public sealed class PBitfieldAttribute : Attribute
18 | {
19 | public readonly int Bitoffset;
20 | public readonly int Index;
21 |
22 | public PBitfieldAttribute(int bitoffset, int index)
23 | {
24 | Bitoffset = bitoffset;
25 | Index = index;
26 | }
27 | }
28 |
29 | public sealed class PFieldOffsetAttribute : Attribute
30 | {
31 | public readonly int Offset;
32 |
33 | public PFieldOffsetAttribute(int offset)
34 | {
35 | Offset = offset;
36 | }
37 | }
38 |
39 | public sealed class PArrayLengthAttribute : Attribute
40 | {
41 | public readonly int Length;
42 |
43 | public PArrayLengthAttribute(int length)
44 | {
45 | Length = length;
46 | }
47 | }
48 |
49 | public sealed class HiddenAttribute : Attribute
50 | {
51 | }
52 | }
--------------------------------------------------------------------------------
/BigHat/ParamEntries/AtkParam.cs:
--------------------------------------------------------------------------------
1 | namespace BigHat.ParamEntries
2 | {
3 | [Param(424)]
4 | public class AtkParam : ParamEntry
5 | {
6 | public float Hit0_Radius;
7 | public float Hit1_Radius;
8 | public float Hit2_Radius;
9 | public float Hit3_Radius;
10 | public float KnockbackDist;
11 | public float HitStopTime;
12 | public int SpEffectId0;
13 | public int SpEffectId1;
14 | public int SpEffectId2;
15 | public int SpEffectId3;
16 | public int SpEffectId4;
17 | public short Hit0_DmyPoly1;
18 | public short Hit1_DmyPoly1;
19 | public short Hit2_DmyPoly1;
20 | public short Hit3_DmyPoly1;
21 | public short Hit0_DmyPoly2;
22 | public short Hit1_DmyPoly2;
23 | public short Hit2_DmyPoly2;
24 | public short Hit3_DmyPoly2;
25 | public ushort BlowingCorrection;
26 | public ushort AtkPhysCorrection;
27 | public ushort AtkMagCorrection;
28 | public ushort AtkFireCorrection;
29 | public ushort AtkThunCorrection;
30 | public ushort AtkStamCorrection;
31 | public ushort GuardAtkRateCorrection;
32 | public ushort GuardBreakCorrection;
33 | public ushort AtkThrowEscapeCorrection;
34 | public ushort AtkPhys;
35 | public ushort AtkMag;
36 | public ushort AtkFire;
37 | public ushort AtkThun;
38 | public ushort AtkStam;
39 | public ushort GuardAtkRate;
40 | public ushort GuardBreakRate;
41 | public ushort AtkSuperArmor;
42 | public ushort AtkThrowEscape;
43 | public ushort AtkObj;
44 | public short GuardStaminaCutRate;
45 | public short GuardRate;
46 | public short ThrowTypeId;
47 | public byte Hit0_hitType;
48 | public byte Hit1_hitType;
49 | public byte Hit2_hitType;
50 | public byte Hit3_hitType;
51 | public byte Hit0_Priority;
52 | public byte Hit1_Priority;
53 | public byte Hit2_Priority;
54 | public byte Hit3_Priority;
55 | public byte DamageLevel;
56 | public byte MapHitType;
57 | public sbyte GuardCutCancelRate;
58 | public byte AtkAttribute;
59 | public byte SpecialAttributes;
60 | public byte AttackType;
61 | public byte AtkMaterial;
62 | public byte AtkSize;
63 | public byte DefMaterial;
64 | public byte DefSfxMaterial;
65 | public byte HitSourceType;
66 | public byte ThrowFlag;
67 | public byte BitField;
68 | [Hidden]
69 | [PArrayLength(265)]
70 | public byte[] Unknown;
71 | public ushort AtkDarkCorrection;
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/BigHat/ParamEntries/AttackElementCorrectParam.cs:
--------------------------------------------------------------------------------
1 | namespace BigHat.ParamEntries
2 | {
3 | [Param(128)]
4 | public class AttackElementCorrectParam : ParamEntry
5 | {
6 | public int Bitmask;
7 | [PArrayLength(50)]
8 | public short[] v;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/BigHat/ParamEntries/BehaviorParam.cs:
--------------------------------------------------------------------------------
1 | namespace BigHat.ParamEntries
2 | {
3 | [Param(32)]
4 | public class BehaviorParam : ParamEntry
5 | {
6 | public int VariationId;
7 | public int BehaviorJudgeId;
8 | public byte EzStateBehaviorType_old;
9 | public byte RefType;
10 | [Hidden]
11 | [PArrayLength(2)]
12 | public byte[] Padding1;
13 | public int ReferenceId;
14 | public int SfxVariationId;
15 | public int Stamina;
16 | public int Mp;
17 | public byte Category;
18 | public byte HeroPoint;
19 | [Hidden]
20 | [PArrayLength(2)]
21 | public byte[] Padding2;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/BigHat/ParamEntries/CalcCorrectGraph.cs:
--------------------------------------------------------------------------------
1 | namespace BigHat.ParamEntries
2 | {
3 | [Param(80)]
4 | public class CalcCorrectGraph : ParamEntry
5 | {
6 | [PArrayLength(5)]
7 | public float[] StageMaxVal;
8 | [PArrayLength(5)]
9 | public float[] StageMaxGrowVal;
10 | [PArrayLength(5)]
11 | public float[] AdjPt_maxGrowVal;
12 | public float Init_inclination_soul;
13 | public float Adjustment_value;
14 | public float Boundry_inclination_soul;
15 | public float Boundry_value;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/BigHat/ParamEntries/EquipParamAccessory.cs:
--------------------------------------------------------------------------------
1 | namespace BigHat.ParamEntries
2 | {
3 | [Param(96)]
4 | public class EquipParamAccessory : ParamEntry
5 | {
6 | public int RefId;
7 | public int SfxVariationId;
8 | public float Weight;
9 | public int BehaviorId;
10 | public int BasicPrice;
11 | public int SellValue;
12 | public int SortId;
13 | public int QwcId;
14 | public short EquipModelId;
15 | public short IconId;
16 | public short ShopLv;
17 | public short TrophySGradeId;
18 | public short ThrophySeqId;
19 | public byte EquipModelCategory;
20 | public byte EquipModelGender;
21 | public byte AccessoryCategory;
22 | public byte RefCategory;
23 | public byte SpEffectCategory;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/BigHat/ParamEntries/EquipParamProtector.cs:
--------------------------------------------------------------------------------
1 | namespace BigHat.ParamEntries
2 | {
3 | [Param(400)]
4 | public class EquipParamProtector : ParamEntry
5 | {
6 | [PFieldOffset(0x0)]
7 | public int SortId;
8 | [PFieldOffset(0x4)]
9 | public int WanderingEquipId;
10 | [PFieldOffset(0x8)]
11 | public int VagrantItemLotId;
12 | [PFieldOffset(0x0C)]
13 | public int VagrantBonusEneDropItemLotId;
14 | [PFieldOffset(0x10)]
15 | public int VagrantItemEneDropItemLotId;
16 | [PFieldOffset(0x14)]
17 | public int FixPrice;
18 | [PFieldOffset(0x18)]
19 | public int BasicPrice;
20 | [PFieldOffset(0x1C)]
21 | public int SellValue;
22 | [PFieldOffset(0x20)]
23 | public float Weight;
24 | [PFieldOffset(0x24)]
25 | public int ResidentSpEffectId1;
26 | [PFieldOffset(0x28)]
27 | public int ResidentSpEffectId2;
28 | [PFieldOffset(0x2C)]
29 | public int ResidentSpEffectId3;
30 | [PFieldOffset(0x30)]
31 | public int MaterialSetId;
32 | [PFieldOffset(0x34)]
33 | public float PartsDamageRate;
34 | [PFieldOffset(0xC0)]
35 | public short ResistPoison;
36 | [PFieldOffset(0xC2)]
37 | public short ResistToxic;
38 | [PFieldOffset(0xC4)]
39 | public short ResistBlood;
40 | [PFieldOffset(0xC6)]
41 | public byte ResistCurse;
42 | [PFieldOffset(0xE0)]
43 | public float DefensePhysics;
44 | [PFieldOffset(0xE4)]
45 | public float DefenseSlash;
46 | [PFieldOffset(0xE8)]
47 | public float DefenseStrike;
48 | [PFieldOffset(0xEC)]
49 | public float DefenseThrust;
50 | [PFieldOffset(0xF0)]
51 | public float DefenseMagic;
52 | [PFieldOffset(0xF4)]
53 | public float DefenseFire;
54 | [PFieldOffset(0xF8)]
55 | public float DefenseThunder;
56 | [PFieldOffset(0xA0)]
57 | public short EquipModelId;
58 | [PFieldOffset(0xA8)]
59 | public short KnockbackBounceRate;
60 | [PFieldOffset(0xAA)]
61 | public short Durability;
62 | [PFieldOffset(0xAC)]
63 | public short DurabilityMax;
64 | [PFieldOffset(0xAE)]
65 | public byte SaDurability;
66 | [PFieldOffset(0x110)]
67 | public float Poise;
68 | [PFieldOffset(0x118)]
69 | public float DefenseDark;
70 | [PFieldOffset(0x12C)]
71 | public short ResistFrost;
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/BigHat/ParamEntries/EquipParamWeapon.cs:
--------------------------------------------------------------------------------
1 | namespace BigHat.ParamEntries
2 | {
3 | [Param(608)]
4 | public class EquipParamWeapon : ParamEntry
5 | {
6 | [PFieldOffset(0x0)]
7 | public uint BehaviorVariationId;
8 | [PFieldOffset(0x4)]
9 | public uint SortId;
10 | [PFieldOffset(0x8)]
11 | public int WanderingEquipId;
12 | [PFieldOffset(0xC)]
13 | public float Weight;
14 | [PFieldOffset(0x10)]
15 | public int WeaponWeightRate;
16 | [PFieldOffset(0x14)]
17 | public int FixPrice;
18 | [PFieldOffset(0x18)]
19 | public int BasicPrice;
20 | [PFieldOffset(0x1C)]
21 | public int SellValue;
22 | [PFieldOffset(0x20)]
23 | public float CorrectStrength;
24 | [PFieldOffset(0x24)]
25 | public float CorrectAgility;
26 | [PFieldOffset(0x28)]
27 | public float CorrectMagic;
28 | [PFieldOffset(0x2C)]
29 | public float CorrectFaith;
30 | [PFieldOffset(0x30)]
31 | public float PhysGuardCutRate;
32 | [PFieldOffset(0x34)]
33 | public float MagGuardCutRate;
34 | [PFieldOffset(0x38)]
35 | public float FireGuardCutRate;
36 | [PFieldOffset(0x3C)]
37 | public float ThunGuardCutRate;
38 | [PFieldOffset(0x40)]
39 | public int SpEffectBehaviorId1;
40 | [PFieldOffset(0x44)]
41 | public int SpEffectBehaviorId2;
42 | [PFieldOffset(0x48)]
43 | public int SpEffectBehaviorId3;
44 | [PFieldOffset(0x4C)]
45 | public int ResidentSpEffectId1;
46 | [PFieldOffset(0x50)]
47 | public int ResidentSpEffectId2;
48 | [PFieldOffset(0x54)]
49 | public int ResidentSpEffectId3;
50 | [PFieldOffset(0x58)]
51 | public int MaterialSetId;
52 | [PFieldOffset(0x5C)]
53 | public int OriginEquipWep;
54 | [PFieldOffset(0x60)]
55 | public int OriginEquipWep1;
56 | [PFieldOffset(0x64)]
57 | public int OriginEquipWep2;
58 | [PFieldOffset(0x68)]
59 | public int OriginEquipWep3;
60 | [PFieldOffset(0x6C)]
61 | public int OriginEquipWep4;
62 | [PFieldOffset(0x70)]
63 | public int OriginEquipWep5;
64 | [PFieldOffset(0x74)]
65 | public int OriginEquipWep6;
66 | [PFieldOffset(0x78)]
67 | public int OriginEquipWep7;
68 | [PFieldOffset(0x7C)]
69 | public int OriginEquipWep8;
70 | [PFieldOffset(0x80)]
71 | public int OriginEquipWep9;
72 | [PFieldOffset(0x84)]
73 | public int OriginEquipWep10;
74 | [PFieldOffset(0x88)]
75 | public int OriginEquipWep11;
76 | [PFieldOffset(0x8C)]
77 | public int OriginEquipWep12;
78 | [PFieldOffset(0x90)]
79 | public int OriginEquipWep13;
80 | [PFieldOffset(0x94)]
81 | public int OriginEquipWep14;
82 | [PFieldOffset(0x98)]
83 | public int OriginEquipWep15;
84 | [PFieldOffset(0x9C)]
85 | public float AntiDemonDamageRate;
86 | [PFieldOffset(0xA0)]
87 | public float AntSaintDamageRate;
88 | [PFieldOffset(0xA4)]
89 | public float AntWeakA_DamageRate;
90 | [PFieldOffset(0xA8)]
91 | public float AntWeakB_DamageRate;
92 | [PFieldOffset(0xAC)]
93 | public int VagrantItemLotId;
94 | [PFieldOffset(0xB0)]
95 | public int VagrantBonusEneDropItemLotId;
96 | [PFieldOffset(0xB4)]
97 | public int VagrantItemEneDropItemLotId;
98 | [PFieldOffset(0xB8)]
99 | public ushort EquipModelId;
100 | [PFieldOffset(0xBA)]
101 | public ushort IconId;
102 | [PFieldOffset(0xBC)]
103 | public short Durability;
104 | [PFieldOffset(0xBE)]
105 | public short MaxDurability;
106 | [PFieldOffset(0xC0)]
107 | public short ParryDamageLife;
108 | [PFieldOffset(0xC2)]
109 | public ushort AttackThrowEscape;
110 | [PFieldOffset(0xC4)]
111 | public short AttackBasePhysics;
112 | [PFieldOffset(0xC6)]
113 | public short AttackBaseMagic;
114 | [PFieldOffset(0xC8)]
115 | public short AttackBaseFire;
116 | [PFieldOffset(0xCA)]
117 | public short AttackBaseThunder;
118 | [PFieldOffset(0xCC)]
119 | public short AttackBaseStamina;
120 | [PFieldOffset(0xCE)]
121 | public short AttackBasePoise;
122 | [PFieldOffset(0xD0)]
123 | public short SaDurability;
124 | [PFieldOffset(0xD2)]
125 | public short GuardAngle;
126 | [PFieldOffset(0xD4)]
127 | public short Stability;
128 | [PFieldOffset(0xD6)]
129 | public short ReinforceTypeId;
130 | [PFieldOffset(0xD8)]
131 | public short TrophySGradeId;
132 | [PFieldOffset(0xDA)]
133 | public short ThrophySeqId;
134 | [PFieldOffset(0xDC)]
135 | public short ThrowAtkRate;
136 | [PFieldOffset(0xDE)]
137 | public short BowDistRate;
138 | [PFieldOffset(0xE0)]
139 | public byte EquipModelCategory;
140 | [PFieldOffset(0xE1)]
141 | public byte EquipModelGender;
142 | [PFieldOffset(0xE2)]
143 | public byte WeaponCategory;
144 | [PFieldOffset(0xE3)]
145 | public byte MotionCategory;
146 | [PFieldOffset(0xE4)]
147 | public byte GuardMotionCategory;
148 | [PFieldOffset(0xE5)]
149 | public byte AtkMaterial;
150 | [PFieldOffset(0xE6)]
151 | public byte DefMaterial;
152 | [PFieldOffset(0xE7)]
153 | public byte DefSfxMaterial;
154 | [PFieldOffset(0xE8)]
155 | public byte PhysicsStatFunc;
156 | [PFieldOffset(0xE9)]
157 | public ushort SpAttribute;
158 | [PFieldOffset(0xEB)]
159 | public byte SpAtkCategory;
160 | [PFieldOffset(0xEC)]
161 | public byte WepMotionOneHandId;
162 | [PFieldOffset(0xED)]
163 | public byte WepMotionBothHandId;
164 | [PFieldOffset(0xEE)]
165 | public byte ProperStrength;
166 | [PFieldOffset(0xEF)]
167 | public byte ProperAgility;
168 | [PFieldOffset(0xF0)]
169 | public byte ProperMagic;
170 | [PFieldOffset(0xF1)]
171 | public byte ProperFaith;
172 | [PFieldOffset(0xF2)]
173 | public byte OverStrength;
174 | [PFieldOffset(0xF3)]
175 | public byte AttackBaseParry;
176 | [PFieldOffset(0xF4)]
177 | public byte DefenseBaseParry;
178 | [PFieldOffset(0xF5)]
179 | public byte GuardBaseRepel;
180 | [PFieldOffset(0xF6)]
181 | public byte AttackBaseRepel;
182 | [PFieldOffset(0xF7)]
183 | public byte GuardCutCancelRate;
184 | [PFieldOffset(0xF8)]
185 | public byte GuardLevel;
186 | [PFieldOffset(0xF9)]
187 | public byte SlashGuardCutRate;
188 | [PFieldOffset(0xFA)]
189 | public byte BlowGuardCutRate;
190 | [PFieldOffset(0xFB)]
191 | public byte ThrustGuardCutRate;
192 | [PFieldOffset(0xFC)]
193 | public byte PoisonGuardResist;
194 | [PFieldOffset(0xFD)]
195 | public byte DiseaseGuardResist;
196 | [PFieldOffset(0xFE)]
197 | public byte BloodGuardResist;
198 | [PFieldOffset(0xFF)]
199 | public byte CurseGuardResist;
200 | [PFieldOffset(0x100)]
201 | public byte IsDurabilityDivergence;
202 | [PBitfield(0, 0x101)]
203 | public bool RightHandEquipable;
204 | [PBitfield(1, 0x101)]
205 | public bool LeftHandEquipable;
206 | [PFieldOffset(0x102)]
207 | public byte Buffs;
208 | [PFieldOffset(0x179)]
209 | public byte MagicStatFunc;
210 | [PFieldOffset(0x17A)]
211 | public byte FireStatFunc;
212 | [PFieldOffset(0x17B)]
213 | public byte ThunderStatFunc;
214 | [PFieldOffset(0x188)]
215 | public short AttackBaseDark;
216 | [PFieldOffset(0x18A)]
217 | public byte DarkStatFunc;
218 | [PFieldOffset(0x18B)]
219 | public byte PoisonStatFunc;
220 | [PFieldOffset(0x190)]
221 | public byte BleedStatFunc;
222 | [PFieldOffset(0x191)]
223 | public byte ProperLuck;
224 | [PFieldOffset(0x194)]
225 | public byte WeaponArt;
226 | [PFieldOffset(0x198)]
227 | public float CorrectLuck;
228 | [PFieldOffset(0x1A2)]
229 | public short WeaponClass;
230 | [PFieldOffset(0x228)]
231 | public int AecpId;
232 | }
233 | }
234 |
--------------------------------------------------------------------------------
/BigHat/ParamEntries/Magic.cs:
--------------------------------------------------------------------------------
1 | namespace BigHat.ParamEntries
2 | {
3 | [Param(112)]
4 | public class Magic : ParamEntry
5 | {
6 | public int YesNoDialogMessageId;
7 | public int LimitCancelSpEffectId;
8 | public short SortId;
9 | public short RefId;
10 | public short Mp; //Focus point cost
11 | public short Stamina;
12 | public short Icon;
13 | public short BehaviorId;
14 | public short MtrlItemId;
15 | public short ReplaceMagicId;
16 | public short MaxQuantity;
17 | public byte Humanity;
18 | public byte OverDexterity;
19 | public byte SfxVariationid;
20 | public byte SlotLength;
21 | public byte RequirementIntellect;
22 | public byte RequirementFaith;
23 | public byte AnalogDexterityMin;
24 | public byte AnalogDexterityMax;
25 | public byte EzStateBehaviorType;
26 | public byte RefCategory;
27 | public byte SpEffectCategory;
28 | public byte RefType;
29 | public byte OpmeMenuType;
30 | public byte HasSpEffectType;
31 | public byte ReplaceCategory;
32 | public byte UseLimitCategory;
33 | //public bool VowType0;
34 | //public bool VowType1;
35 | //public bool VowType2;
36 | //public bool VowType3;
37 | //public bool VowType4;
38 | //public bool VowType5;
39 | //public bool VowType6;
40 | //public bool VowType7;
41 | //public bool Enable_multi;
42 | //public bool Enable_multi_only;
43 | //public bool IsEnchant;
44 | //public bool IsShieldEnchant;
45 | //public bool Enable_live;
46 | //public bool Enable_gray;
47 | //public bool Enable_white;
48 | //public bool Enable_black;
49 | //public bool DisableOffline;
50 | //public bool CastResonanceMagic;
51 | //public bool VowType8;
52 | //public bool VowType9;
53 | //public bool VowType10;
54 | //public bool VowType11;
55 | //public bool VowType12;
56 | //public bool VowType13;
57 | //public bool VowType14;
58 | //public bool VowType15;
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/BigHat/ParamEntries/NpcParam.cs:
--------------------------------------------------------------------------------
1 | namespace BigHat.ParamEntries
2 | {
3 | [Param(580)]
4 | public class NpcParam : ParamEntry
5 | {
6 | public int BehaviorVariationId;
7 | public int AiThinkId;
8 | public int NameId;
9 | public float TurnVelocity;
10 | public float HitHeight;
11 | public float HitRadius;
12 | public uint Weight;
13 | public float HitYOffset;
14 | public uint Hp;
15 | public uint Mp;
16 | public uint GetSoul;
17 | public int ItemLotId_1;
18 | public int ItemLotId_2;
19 | public int ItemLotId_3;
20 | public int ItemLotId_4;
21 | public int ItemLotId_5;
22 | public int ItemLotId_6;
23 | public int HumanityLotId;
24 | [PArrayLength(8)]
25 | public int[] SpEffectID;
26 | public int GameClearSpEffectID;
27 | public float PhysGuardCutRate;
28 | public float MagGuardCutRate;
29 | public float FireGuardCutRate;
30 | public float ThunGuardCutRate;
31 | public int AnimIdOffset;
32 | public int MoveAnimId;
33 | public int SpMoveAnimId1;
34 | public int SpMoveAnimId2;
35 | public float NetworkWarpDist;
36 | public int DbgBehaviorR1;
37 | public int DbgBehaviorL1;
38 | public int DbgBehaviorR2;
39 | public int DbgBehaviorL2;
40 | public int DbgBehaviorRL;
41 | public int DbgBehaviorRR;
42 | public int DbgBehaviorRD;
43 | public int DbgBehaviorRU;
44 | public int DbgBehaviorLL;
45 | public int DbgBehaviorLR;
46 | public int DbgBehaviorLD;
47 | public int DbgBehaviorLU;
48 | public int AnimIdOffset2;
49 | public float PartsDamageRate1;
50 | public float PartsDamageRate2;
51 | public float PartsDamageRate3;
52 | public float PartsDamageRate4;
53 | public float PartsDamageRate5;
54 | public float PartsDamageRate6;
55 | public float PartsDamageRate7;
56 | public float PartsDamageRate8;
57 | public float WeakPartsDamageRate;
58 | public float SuperArmorRecoverCorrection;
59 | public float SuperArmorBrakeKnockbackDist;
60 | public ushort Stamina;
61 | public ushort StaminaRecoverBaseVel;
62 | public short Def_phys;
63 | public short Def_slash;
64 | public short Def_blow;
65 | public short Def_thrust;
66 | public short Def_mag;
67 | public short Def_fire;
68 | public short Def_thun;
69 | public ushort DefFlickPower;
70 | public ushort ResistPoison;
71 | public ushort ResistDisease;
72 | public ushort ResistBleed;
73 | public ushort ResistCurse;
74 | public short GhostModelId;
75 | public short NormalChangeResourceId;
76 | public short GuardAngle;
77 | public short SlashGuardCutRate;
78 | public short BlowGuardCutRate;
79 | public short ThrustGuardCutRate;
80 | public short SuperArmorDurability;
81 | public short NormalChangeTexChrId;
82 | public ushort DropType;
83 | public byte KnockbackRate;
84 | public byte KnockbackParamId;
85 | public byte FallDamageDump;
86 | public byte StaminaGuardDef;
87 | public byte PcAttrB;
88 | public byte PcAttrW;
89 | public byte PcAttrL;
90 | public byte PcAttrR;
91 | public byte AreaAttrB;
92 | public byte AreaAttrW;
93 | public byte AreaAttrL;
94 | public byte AreaAttrR;
95 | public byte MpRecoverBaseVel;
96 | public byte FlickDamageCutRate;
97 | public sbyte DefaultLodParamId;
98 | public byte DrawType;
99 | public byte NpcType;
100 | public byte TeamType;
101 | public byte MoveType;
102 | public byte LockDist;
103 | public byte Material;
104 | public byte MaterialSfx;
105 | public byte Material_weak;
106 | public byte MaterialSfx_weak;
107 | public byte PartsDamageType;
108 | public byte MaxUndurationAng;
109 | public sbyte GuardLevel;
110 | public byte BurnSfxType;
111 | public sbyte PoisonGuardResist;
112 | public sbyte DiseaseGuardResist;
113 | public sbyte BloodGuardResist;
114 | public sbyte CurseGuardResist;
115 | public byte ParryAttack;
116 | public byte ParryDefense;
117 | public byte SfxSize;
118 | public byte PushOutCamRegionRadius;
119 | public byte HitStopType;
120 | public byte LadderEndChkOffsetTop;
121 | public byte LadderEndChkOffsetLow;
122 | [PArrayLength(5)]
123 | public byte[] BitFields;
124 | [Hidden]
125 | [PArrayLength(16)]
126 | public byte[] Unknown1;
127 | public short Def_dark;
128 | [Hidden]
129 | [PArrayLength(64)]
130 | public byte[] Unknown2;
131 | public float Phys;
132 | public float Thrust;
133 | public float Strike;
134 | public float Slash;
135 | public float Magic;
136 | public float Fire;
137 | public float Lightning;
138 | public float Dark;
139 | }
140 | }
141 |
--------------------------------------------------------------------------------
/BigHat/ParamEntries/ReinforceParamProtector.cs:
--------------------------------------------------------------------------------
1 | namespace BigHat.ParamEntries
2 | {
3 | [Param(64)]
4 | public class ReinforceParamProtector : ParamEntry
5 | {
6 | public float PhysicsDefRate;
7 | public float MagicDefRate;
8 | public float FireDefRate;
9 | public float ThunderDefRate;
10 | public float SlashDefRate;
11 | public float StrikeDefRate;
12 | public float ThrustDefRate;
13 | public float ResistPoisonRate;
14 | public float ResistDiseaseRate;
15 | public float ResistBloodRate;
16 | public float ResistCurseRate;
17 | public byte ResidentSpEffectId1;
18 | public byte ResidentSpEffectId2;
19 | public byte ResidentSpEffectId3;
20 | public byte MaterialSetId;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/BigHat/ParamEntries/ReinforceParamWeapon.cs:
--------------------------------------------------------------------------------
1 | namespace BigHat.ParamEntries
2 | {
3 | [Param(128)]
4 | public class ReinforceParamWeapon : ParamEntry
5 | {
6 | public float PhysicsAtkRate;
7 | public float MagicAtkRate;
8 | public float FireAtkRate;
9 | public float ThunderAtkRate;
10 | public float StaminaAtkRate;
11 | public float SaWeaponAtkRate;
12 | public float SaDurabilityRate;
13 | public float CorrectStrengthRate;
14 | public float CorrectAgilityRate;
15 | public float CorrectMagicRate;
16 | public float CorrectFaithRate;
17 | public float PhysicsGuardCutRate;
18 | public float MagicGuardCutRate;
19 | public float FireGuardCutRate;
20 | public float ThunderGuardCutRate;
21 | public float PoisonGuardResistRate;
22 | public float DiseaseGuardResistRate;
23 | public float BloodGuardResistRate;
24 | public float CurseGuardResistRate;
25 | public float StaminaGuardDefRate;
26 | public byte SpEffectId1;
27 | public byte SpEffectId2;
28 | public byte SpEffectId3;
29 | public byte ResidentSpEffectId1;
30 | public byte ResidentSpEffectId2;
31 | public byte ResidentSpEffectId3;
32 | public byte MaterialSetId1;
33 | public byte MaterialSetId2;
34 | public float DarkAtkRate;
35 | public float DarkGuardResistRate;
36 | public float CorrectLuckRate;
37 | [Hidden]
38 | [PArrayLength(12)]
39 | public byte[] Unknown;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/BigHat/ParamEntries/SpEffectParam.cs:
--------------------------------------------------------------------------------
1 | namespace BigHat.ParamEntries
2 | {
3 | [Param(800)]
4 | public class SpEffectParam : ParamEntry
5 | {
6 | [PFieldOffset(0x0)]
7 | public int IconId;
8 | [PFieldOffset(0x4)]
9 | public float ConditionHp;
10 | [PFieldOffset(0x8)]
11 | public float EffectEndurance;
12 | [PFieldOffset(0xC)]
13 | public int MotionInterval;
14 | [PFieldOffset(0x10)]
15 | public float MaxHpRate;
16 | [PFieldOffset(0x14)]
17 | public float MaxMpRate;
18 | [PFieldOffset(0x18)]
19 | public float MaxStaminaRate;
20 | [PFieldOffset(0x1C)]
21 | public float SlashDamageCutRate;
22 | [PFieldOffset(0x20)]
23 | public float BlowDamageCutRate;
24 | [PFieldOffset(0x24)]
25 | public float ThrustDamageCutRate;
26 | [PFieldOffset(0x28)]
27 | public float NeutralDamageCutRate;
28 | [PFieldOffset(0x2C)]
29 | public float MagicDamageCutRate;
30 | [PFieldOffset(0x30)]
31 | public float FireDamageCutRate;
32 | [PFieldOffset(0x34)]
33 | public float ThunderDamageCutRate;
34 | [PFieldOffset(0x38)]
35 | public float PhysicsAttackRate;
36 | [PFieldOffset(0x3C)]
37 | public float MagicAttackRate;
38 | [PFieldOffset(0x40)]
39 | public float FireAttackRate;
40 | [PFieldOffset(0x44)]
41 | public float ThunderAttackRate;
42 | [PFieldOffset(0x48)]
43 | public float PhysicsAttackPowerRate;
44 | [PFieldOffset(0x4C)]
45 | public float MagicAttackPowerRate;
46 | [PFieldOffset(0x50)]
47 | public float FireAttackPowerRate;
48 | [PFieldOffset(0x54)]
49 | public float ThunderAttackPowerRate;
50 | [PFieldOffset(0x58)]
51 | public int PhysicsAttackPower;
52 | [PFieldOffset(0x5C)]
53 | public int MagicAttackPower;
54 | [PFieldOffset(0x60)]
55 | public int FireAttackPower;
56 | [PFieldOffset(0x64)]
57 | public int ThunderAttackPower;
58 | [PFieldOffset(0x68)]
59 | public float PhysicsDifferenceRate;
60 | [PFieldOffset(0x6C)]
61 | public float MagicDifferenceRate;
62 | [PFieldOffset(0x70)]
63 | public float FireDifferenceRate;
64 | [PFieldOffset(0x74)]
65 | public float ThunderDifferenceRate;
66 | [PFieldOffset(0x78)]
67 | public int PhysicsDifference;
68 | [PFieldOffset(0x7C)]
69 | public int MagicDifference;
70 | [PFieldOffset(0x80)]
71 | public int FireDifference;
72 | [PFieldOffset(0x84)]
73 | public int ThunderDifference;
74 | [PFieldOffset(0x88)]
75 | public float NoGuardDamageRate;
76 | [PFieldOffset(0x8C)]
77 | public float VitalSpotChangeRate;
78 | [PFieldOffset(0x90)]
79 | public float NormalSpotChangeRate;
80 | [PFieldOffset(0x94)]
81 | public float MaxHpChangeRate;
82 | [PFieldOffset(0x98)]
83 | public int BehaviorId;
84 | [PFieldOffset(0x9C)]
85 | public float ChangeHpRate;
86 | [PFieldOffset(0xA0)]
87 | public int ChangeHpPoint;
88 | [PFieldOffset(0xA4)]
89 | public float ChangeMpRate;
90 | [PFieldOffset(0xA8)]
91 | public int ChangeMpPoint;
92 | [PFieldOffset(0xAC)]
93 | public int MpRecoverChangeSpeed;
94 | [PFieldOffset(0xB0)]
95 | public float ChangeStaminaRate;
96 | [PFieldOffset(0xB4)]
97 | public int ChangeStaminaPoint;
98 | [PFieldOffset(0xB8)]
99 | public int StaminaRecoverChangeSpeed;
100 | [PFieldOffset(0xBC)]
101 | public float MagicEffectTimeChange;
102 | [PFieldOffset(0xC0)]
103 | public int InsideDurability;
104 | [PFieldOffset(0xC4)]
105 | public int MaxDurability;
106 | [PFieldOffset(0xCC)]
107 | public int PoisonAttackPower;
108 | [PFieldOffset(0xD0)]
109 | public int RegistIllness;
110 | [PFieldOffset(0xD4)]
111 | public int BloodAttackPower;
112 | [PFieldOffset(0xD8)]
113 | public int RegistCurse;
114 | [PFieldOffset(0xDC)]
115 | public float FallDamageRate;
116 | [PFieldOffset(0xE0)]
117 | public float SoulRate;
118 | [PFieldOffset(0xE4)]
119 | public float EquipWeightChangeRate;
120 | [PFieldOffset(0xE8)]
121 | public float AllItemWeightChangeRate;
122 | [PFieldOffset(0xEC)]
123 | public int Soul;
124 | [PFieldOffset(0xF0)]
125 | public int AnimidOffset;
126 | [PFieldOffset(0xF4)]
127 | public float HaveSoulRate;
128 | [PFieldOffset(0xF8)]
129 | public float TargetPriority;
130 | [PFieldOffset(0xFC)]
131 | public int SightSearchEnemyCut;
132 | [PFieldOffset(0x100)]
133 | public float HearingSearchEnemyCut;
134 | [PFieldOffset(0x104)]
135 | public float GrabityRate;
136 | [PFieldOffset(0x108)]
137 | public float RegistPoisonChangeRate;
138 | [PFieldOffset(0x10C)]
139 | public float RegistToxicChangeRate;
140 | [PFieldOffset(0x110)]
141 | public float RegistBloodChangeRate;
142 | [PFieldOffset(0x114)]
143 | public float RegistCurseChangeRate;
144 | [PFieldOffset(0x118)]
145 | public float SoulStealRate;
146 | [PFieldOffset(0x11C)]
147 | public float LifeReductionRate;
148 | [PFieldOffset(0x120)]
149 | public float HpRecoverRate;
150 | [PFieldOffset(0x124)]
151 | public int ReplaceSpEffectId;
152 | [PFieldOffset(0x128)]
153 | public int CycleOccurrenceSpEffectId;
154 | [PFieldOffset(0x12C)]
155 | public int AtkOccurrenceSpEffectId;
156 | [PFieldOffset(0x130)]
157 | public float GuardDefFlickPowerRate;
158 | [PFieldOffset(0x134)]
159 | public float GuardStaminaCutRate;
160 | [PFieldOffset(0x138)]
161 | public short RayCastPassedTime;
162 | [PFieldOffset(0x13A)]
163 | public short ChangeSuperArmorPoint;
164 | [PFieldOffset(0x13C)]
165 | public short BowDistRate;
166 | [PFieldOffset(0x13E)]
167 | public ushort SpCategory;
168 | [PFieldOffset(0x140)]
169 | public byte CategoryPriority;
170 | [PFieldOffset(0x141)]
171 | public sbyte SaveCategory;
172 | [PFieldOffset(0x142)]
173 | public byte ChangeMagicSlot;
174 | [PFieldOffset(0x143)]
175 | public byte ChangeMiracleSlot;
176 | [PFieldOffset(0x144)]
177 | public sbyte HeroPointDamage;
178 | [PFieldOffset(0x145)]
179 | public byte DefFlickPower;
180 | [PFieldOffset(0x146)]
181 | public byte FlickDamageCutRate;
182 | [PFieldOffset(0x147)]
183 | public byte BloodDamageRate;
184 | [PFieldOffset(0x148)]
185 | public sbyte DmgLv_None;
186 | [PFieldOffset(0x149)]
187 | public sbyte DmgLv_S;
188 | [PFieldOffset(0x14A)]
189 | public sbyte DmgLv_M;
190 | [PFieldOffset(0x14B)]
191 | public sbyte DmgLv_L;
192 | [PFieldOffset(0x14C)]
193 | public sbyte DmgLv_BlowM;
194 | [PFieldOffset(0x14D)]
195 | public sbyte DmgLv_Push;
196 | [PFieldOffset(0x14E)]
197 | public sbyte DmgLv_Strike;
198 | [PFieldOffset(0x14F)]
199 | public sbyte DmgLv_BlowS;
200 | [PFieldOffset(0x150)]
201 | public sbyte DmgLv_Min;
202 | [PFieldOffset(0x151)]
203 | public sbyte DmgLv_Uppercut;
204 | [PFieldOffset(0x152)]
205 | public sbyte DmgLv_BlowLL;
206 | [PFieldOffset(0x153)]
207 | public sbyte DmgLv_Breath;
208 | [PFieldOffset(0x154)]
209 | public byte AtkAttribute;
210 | [PFieldOffset(0x155)]
211 | public byte SpAttribute;
212 | [PFieldOffset(0x156)]
213 | public byte StateInfo;
214 | [PFieldOffset(0x157)]
215 | public byte WepParamChange;
216 | [PFieldOffset(0x158)]
217 | public byte MoveType;
218 | [PFieldOffset(0x159)]
219 | public byte LifeReductionType;
220 | [PFieldOffset(0x15A)]
221 | public byte ThrowCondition;
222 | [PFieldOffset(0x15B)]
223 | public sbyte AddBehaviorJudgeId_condition;
224 | [PFieldOffset(0x15C)]
225 | public byte AddBehaviorJudgeId_add;
226 |
227 | // Birdulon's https://docs.google.com/spreadsheets/d/1Wn2G4Z7yCbXdBjIdCUSusfvOWg75-kFbswKTPm4PcEQ/pubhtml
228 | [PBitfield(0, 0x15D)]
229 | public bool EffectTargetSelf;
230 | [PBitfield(1, 0x15D)]
231 | public bool EffectTargetFriend;
232 | [PBitfield(2, 0x15D)]
233 | public bool EffectTargetEnemy;
234 | [PBitfield(3, 0x15D)]
235 | public bool EffectTargetPlayer;
236 | [PBitfield(4, 0x15D)]
237 | public bool EffectTargetAI;
238 | [PBitfield(5, 0x15D)]
239 | public bool EffectTargetLive;
240 | [PBitfield(6, 0x15D)]
241 | public bool EffectTargetGhost;
242 | [PBitfield(7, 0x15D)]
243 | public bool EffectTargetWhiteGhost;
244 | [PBitfield(0, 0x15E)]
245 | public bool EffectTargetBlackGhost;
246 | [PBitfield(1, 0x15E)]
247 | public bool EffectTargetAttacker;
248 | [PBitfield(2, 0x15E)]
249 | public bool DispIconNonActive;
250 | [PBitfield(3, 0x15E)]
251 | public bool UseSpEffectEffect;
252 | [PBitfield(4, 0x15E)]
253 | public bool AdjustMagicAbility;
254 | [PBitfield(5, 0x15E)]
255 | public bool AdjustFaithAbility;
256 | [PBitfield(6, 0x15E)]
257 | public bool GameClearBonus;
258 | [PBitfield(7, 0x15E)]
259 | public bool MagParamChange;
260 | [PBitfield(0, 0x15F)]
261 | public bool MiracleParamChange;
262 | [PBitfield(1, 0x15F)]
263 | public bool ClearSoul;
264 | [PBitfield(2, 0x15F)]
265 | public bool RequestSOS;
266 | [PBitfield(3, 0x15F)]
267 | public bool RequestBlackSOS;
268 | [PBitfield(4, 0x15F)]
269 | public bool RequestForceJoinBlackSOS;
270 | [PBitfield(5, 0x15F)]
271 | public bool RequestKickSession;
272 | [PBitfield(6, 0x15F)]
273 | public bool RequestLeaveSession;
274 | [PBitfield(7, 0x15F)]
275 | public bool RequestNpcInveda;
276 | [PBitfield(0, 0x160)]
277 | public bool NoDead;
278 | [PBitfield(1, 0x160)]
279 | public bool CurrHPIndependeMax;
280 | [PBitfield(2, 0x160)]
281 | public bool CorrosionIgnore;
282 | [PBitfield(3, 0x160)]
283 | public bool SightSearchIgnore;
284 | [PBitfield(4, 0x160)]
285 | public bool HearingSearchCutIgnore;
286 | [PBitfield(5, 0x160)]
287 | public bool AntiMagicIgnore;
288 | [PBitfield(6, 0x160)]
289 | public bool FakeTargetIgnore;
290 | [PBitfield(7, 0x160)]
291 | public bool FakeTargetIgnoreUndead;
292 | [PBitfield(0, 0x161)]
293 | public bool FakeTargetIgnoreAnimal;
294 | [PBitfield(1, 0x161)]
295 | public bool GrabityIgnore;
296 | [PBitfield(2, 0x161)]
297 | public bool DisablePoison;
298 | [PBitfield(3, 0x161)]
299 | public bool DisableDisease;
300 | [PBitfield(4, 0x161)]
301 | public bool DisableBlood;
302 | [PBitfield(5, 0x161)]
303 | public bool DisableCurse;
304 | [PBitfield(6, 0x161)]
305 | public bool EnableCharm;
306 | [PBitfield(7, 0x161)]
307 | public bool EnableLifeTime;
308 | [PBitfield(0, 0x162)]
309 | public bool HasTarget;
310 | [PBitfield(1, 0x162)]
311 | public bool IsFireDamageCancel;
312 | [PBitfield(2, 0x162)]
313 | public bool IsExtendSpEffectLife;
314 | [PBitfield(3, 0x162)]
315 | public bool RequestLeaveColiseumSession;
316 | [PBitfield(0, 0x163)]
317 | public bool VowType0;
318 | [PBitfield(1, 0x163)]
319 | public bool VowType1;
320 | [PBitfield(2, 0x163)]
321 | public bool VowType2;
322 | [PBitfield(3, 0x163)]
323 | public bool VowType3;
324 | [PBitfield(4, 0x163)]
325 | public bool VowType4;
326 | [PBitfield(5, 0x163)]
327 | public bool VowType5;
328 | [PBitfield(6, 0x163)]
329 | public bool VowType6;
330 | [PBitfield(7, 0x163)]
331 | public bool VowType7;
332 | [PBitfield(0, 0x164)]
333 | public bool VowType8;
334 | [PBitfield(1, 0x164)]
335 | public bool VowType9;
336 | [PBitfield(2, 0x164)]
337 | public bool VowType10;
338 | [PBitfield(3, 0x164)]
339 | public bool VowType11;
340 | [PBitfield(4, 0x164)]
341 | public bool VowType12;
342 | [PBitfield(5, 0x164)]
343 | public bool VowType13;
344 | [PBitfield(6, 0x164)]
345 | public bool VowType14;
346 | [PBitfield(7, 0x164)]
347 | public bool VowType15;
348 | //
349 |
350 | [PFieldOffset(0x1AC)]
351 | public int FrostAttackPower;
352 |
353 | [PFieldOffset(0x1D8)]
354 | public float DarkDifferenceRate;
355 | }
356 | }
357 |
--------------------------------------------------------------------------------
/BigHat/ParamEntry.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Reflection;
5 |
6 | namespace BigHat
7 | {
8 | public abstract class ParamEntry : TableEntry
9 | {
10 | public uint Id;
11 | public int Index;
12 | public int Offset;
13 |
14 | public static T FromBytes(byte[] value, int startIndex) where T : ParamEntry, new()
15 | {
16 | object paramEntry = new T();
17 | var paramSizeAttr =
18 | (ParamAttribute[]) paramEntry.GetType().GetCustomAttributes(typeof(ParamAttribute), false);
19 | if (paramSizeAttr.Length < 1)
20 | throw new ArgumentException($"Structure does not have the Param attribute");
21 |
22 | using (var sr = new MemoryStream(value, startIndex, paramSizeAttr[0].Size))
23 | using (var reader = new BinaryReaderExt(sr))
24 | {
25 | var fields = paramEntry.GetType().GetFields(BindingFlags.Public |
26 | BindingFlags.Instance |
27 | BindingFlags.DeclaredOnly);
28 | foreach (var field in fields)
29 | {
30 | var bitfieldAttr =
31 | (PBitfieldAttribute[]) field.GetCustomAttributes(typeof(PBitfieldAttribute), false);
32 | var fieldOffsetAttr =
33 | (PFieldOffsetAttribute[]) field.GetCustomAttributes(typeof(PFieldOffsetAttribute), false);
34 | var marshalAsAttr =
35 | (PArrayLengthAttribute[]) field.GetCustomAttributes(typeof(PArrayLengthAttribute), false);
36 |
37 | if (fieldOffsetAttr.Length > 0)
38 | reader.Seek(fieldOffsetAttr[0].Offset, SeekOrigin.Begin);
39 | if (bitfieldAttr.Length > 0)
40 | {
41 | var offset = bitfieldAttr[0].Bitoffset;
42 | var index = bitfieldAttr[0].Index;
43 | reader.Seek(index, SeekOrigin.Begin);
44 | field.SetValue(paramEntry, ((reader.ReadByte() & 1 << offset) >> offset == 1));
45 | }
46 | if (marshalAsAttr.Length > 0)
47 | {
48 | var arrayType = field.FieldType.GetElementType();
49 | var array = Array.CreateInstance(arrayType, marshalAsAttr[0].Length);
50 | for (var i = 0; i < array.Length; i++)
51 | array.SetValue(reader.ReadValueType(arrayType), i);
52 | field.SetValue(paramEntry, array);
53 | }
54 | else field.SetValue(paramEntry, reader.ReadValueType(field.FieldType));
55 | }
56 | }
57 | return (T) paramEntry;
58 | }
59 |
60 | public static int SizeOf() where T : ParamEntry
61 | {
62 | var paramSizeAttr = (ParamAttribute[]) typeof(T).GetCustomAttributes(typeof(ParamAttribute), false);
63 | if (paramSizeAttr.Length < 1)
64 | throw new ArgumentException($"Structure does not have the Param attribute");
65 | return paramSizeAttr[0].Size;
66 | }
67 |
68 | public override IReadOnlyList GetFields()
69 | {
70 | var baseFields = typeof(ParamEntry).GetFields();
71 | var derivedFields = GetType().GetFields(BindingFlags.Public |
72 | BindingFlags.Instance |
73 | BindingFlags.DeclaredOnly);
74 | var fields = new FieldInfo[baseFields.Length + derivedFields.Length];
75 | baseFields.CopyTo(fields, 0);
76 | derivedFields.CopyTo(fields, baseFields.Length);
77 | return fields;
78 | }
79 | }
80 | }
--------------------------------------------------------------------------------
/BigHat/ParamImporter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics.CodeAnalysis;
4 | using System.Linq;
5 | using System.Text;
6 | using BigHat.ParamEntries;
7 |
8 | namespace BigHat
9 | {
10 | public enum ParamType
11 | {
12 | AtkParam,
13 | AttackElementCorrectParam,
14 | BehaviorParam,
15 | CalcCorrectGraph,
16 | EquipParamAccessory,
17 | EquipParamProtector,
18 | EquipParamWeapon,
19 | MagicParam,
20 | NpcParam,
21 | ReinforceParamProtector,
22 | ReinforceParamWeapon,
23 | SpEffectParam
24 | }
25 |
26 | public class ParamImporter : IImporter
27 | {
28 | private uint _baseOffset;
29 | private readonly byte[] _data;
30 |
31 | public ParamImporter(string path)
32 | {
33 | _data = Utils.ReadBinaryDataFromFile(path);
34 | ReadHeaderData();
35 | }
36 |
37 | public int Count { get; private set; }
38 | public ParamType Type { get; private set; }
39 |
40 | private static string GetTableName(byte[] binaryData)
41 | {
42 | var tableName = new StringBuilder();
43 | var tableNameOffset = BitConverter.ToInt32(binaryData, 0);
44 | byte nextChar;
45 | while (tableNameOffset < binaryData.Length && (nextChar = binaryData[tableNameOffset]) != 0x00)
46 | {
47 | tableName.Append((char) nextChar);
48 | tableNameOffset++;
49 | }
50 | return tableName.ToString();
51 | }
52 |
53 | public IList Import()
54 | {
55 | return ImportParam().Cast().ToList();
56 | }
57 |
58 | public IList ImportParam()
59 | {
60 | switch (Type)
61 | {
62 | case ParamType.AtkParam:
63 | return ImportParamAs().Cast().ToList();
64 | case ParamType.AttackElementCorrectParam:
65 | return ImportParamAs().Cast().ToList();
66 | case ParamType.BehaviorParam:
67 | return ImportParamAs().Cast().ToList();
68 | case ParamType.CalcCorrectGraph:
69 | return ImportParamAs().Cast().ToList();
70 | case ParamType.EquipParamAccessory:
71 | return ImportParamAs().Cast().ToList();
72 | case ParamType.EquipParamProtector:
73 | return ImportParamAs().Cast().ToList();
74 | case ParamType.EquipParamWeapon:
75 | return ImportParamAs().Cast().ToList();
76 | case ParamType.MagicParam:
77 | return ImportParamAs().Cast().ToList();
78 | case ParamType.NpcParam:
79 | return ImportParamAs().Cast().ToList();
80 | case ParamType.ReinforceParamProtector:
81 | return ImportParamAs().Cast().ToList();
82 | case ParamType.ReinforceParamWeapon:
83 | return ImportParamAs().Cast().ToList();
84 | case ParamType.SpEffectParam:
85 | return ImportParamAs().Cast().ToList();
86 | default:
87 | throw new Exception("This param type is not supported");
88 | }
89 | }
90 |
91 | public IList ImportParamAs() where T : ParamEntry, new()
92 | {
93 | var ret = new List(Count);
94 |
95 | for (var i = 0; i < Count; i++)
96 | {
97 | var realOffset = (int) _baseOffset + ParamEntry.SizeOf()*i;
98 | var id = BitConverter.ToUInt32(_data, 0x40 + 0x18*i);
99 |
100 | var structure = ParamEntry.FromBytes(_data, realOffset);
101 | structure.Id = id;
102 | structure.Index = i;
103 | structure.Offset = realOffset;
104 | ret.Add(structure);
105 | }
106 |
107 | ret = ret.OrderBy(x => x.Id).ToList();
108 | return ret;
109 | }
110 |
111 | public void ReadHeaderData()
112 | {
113 | Type = GetParamType();
114 | Count = BitConverter.ToInt16(_data, 0xA);
115 | _baseOffset = BitConverter.ToUInt32(_data, 0x30);
116 | }
117 |
118 | [SuppressMessage("ReSharper", "StringLiteralTypo")]
119 | [SuppressMessage("ReSharper", "RedundantCaseLabel")]
120 | private ParamType GetParamType()
121 | {
122 | var structName = GetTableName(_data);
123 | switch (structName)
124 | {
125 | case "ATK_PARAM_ST":
126 | return ParamType.AtkParam;
127 | case "ATTACK_ELEMENT_CORRECT_PARAM_ST":
128 | return ParamType.AttackElementCorrectParam;
129 | case "BEHAVIOR_PARAM_ST":
130 | return ParamType.BehaviorParam;
131 | case "CACL_CORRECT_GRAPH_ST":
132 | return ParamType.CalcCorrectGraph;
133 | case "EQUIP_PARAM_ACCESSORY_ST":
134 | return ParamType.EquipParamAccessory;
135 | case "EQUIP_PARAM_PROTECTOR_ST":
136 | return ParamType.EquipParamProtector;
137 | case "EQUIP_PARAM_WEAPON_ST":
138 | return ParamType.EquipParamWeapon;
139 | case "MAGIC_PARAM_ST":
140 | return ParamType.MagicParam;
141 | case "NPC_PARAM_ST":
142 | return ParamType.NpcParam;
143 | case "REINFORCE_PARAM_PROTECTOR_ST":
144 | return ParamType.ReinforceParamProtector;
145 | case "REINFORCE_PARAM_WEAPON_ST":
146 | return ParamType.ReinforceParamWeapon;
147 | case "SP_EFFECT_PARAM_ST":
148 | return ParamType.SpEffectParam;
149 | case "ACTIONBUTTON_PARAM_ST":
150 | case "AI_SOUND_PARAM_ST":
151 | case "EQUIP_PARAM_GOODS_ST":
152 | case "BONFIRE_WARP_PARAM_ST":
153 | case "BUDGET_PARAM_ST":
154 | case "BULLET_CREATE_LIMIT_PARAM_ST":
155 | case "BULLET_PARAM_ST":
156 | case "CEREMONY_PARAM_ST":
157 | case "CHARACTER_INIT_PARAM":
158 | case "CHARMAKEMENUTOP_PARAM_ST":
159 | case "CHARMAKEMENU_LISTITEM_PARAM_ST":
160 | case "CLEAR_COUNT_CORRECT_PARAM_ST":
161 | case "COOL_TIME_PARAM_ST":
162 | case "CULT_SETTING_PARAM_ST":
163 | case "DECAL_PARAM_ST":
164 | case "DIRECTION_CAMERA_PARAM_ST":
165 | case "EQUIP_MTRL_SET_PARAM_ST":
166 | case "ESTUS_FLASK_RECOVERY_PARAM_ST":
167 | case "FACE_GEN_PARAM_ST":
168 | case "FACE_PARAM_ST":
169 | case "FACE_RANGE_PARAM_ST":
170 | case "FOOT_SFX_PARAM_ST":
171 | case "GAME_AREA_PARAM_ST":
172 | case "GAME_PROGRESS_PARAM_ST":
173 | case "GEMEFFECT_PARAM_ST":
174 | case "GEM_CATEGORY_PARAM_ST":
175 | case "GEM_DROP_DOPING_PARAM_ST":
176 | case "GEM_DROP_MODIFY_PARAM_ST":
177 | case "GEM_GEN_PARAM_ST":
178 | case "HIT_EFFECT_SE_PARAM_ST":
179 | case "HIT_EFFECT_SFX_CONCEPT_PARAM_ST":
180 | case "HIT_EFFECT_SFX_PARAM_ST":
181 | case "HIT_MTRL_PARAM_ST":
182 | case "ITEMLOT_PARAM_ST":
183 | case "KNOCKBACK_PARAM_ST":
184 | case "KNOWLEDGE_LOADSCREEN_ITEM_PARAM_ST":
185 | case "LOAD_BALANCER_DRAW_DIST_SCALE_PARAM_ST":
186 | case "LOAD_BALANCER_PARAM_ST":
187 | case "LOCK_CAM_PARAM_ST":
188 | case "LOD_BANK":
189 | case "MAP_MIMICRY_ESTABLISHMENT_PARAM_ST":
190 | case "MENUPROPERTY_LAYOUT":
191 | case "MENUPROPERTY_SPEC":
192 | case "MENU_OFFSCR_REND_PARAM_ST":
193 | case "MENU_PARAM_COLOR_TABLE_ST":
194 | case "MENU_VALUE_TABLE_SPEC":
195 | case "MODEL_SFX_PARAM_ST":
196 | case "MOVE_PARAM_ST":
197 | case "MULTI_ESTUS_FLASK_BONUS_PARAM_ST":
198 | case "MULTI_PLAY_CORRECTION_PARAM_ST":
199 | case "MULTI_SOUL_BONUS_RATE_PARAM_ST":
200 | case "NETWORK_AREA_PARAM_ST":
201 | case "NETWORK_MSG_PARAM_ST":
202 | case "NETWORK_PARAM_ST":
203 | case "NPC_AI_ACTION_PARAM_ST":
204 | case "NPC_THINK_PARAM_ST":
205 | case "OBJECT_MATERIAL_SFX_PARAM_ST":
206 | case "OBJECT_PARAM_ST":
207 | case "OBJ_ACT_PARAM_ST":
208 | case "PHANTOM_PARAM_ST":
209 | case "PLAY_REGION_PARAM_ST":
210 | case "PROTECTOR_GEN_PARAM_ST":
211 | case "RAGDOLL_PARAM_ST":
212 | case "ROLE_PARAM_ST":
213 | case "SE_MATERIAL_CONVERT_PARAM_ST":
214 | case "SHOP_LINEUP_PARAM":
215 | case "SKELETON_PARAM_ST":
216 | case "SP_EFFECT_VFX_PARAM_ST":
217 | case "SWORD_ARTS_PARAM_ST":
218 | case "TALK_PARAM_ST":
219 | case "THROW_DIRECTION_SFX_PARAM_ST":
220 | case "THROW_INFO_BANK":
221 | case "TOUGHNESS_PARAM_ST":
222 | case "UPPER_ARM_PARAM_ST":
223 | case "WEAPON_GEN_PARAM_ST":
224 | case "WEP_ABSORP_POS_PARAM_ST":
225 | case "WET_ASPECT_PARAM_ST":
226 | case "WIND_PARAM_ST":
227 | default:
228 | throw new Exception("This structure type is not supported");
229 | }
230 | }
231 | }
232 | }
--------------------------------------------------------------------------------
/BigHat/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Globalization;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading;
7 | using BigHat.ParamEntries;
8 |
9 | namespace BigHat
10 | {
11 | internal class Program
12 | {
13 | private static Arguments _arguments;
14 | private static ExportFormat _exportFormat;
15 |
16 | [Flags]
17 | public enum Arguments
18 | {
19 | None = 0x0, // 0b000
20 | Headers = 0x1, // 0b001
21 | HeadersPlus = 0x3, // 0b011
22 | Debug = 0x7 // 0b111
23 | }
24 |
25 | public enum ExportFormat
26 | {
27 | Csv,
28 | Proto
29 | }
30 |
31 | public static void TryExport(string filename)
32 | {
33 | try
34 | {
35 | Console.WriteLine($"Exporting {filename}...");
36 | TryExport(filename, CreateImporterForFile(filename));
37 | }
38 | catch (Exception e)
39 | {
40 | Console.WriteLine(e);
41 | }
42 | }
43 |
44 | public static void TryExport(string filename, IImporter importer)
45 | {
46 | if (filename == null) throw new ArgumentNullException(nameof(filename));
47 | if (filename == string.Empty) throw new ArgumentException("filename is an empty string", nameof(filename));
48 | if (importer == null) throw new ArgumentNullException(nameof(importer));
49 |
50 | var outputPath =
51 | $"{Path.Combine(Path.GetDirectoryName(filename) ?? string.Empty, Path.GetFileNameWithoutExtension(filename))}Out.csv";
52 |
53 | if (_exportFormat == ExportFormat.Csv)
54 | CsvExporter.Export(outputPath, importer.Import(), (_arguments & Arguments.Headers) == Arguments.Headers,
55 | (_arguments & Arguments.HeadersPlus) == Arguments.HeadersPlus,
56 | (_arguments & Arguments.Debug) == Arguments.Debug);
57 | else if (_exportFormat == ExportFormat.Proto)
58 | ProtoBufDataExporter.Export(outputPath, importer.Import());
59 | }
60 |
61 | private static void Main(string[] args)
62 | {
63 | Console.OutputEncoding = Encoding.Unicode;
64 | SetupNumberFormat();
65 | var path = ParseArgs(args);
66 |
67 | if (path == null)
68 | {
69 | ExportDefault();
70 | return;
71 | }
72 |
73 | var extension = Path.GetExtension(path);
74 | if (string.IsNullOrEmpty(extension))
75 | ExportDefault(path);
76 | else
77 | TryExport(path);
78 | }
79 |
80 | private static IImporter CreateImporterForFile(string filename)
81 | {
82 | switch (Path.GetExtension(filename))
83 | {
84 | case ".param":
85 | return new ParamImporter(filename);
86 | case ".fmg":
87 | return new FmgImporter(filename);
88 | default:
89 | throw new ArgumentOutOfRangeException(nameof(filename), filename,
90 | "Expected .param or .fmg file extension.");
91 | }
92 | }
93 |
94 | private static void ExportDefault(string folderPath = "")
95 | {
96 | string[] defaultFiles = {
97 | "NPC名.fmg", // Npc names
98 | "アイテムうんちく.fmg",
99 | "アイテム名.fmg",
100 | "アイテム説明.fmg",
101 | "アクセサリうんちく.fmg",
102 | "アクセサリ名.fmg",
103 | "アクセサリ説明.fmg",
104 | "地名.fmg",
105 | "武器うんちく.fmg",
106 | "武器名.fmg", // Weapon names
107 | // "武器説明.fmg", // Doesn't contain anything as far as I can see.
108 | "防具うんちく.fmg",
109 | "防具名.fmg",
110 | "防具説明.fmg",
111 | "魔法うんちく.fmg",
112 | "魔法名.fmg",
113 | "魔法説明.fmg",
114 | "EquipParamWeapon.param",
115 | "EquipParamAccessory.param",
116 | "EquipParamProtector.param",
117 | "ReinforceParamWeapon.param",
118 | "ReinforceParamProtector.param",
119 | "AttackElementCorrectParam.param",
120 | "CalcCorrectGraph.param",
121 | "Magic.param",
122 | "SpEffectParam.param",
123 | "NpcParam.param",
124 | "BehaviorParam.param",
125 | "BehaviorParam_PC.param",
126 | "AtkParam_Pc.param",
127 | "AtkParam_Npc.param"
128 | };
129 |
130 | foreach (var file in defaultFiles)
131 | {
132 | var filepath = Path.Combine(folderPath, file);
133 | if (File.Exists(filepath)) TryExport(filepath);
134 | }
135 | }
136 |
137 | private static void GenerateProto()
138 | {
139 | using (var t = new ProtoBufWriter("ds3ext.proto", "ds3ext"))
140 | {
141 | t.WriteMessage();
142 | t.WriteMessage();
143 | t.WriteMessage();
144 | t.WriteMessage();
145 | t.WriteMessage();
146 | t.WriteMessage();
147 | t.WriteMessage();
148 | t.WriteMessage();
149 | t.WriteMessage();
150 | t.WriteMessage();
151 | t.WriteMessage();
152 | t.WriteMessage();
153 | t.WriteMessage();
154 | }
155 | }
156 |
157 | private static void SetupNumberFormat()
158 | {
159 | var cultureInfo = (CultureInfo) Thread.CurrentThread.CurrentCulture.Clone();
160 | cultureInfo.NumberFormat.NumberDecimalSeparator = ".";
161 | Thread.CurrentThread.CurrentCulture = cultureInfo;
162 | }
163 |
164 | private static bool IsFilePath(string str)
165 | {
166 | try
167 | {
168 | // ReSharper disable once ReturnValueOfPureMethodIsNotUsed
169 | Path.GetFullPath(str);
170 | return true;
171 | }
172 | catch (Exception)
173 | {
174 | return false;
175 | }
176 | }
177 |
178 | private static void OutputHelpAndExit()
179 | {
180 | Console.WriteLine(
181 | $"Usage: {Path.GetFileNameWithoutExtension(AppDomain.CurrentDomain.FriendlyName)} [] []");
182 | Console.WriteLine("Arguments:");
183 | Console.WriteLine(" -h\tHelp.");
184 | Console.WriteLine(" -H\tOutput column headers.");
185 | Console.WriteLine(" -H+\tOutput structure offsets and headers.");
186 | Console.WriteLine(" -d\tDebug Mode, outputs hidden columns.");
187 | Console.WriteLine(" -g\tGenerate .proto file.");
188 | Console.WriteLine(" -p\tOutput in protobuf format.");
189 | Environment.Exit(0);
190 | }
191 |
192 | private static string ParseArgs(string[] args)
193 | {
194 | if (!args.Any())
195 | return null;
196 |
197 | string path = null;
198 | switch (args[0])
199 | {
200 | case "-h":
201 | OutputHelpAndExit();
202 | break;
203 | case "-H":
204 | _arguments |= Arguments.Headers;
205 | break;
206 | case "-H+":
207 | _arguments |= Arguments.HeadersPlus;
208 | break;
209 | case "-d":
210 | _arguments |= Arguments.Debug;
211 | break;
212 | case "-g":
213 | GenerateProto();
214 | Environment.Exit(0);
215 | break;
216 | case "-p":
217 | _exportFormat = ExportFormat.Proto;
218 | break;
219 | default:
220 | if (IsFilePath(args[0]))
221 | path = args[0];
222 | else OutputHelpAndExit();
223 | break;
224 | }
225 |
226 | if (args.Length > 1)
227 | {
228 | if (IsFilePath(args[1]))
229 | path = args[1];
230 | else OutputHelpAndExit();
231 | }
232 |
233 | return path;
234 | }
235 | }
236 | }
--------------------------------------------------------------------------------
/BigHat/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("DarkSouls3ExtractionTool")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("DarkSouls3ExtractionTool")]
13 | [assembly: AssemblyCopyright("Copyright © 2016")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("f0fc2cf1-2701-4ae1-8c69-b8144ffdfbf3")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/BigHat/ProtoBufDataExporter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Reflection;
6 | using Google.Protobuf;
7 |
8 | namespace BigHat
9 | {
10 | public class ProtoBufDataExporter
11 | {
12 | public static void Export(string filename, IList data)
13 | {
14 | if (data.Count < 1)
15 | throw new ArgumentException("The list is empty.");
16 |
17 | var exportFile =
18 | File.Create(
19 | $"{Path.Combine(Path.GetDirectoryName(filename), Path.GetFileNameWithoutExtension(filename))}Out.dat");
20 |
21 | var fieldNames = data[0].GetFieldNames();
22 | var entry0 = data[0];
23 |
24 | var pbName = entry0.GetType().Name;
25 | var protoClass = Type.GetType($"Ds3Ext.{entry0.GetType().Name}");
26 | var protoProperties = new List(fieldNames.Count);
27 | protoProperties.AddRange(fieldNames.Select(fieldName => protoClass.GetProperty(FixStringProto(fieldName))));
28 |
29 | foreach (var entry in data)
30 | {
31 | var protoInstance = Activator.CreateInstance(protoClass);
32 | var fieldValues = entry.GetFieldValues();
33 | for (var i = 0; i < protoProperties.Count; i++)
34 | protoProperties[i].SetValue(protoInstance, fieldValues[i]);
35 | ((IMessage) protoInstance).WriteDelimitedTo(exportFile);
36 | }
37 |
38 | exportFile.Close();
39 | }
40 |
41 | // protobuf removes '_' characters and uppercases the first character so we need to do that also.
42 | private static string FixStringProto(string fieldName)
43 | {
44 | return string.Concat(fieldName.Split('_').Select(str => str.First().ToString().ToUpper() + str.Substring(1)));
45 | }
46 | }
47 | }
--------------------------------------------------------------------------------
/BigHat/ProtoBufWriter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 |
5 | namespace BigHat
6 | {
7 | public class ProtoBufWriter : IDisposable
8 | {
9 | private readonly Dictionary _protoTypeNames = new Dictionary
10 | {
11 | {typeof(double), "double"},
12 | {typeof(float), "float"},
13 | {typeof(sbyte), "sint32"},
14 | {typeof(short), "sint32"},
15 | {typeof(int), "sint32"},
16 | {typeof(long), "sint64"},
17 | {typeof(byte), "uint32"},
18 | {typeof(ushort), "uint32"},
19 | {typeof(uint), "uint32"},
20 | {typeof(ulong), "uint64"},
21 | {typeof(bool), "bool"},
22 | {typeof(string), "string"},
23 | {typeof(byte[]), "bytes"},
24 | {typeof(Enum), "enum"}
25 | };
26 |
27 | private readonly StreamWriter _sr;
28 |
29 | public ProtoBufWriter(string path, string packageName)
30 | {
31 | _sr = File.CreateText(path);
32 | _sr.WriteLine("syntax = \"proto3\";");
33 | _sr.WriteLine($"package {packageName};");
34 | _sr.WriteLine();
35 | }
36 |
37 | public void Dispose()
38 | {
39 | _sr.Close();
40 | }
41 |
42 | public void WriteMessage() where T : TableEntry, new()
43 | {
44 | var inst = new T();
45 | var types = inst.GetFieldTypes();
46 | var names = inst.GetFieldNames();
47 |
48 | if (types.Count != names.Count)
49 | throw new Exception();
50 |
51 | _sr.WriteLine($"message {typeof(T).Name} {{");
52 |
53 | for (var i = 0; i < types.Count; i++)
54 | {
55 | var type = _protoTypeNames[types[i]];
56 | _sr.WriteLine($" {type} {names[i]} = {i + 2};");
57 | }
58 |
59 | _sr.WriteLine("}");
60 | _sr.WriteLine();
61 | }
62 | }
63 | }
--------------------------------------------------------------------------------
/BigHat/TableEntry.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Net;
5 | using System.Reflection;
6 | using System.Runtime.InteropServices;
7 |
8 | namespace BigHat
9 | {
10 | public abstract class TableEntry
11 | {
12 | private static int GetArrayLength(FieldInfo field)
13 | {
14 | var attr = (PArrayLengthAttribute) Attribute.GetCustomAttribute(field, typeof(PArrayLengthAttribute));
15 | return attr.Length;
16 | }
17 |
18 | public IList GetFieldNames(bool ignoreHidden = true)
19 | {
20 | return GenerateListForeachField((list, field) =>
21 | {
22 | if (field.FieldType.IsArray)
23 | {
24 | var length = GetArrayLength(field);
25 | for (var i = 0; i < length; i++)
26 | list.Add(field.Name + i);
27 | }
28 | else list.Add(field.Name);
29 | }, ignoreHidden);
30 | }
31 |
32 | public IList GetFieldOffsets(bool ignoreHidden = true)
33 | {
34 | var currentOffset = 0;
35 | var ignoredFields = typeof(ParamEntry).GetFields();
36 | return GenerateListForeachField((list, field) =>
37 | {
38 | if (!ignoredFields.Contains(field))
39 | {
40 | var offsetAttr =
41 | (PFieldOffsetAttribute[])field.GetCustomAttributes(typeof(PFieldOffsetAttribute), false);
42 | if (offsetAttr.Length > 0)
43 | currentOffset = offsetAttr[0].Offset;
44 | if (field.FieldType.IsArray)
45 | {
46 | var length = GetArrayLength(field);
47 | var sizeOfArrayItem = Marshal.SizeOf(field.FieldType.GetElementType());
48 | for (var i = 0; i < length; i++)
49 | {
50 | currentOffset += sizeOfArrayItem;
51 | list.Add(currentOffset);
52 | }
53 | }
54 | else
55 | {
56 | list.Add(currentOffset);
57 | currentOffset += Marshal.SizeOf(field.FieldType);
58 | }
59 | }
60 | else list.Add(-1);
61 |
62 | }, ignoreHidden);
63 | }
64 |
65 | public abstract IReadOnlyList GetFields();
66 |
67 | public IList GetFieldTypes(bool ignoreHidden = true)
68 | {
69 | return GenerateListForeachField((list, field) =>
70 | {
71 | if (field.FieldType.IsArray)
72 | {
73 | var length = GetArrayLength(field);
74 | for (var i = 0; i < length; i++)
75 | list.Add(field.FieldType.GetElementType());
76 | }
77 | else list.Add(field.FieldType);
78 | }, ignoreHidden);
79 | }
80 |
81 | public IList