public void loadMobs(string path)
{
// This is just an example of loading CSV
//return dataTable;
Output.Write("Loading Hostile Mobs ..");
ArrayList goDB = loadCSV(path, ';');
int linecount = 1;
foreach (string[] data in goDB)
{
//Output.WriteLine("Show Colums for Line : " + linecount.ToString() + " GOID: " + data[1].ToString() + " Name " + data[0].ToString());
if (linecount > 1)
{
UInt64 currentEntityId = WorldSocket.entityIdCounter;
WorldSocket.entityIdCounter++;
uint rotation = 0;
if (data[10].Length > 0)
{
rotation = uint.Parse(data[10]);
}
if (data[4].Length > 0 && data[5].Length > 0)
{
npc theMob = new npc();
theMob.setEntityId(currentEntityId);
theMob.setDistrict(Convert.ToUInt16(data[0]));
theMob.setDistrictName(data[1]);
theMob.setName(data[2]);
theMob.setLevel(ushort.Parse(data[3]));
theMob.setHealthM(UInt16.Parse(data[4]));
theMob.setHealthC(UInt16.Parse(data[5]));
theMob.setMobId((ushort)linecount);
theMob.setRsiHex(data[6]);
theMob.setXPos(double.Parse(data[7]));
theMob.setYPos(double.Parse(data[8]));
theMob.setZPos(double.Parse(data[9]));
theMob.xBase = double.Parse(data[7]);
theMob.yBase = double.Parse(data[8]);
theMob.zBase = double.Parse(data[9]);
theMob.setRotation(rotation);
theMob.setIsDead(bool.Parse(data[11]));
theMob.setIsLootable(bool.Parse(data[12]));
WorldSocket.npcs.Add(theMob);
}
}
linecount++;
}
}