Code:
[COLOR="Red"]public static void DonationReset()[/COLOR]
{
foreach (string Path in [COLOR="red"]Directory.GetFiles(@"C:\OldCODB\Users\Characters\"))[/COLOR]
{
if (Path.Remove(0, Path.Length - 4) == ".chr")
{
try
{
string Name = Path.Substring(Path.LastIndexOf("\\") + 1, Path.LastIndexOf('.') - Path.LastIndexOf("\\") - 1);
Game.Character C;
C = Game.World.CharacterFromName2(Name);
if (C == null)
{
string Account = "";
C = LoadCharacter(Name, ref Account);
if (C != null)
{
C.Nobility.Donation = 0;
SaveCharacter(C, Account);
}
}
else
{
C.Nobility.Donation = 0;
}
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
}
}
}






