DonationReset

02/17/2010 21:25 5supertao#1
Would this be a cause of the Nobility Donations reseting?

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());
                    }
                }
            }
        }
02/17/2010 21:27 Kiyono#2
Can't you just open Nobility.dat and remove everything?
02/17/2010 21:38 ramix#3
Quote:
Originally Posted by 5supertao View Post
Would this be a cause of the Nobility Donations reseting?

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());
                    }
                }
            }
        }
that is for reset nobility rank in players... only... for exemple if u donate and do that command in console your player donation go to 0 but in game you have that donation you have putted... if you donate again will appear the same name in rank...

you need delete nobility.dat too... because that code is to reset nobility in characteres
02/17/2010 21:58 5supertao#4
No, what I mean is like... If I donate... and a few players donated to.. After a few restarts... I have to donate again... then TWO of my names show up..
02/17/2010 22:08 ramix#5
nope that is if you use the command to do reset...

you mean not save the nobility