-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMoveAndMagicStats.cs
More file actions
71 lines (61 loc) · 3.11 KB
/
Copy pathMoveAndMagicStats.cs
File metadata and controls
71 lines (61 loc) · 3.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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
using System.Collections.Generic;
using System.IO;
namespace GrandiaStatEditor
{
public class MoveAndMagicStats
{
public static Dictionary<string, Dictionary<string, string>> MoveAndStatDictionary { get; set; } = new Dictionary<string, Dictionary<string, string>>();
public static void ReadMoveAndMagicData(string path)
{
string windtFilePath = Path.Combine(path, "PC", "FIELD", "windt.bin");
long position = 0x8D08;
using (FileStream s = new FileStream(windtFilePath, FileMode.Open))
using (BinaryReader reader = new BinaryReader(s))
{
reader.BaseStream.Position = position;
foreach (var moveAndMagic in MoveAndMagicListClass.MoveAndMagicsList())
{
var listStats = new Dictionary<string, string>();
var ID = reader.ReadByte();
var ID2 = reader.ReadByte();
var MP_SP = reader.ReadInt16();
var CastSpeed = reader.ReadInt16();
var IpPower = reader.ReadInt16();
var Power = reader.ReadInt16();
var Target = reader.ReadByte();
//NIBBLE
var LevelCom = reader.ReadByte();
var XP = reader.ReadByte();
var AreaRange = reader.ReadByte();
var Elemental = reader.ReadByte();
var Weapon = reader.ReadByte();
var Move = reader.ReadByte();
var CriticalPourcent = reader.ReadByte();
var EffectType = reader.ReadByte();
var Mode = reader.ReadByte();
var AnimationMove = reader.ReadByte();
var OutType = reader.ReadByte();
var IC = reader.ReadByte();
var Unknow = reader.ReadByte();
var Level = ByteConverterClass.GetNibble(LevelCom).Item1 - 4;
var Com = ByteConverterClass.GetNibble(LevelCom).Item2;
listStats.Add("MP_SP", MP_SP.ToString());
listStats.Add("CastSpeed", CastSpeed.ToString());
listStats.Add("IpPower", IpPower.ToString());
listStats.Add("Power", Power.ToString());
listStats.Add("Target", Target.ToString());
listStats.Add("Level", Level.ToString());
listStats.Add("Com", Com.ToString());
listStats.Add("XP", XP.ToString());
listStats.Add("AreaRange", AreaRange.ToString());
listStats.Add("Elemental", Elemental.ToString());
listStats.Add("Move", Move.ToString());
listStats.Add("CriticalPourcent", CriticalPourcent.ToString());
listStats.Add("EffectType", EffectType.ToString());
listStats.Add("Mode", Mode.ToString());
MoveAndStatDictionary.Add(moveAndMagic.Text, listStats);
};
}
}
}
}