I have fully converted LOTF to ini, as you can see it works pretty much ok from the screenshot:
[Only registered and activated users can see links. Click Here To Register...]
But I get this error/warning that is to do with my LoadMobSpawns function:
[Only registered and activated users can see links. Click Here To Register...]
The error line:
I have used the same method for 4 other types of loading, portals, etc the funny thing is the monsters still load ingame, I have to use this method as I coded a php script to dump the lotf db to ini.
Any ideas? I have attached the file for you to review.
[Only registered and activated users can see links. Click Here To Register...]
But I get this error/warning that is to do with my LoadMobSpawns function:
[Only registered and activated users can see links. Click Here To Register...]
Code:
public static void LoadMobSpawns()
{
if (File.Exists(System.Windows.Forms.Application.StartupPath + @"\Objects\MobSpawns.txt"))
{
TextReader TR = new StreamReader(System.Windows.Forms.Application.StartupPath + @"\Objects\MobSpawns.txt");
string Items = TR.ReadToEnd();
TR.Close();
Items = Items.Replace("\r", "");
string[] AllItems = Items.Split('\n');
MobSpawns = new uint[AllItems.Length][];
int i = 0;
foreach (string _item in AllItems)
{
string _item_ = _item.Trim();
if (_item_.Length >= 2)
{
if (_item_.IndexOf("//", 0, 2) != 0)
{
string[] SpawnInfo = _item_.Split(' ');
uint SpawnID = uint.Parse(SpawnInfo[0]);
uint SpawnWhatID = uint.Parse(SpawnInfo[1]);
uint SpawnNr = uint.Parse(SpawnInfo[2]);
uint XStart = uint.Parse(SpawnInfo[3]);
uint YStart = uint.Parse(SpawnInfo[4]);
uint XEnd = uint.Parse(SpawnInfo[5]);
uint YEnd = uint.Parse(SpawnInfo[6]);
uint Map = uint.Parse(SpawnInfo[7]);
MobSpawns[i] = new uint[8] { SpawnID, SpawnWhatID, SpawnNr, XStart, YStart, XEnd, YEnd, Map };
i++;
}
}
}
Console.WriteLine(i + " Mob Spawns successfully loaded.");
}
else
{
Console.WriteLine("MobSpawns file is missing, no MobSpawns where loaded!");
}
}
Code:
SingleMob Mob = new SingleMob(spawn_x, spawn_y, Convert.ToInt16(ThisSpawn[7]), uint.Parse(ThisMob[3]), uint.Parse(ThisMob[3]), short.Parse(ThisMob[6]), short.Parse(ThisMob[7]), UID, ThisMob[2], int.Parse(ThisMob[1]), short.Parse(ThisMob[4]), (byte)General.Rand.Next(8), byte.Parse(ThisMob[5]));
Any ideas? I have attached the file for you to review.