Thnx for the reply xD
I got this in GameClient:
public Dictionary<ushort, ISkill> m_Profs = new Dictionary<ushort, ISkill>(50);
public ISkill[] Profs;
When i use the command @prof 480 5 it says: [Command Error] Object reference not set to an instance of an object.
Do you know what I did wrong? :P
This is what I got for saving and loading (i watched how SaveInventory and LoadInventory was done I added SaveProf(Client); under SaveInventory in the SaveCharacter method and i also put LoadProf(Client); under LoadInventory in the LoadCharacter method.Quote:
public static void SaveProf(GameClient Client)
{
IniFile wrtr = new IniFile(DatabasePath + @"\Profs\" + Client.Username + ".ini");
sbyte i = 0;
foreach (ISkill Prof in Client.Profs)
{
wrtr.Write("Proficiencys", "Prof[" + i.ToString() + "]", Prof.ToString());
i++;
}
wrtr.Write("Proficiencys", "Count", i.ToString());
}
private static void LoadProf(GameClient Client)
{
IniFile rdr = new IniFile(DatabasePath + @"\Profs\" + Client.Username + ".ini");
sbyte count = rdr.ReadSByte("Proficiencys", "Count", 0);
for (sbyte i = 0; i < count; i++)
{
string[] Prof = (rdr.ReadString("Proficiencys", "Prof[" + i.ToString() + "]", String.Empty)).Split(' ');
ProfPacket LoadedProf = new ProfPacket(true);
LoadedProf.ID = ushort.Parse(Prof[0]);
LoadedProf.Level = ushort.Parse(Prof[1]);
LoadedProf.Experience = uint.Parse(Prof[2]);
Client.LearnProf(LoadedProf);
}
}
I got this in GameClient:
public Dictionary<ushort, ISkill> m_Profs = new Dictionary<ushort, ISkill>(50);
public ISkill[] Profs;
When i use the command @prof 480 5 it says: [Command Error] Object reference not set to an instance of an object.
Do you know what I did wrong? :P