This repository has been archived by the owner on Jul 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathL2MonsterAttackName.cs
52 lines (45 loc) · 1.59 KB
/
L2MonsterAttackName.cs
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
using System;
using System.Collections.ObjectModel;
using System.IO;
using System.Text;
namespace LEdit
{
public class L2MonsterAttackName
{
#region STATIC
/*private static byte count;
public static byte Count { get { return count; } set { count = value; } }
public const byte InitialCount = 0xE0;*/
public const byte InitialCount = 0x8A;
public const long TableOffset = 0x2F308;
public const byte Bank = 0x85;
//public const long TableOffset_LPatch = 0x408000;
public const string FileName = "files\\monster_attack_names.l2";
public const int FileSize = 0x7BD; //original value
static L2String[] MAttN = new L2String[InitialCount];
public static L2String Get(int n)
{
if (n >= 0 && n < InitialCount)
return MAttN[n];
else
return new L2String("ERROR: 0x" + n.ToString("X2") + " is out of range!");
}
public static void Set(int n, L2String str)
{
if (n >= 0 && n < InitialCount)
MAttN[n] = str;
}
public static void InitROM(BinaryReader rom)
{
for (int i = 0; i < InitialCount; i++)
{
rom.BaseStream.Seek(TableOffset + (i << 1), SeekOrigin.Begin);
SNESExLoROMAddress address =
new SNESExLoROMAddress(Bank, rom.ReadUInt16());
rom.BaseStream.Seek(address.ToPCAddress(), SeekOrigin.Begin);
MAttN[i] = new L2String(rom);
}
}
#endregion
}
}