the error is:
Code:
Input string was not in a correct format.
the last edits I made were in Database.cs where I changed and added some things such as Mobs and MobSpawns aswell as NPCs and NPC actions.
here are some of the things I added feel free to check for the correct/incorrect formats:
Code:
public static void LoadActions()
{
MySqlCommand cmd = new MySqlCommand("SELECT * FROM `actions`", DatabaseConnection.NewConnection());
MySqlDataReader DR = cmd.ExecuteReader(CommandBehavior.CloseConnection);
while (DR.Read())
{
Struct.Actions A = new Struct.Actions();
A.ID = Convert.ToInt32("id");
A.IDNext = Convert.ToInt32("id_next");
A.IDNextFail = Convert.ToInt32("id_nextfail");
A.Type = Convert.ToInt32("type");
A.Data = Convert.ToInt32("data");
A.Param = Convert.ToString("param");
if (!Nano.NpcActions.ContainsKey(A.ID))
Nano.NpcActions.Add(A.ID, A);
}
Console.WriteLine("[WorldServer] Loaded " + Nano.NpcActions.Count + " Npc Actions into the World.");
}
public static void LoadMonsters()
{
MySqlCommand cmd = new MySqlCommand("SELECT * FROM `monsters` ", DatabaseConnection.NewConnection());
MySqlDataReader DR = cmd.ExecuteReader(CommandBehavior.CloseConnection);
while (DR.Read())
{
Struct.MonsterInfo MI = new Struct.MonsterInfo();
MI.ViewDistance = Convert.ToInt32("jrange");
MI.AttackRange = Convert.ToInt32("arange");
MI.AttackSpeed = Convert.ToInt32("attack_speed");
MI.Defense = Convert.ToInt32("pdef");
MI.Dodge = Convert.ToInt32("dodge");
MI.ID = Convert.ToInt32("id");
MI.Level = Convert.ToInt32("level");
MI.MagicID = Convert.ToInt32("atype");
MI.MaxAttack = Convert.ToInt32("atkmax");
MI.MaxHP = Convert.ToInt32("hp");
MI.MDefense = Convert.ToInt32("mdef");
MI.Mesh = Convert.ToInt32("mech");
MI.MinAttack = Convert.ToInt32("atkmin");
MI.Name = Convert.ToString("name");
MI.Speed = Convert.ToInt32("speed");
MI.MinSilvers = Convert.ToInt32("avgmoney");
MI.MaxSilvers = Convert.ToInt32("drop_money");
MI.DropItemType = Convert.ToInt32("drop_itemtype");
MI.DropChance = Convert.ToDouble("drop_chance");
if (!Nano.MonsterTypes.ContainsKey(MI.ID))
{
Nano.MonsterTypes.Add(MI.ID, MI);
}
}
Console.WriteLine("[WorldServer] Loaded " + Nano.MonsterTypes.Count + " Monster Types into the World.");
}
public static void LoadMonsterSpawns()
{
MySqlCommand cmd = new MySqlCommand("SELECT * FROM `mobspawns` ", DatabaseConnection.NewConnection());
MySqlDataReader DR = cmd.ExecuteReader(CommandBehavior.CloseConnection);
int TotalSpawns = 0;
while (DR.Read())
{
MonsterSpawn MS = new MonsterSpawn();
MS.Map = Convert.ToInt32("Map");
MS.MobID = Convert.ToInt32("ID");
MS.SpawnID = Convert.ToInt32("UniSpawnID");
MS.SpawnNumber = Convert.ToInt32("NumberToSpawnf");
if (MS.Map == 1015)
MS.SpawnNumber = Convert.ToInt32("NumberToSpawnf");
MS.MaxSpawnNumber = MS.SpawnNumber * 2;
if (MS.Map == 1015)
MS.MaxSpawnNumber = MS.SpawnNumber;
if (MS.MobID >= 900 && MS.MobID <= 912)
{
MS.SpawnNumber = 1;
MS.MaxSpawnNumber = 1;
}
TotalSpawns += MS.SpawnNumber;
MS.X = Convert.ToInt32("x-start");
MS.XStop = Convert.ToInt32("x-stop");
MS.Y = Convert.ToInt32("y-start");
MS.YStop = Convert.ToInt32("y-stop");
MS.RespawnInterval = Convert.ToInt32("rest_secs");
if (!Nano.MonsterSpawns.ContainsKey(MS.SpawnID))
{
Nano.MonsterSpawns.Add(MS.SpawnID, MS);
}
}
Console.WriteLine("[WorldServer] Loaded " + Nano.MonsterSpawns.Count + " unique monster spawns.");
Console.WriteLine("[WorldServer] Will theoretically spawn " + TotalSpawns + " monsters into the world.");
}
public static void LoadNpcs()
{
MySqlCommand cmd = new MySqlCommand("SELECT * FROM `npcs` ", DatabaseConnection.NewConnection());
MySqlDataReader DR = cmd.ExecuteReader(CommandBehavior.CloseConnection);
while (DR.Read())
{
Struct.NPC NPC = new Struct.NPC();
NPC.ID = Convert.ToInt32("id");
NPC.OwnerID = Convert.ToInt32("ownerid");
NPC.PlayerID = Convert.ToInt32("playerid");
NPC.Name = Convert.ToString("name");
NPC.Type = Convert.ToInt32("type");
NPC.LookFace = Convert.ToInt32("lookface");
NPC.Map = Convert.ToInt32("mapid");
NPC.X = Convert.ToInt32("cellx");
NPC.Y = Convert.ToInt32("celly");
NPC.Task0 = Convert.ToInt32("task0");
NPC.Task1 = Convert.ToInt32("task1");
NPC.Task2 = Convert.ToInt32("task2");
NPC.Task3 = Convert.ToInt32("task3");
NPC.Task4 = Convert.ToInt32("task4");
NPC.Task5 = Convert.ToInt32("task5");
NPC.Task6 = Convert.ToInt32("task6");
NPC.Task7 = Convert.ToInt32("task7");
NPC.Data0 = Convert.ToInt32("data0");
NPC.Data1 = Convert.ToInt32("data1");
NPC.Data2 = Convert.ToInt32("data2");
NPC.Data3 = Convert.ToInt32("data3");
NPC.DataString = Convert.ToString("datastr");
NPC.LinkID = Convert.ToInt32("linkid");
NPC.Life = Convert.ToInt32("life");
NPC.MaxLife = Convert.ToInt32("maxlife");
NPC.Base = Convert.ToInt32("base");
NPC.Sort = Convert.ToInt32("sort");
NPC.ItemID = Convert.ToInt32("itemid");
if (!Nano.Npcs.ContainsKey(NPC.ID))
Nano.Npcs.Add(NPC.ID, NPC);
}
Console.WriteLine("[WorldServer] Loaded " + Nano.Npcs.Count + " Npcs into the World.");
}






