Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 00:53

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Character settings for 5165

Discussion on Character settings for 5165 within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Feb 2009
Posts: 700
Received Thanks: 79
Post Character settings for 5165

This is why I like use Navicat for mySql better lol.. how can I make it so that when a new char is made and he logs in he will have, let's say 50 cps?
copz1337 is offline  
Old 02/14/2010, 22:12   #2
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,765
Received Thanks: 5,291
Quote:
Originally Posted by copz1337 View Post
This is why I like use Navicat for mySql better lol.. how can I make it so that when a new char is made and he logs in he will have, let's say 50 cps?
Go to the createchar place in database.cs and make the default cps amount 50.
Code:
        public static string CreateCharacter(string Account, string Name, ushort Body, byte Job)
        {
            try
            {
                if (File.Exists(@"C:\OldCODB\Users\" + Account + ".usr") && !File.Exists(@"C:\OldCODB\Users\Characters\" + Name + ".chr"))
                {
                    try
                    {
                        FileStream FS = new FileStream(@"C:\OldCODB\Users\Characters\" + Name + ".chr", FileMode.CreateNew);
                        BinaryWriter BW = new BinaryWriter(FS);
                        BW.Write(Account);
                        BW.Write((uint)Program.Rnd.Next(1000001, 19999999));

                        if (Body == 1003 || Body == 1004)
                            BW.Write((ushort)1);//Avatar
                        else
                            BW.Write((ushort)201);//Avatar

                        BW.Write(Body);
                        BW.Write((ushort)(410 + (Program.Rnd.Next(5) * 100)));//Hair
                        BW.Write((ushort)1010);//Map
                        BW.Write((ushort)61);//X
                        BW.Write((ushort)109);//Y
                        BW.Write((ushort)0);//Previous Map
                        BW.Write(Job);
                        BW.Write((byte)0);//Previous Job, 1st RB
                        BW.Write((byte)1);//Level
                        BW.Write((ulong)0);//Experience

                        ushort Str = 0,Agi = 0, Vit = 0, Spi = 0;
                        GetInitialStats(Job, ref Str, ref Agi, ref Vit, ref Spi);

                        BW.Write(Str);
                        BW.Write(Agi);
                        BW.Write(Vit);
                        BW.Write(Spi);
                        BW.Write((ushort)0);//Stat Points
                        ushort HP = (ushort)(Vit * 24 + Str * 3 + Agi * 3 + Spi * 3);
                        BW.Write(HP);
                        BW.Write((ushort)(Spi * 5));//MP
                        BW.Write((ulong)0);//Donation
                        BW.Write((uint)100);//Silvers
[SIZE="5"][COLOR="Red"][B][I][U]                        BW.Write((uint)0);//CPs[/U][/I][/B][/COLOR][/SIZE]
                        BW.Write((uint)0);//Warehouse Silvers
                        BW.Write((ulong)0);//Virtue Points
                        BW.Write((ushort)0);//PK Points
                        BW.Write((ushort)0);//Guild
                        BW.Write((uint)0);//Guild Donation
                        BW.Write((byte)0);//Guild Rank
                        Game.Equipment Eq = new NewestCOServer.Game.Equipment();
                        Eq.Open();
                        Eq.WriteThis(BW);
                        BW.Write((byte)5);//Inventory Count
                        #region Beginner Items
                        if (Job == 100)
                        {
                            Game.Item I = new NewestCOServer.Game.Item();
                            I.ID = 421301;
                            I.MaxDur = ((DatabaseItem)DatabaseItems[(uint)421301]).Durability;
                            I.CurDur = I.MaxDur;
                            I.UID = (uint)Program.Rnd.Next(10000000);
                            I.WriteThis(BW);
                        }
                        else if (Job == 50)
                        {
                            Game.Item I = new NewestCOServer.Game.Item();
                            I.ID = 601301;
                            I.MaxDur = ((DatabaseItem)DatabaseItems[(uint)601301]).Durability;
                            I.CurDur = I.MaxDur;
                            I.UID = (uint)Program.Rnd.Next(10000000);
                            I.WriteThis(BW);
                        }
                        else
                        {
                            Game.Item I = new NewestCOServer.Game.Item();
                            I.ID = 410301;
                            I.MaxDur = ((DatabaseItem)DatabaseItems[(uint)410301]).Durability;
                            I.CurDur = I.MaxDur;
                            I.UID = (uint)Program.Rnd.Next(10000000);
                            I.WriteThis(BW);
                        }
                        Game.Item Armor = new NewestCOServer.Game.Item();
                        Armor.ID = 132004;
                        Armor.Color = (Game.Item.ArmorColor)(Program.Rnd.Next(3, 9));
                        Armor.MaxDur = ((DatabaseItem)DatabaseItems[(uint)132004]).Durability;
                        Armor.CurDur = Armor.MaxDur;
                        Armor.UID = (uint)Program.Rnd.Next(10000000);
                        Armor.WriteThis(BW);
                        Game.Item Stancher = new NewestCOServer.Game.Item();
                        Stancher.ID = 1000000;
                        Stancher.UID = (uint)Program.Rnd.Next(10000000);
                        Stancher.WriteThis(BW);
                        Stancher.UID = (uint)Program.Rnd.Next(10000000);
                        Stancher.WriteThis(BW);
                        Stancher.UID = (uint)Program.Rnd.Next(10000000);
                        Stancher.WriteThis(BW);
                        #endregion
                        for (int n = 0; n < 5; n++)
                        {
                            BW.Write((byte)0);//WH[n] Count
                            //Warehouse[n]
                        }
                        BW.Write((byte)0);//WH[5] Count
                        //Warehouse[5]

                        BW.Write((byte)0);//Prof Count

                        if (Job != 100)
                            BW.Write((byte)0);//SkillCount
                        else
                        {
                            BW.Write((byte)2);//SkillCount
                            Game.Skill S = new Game.Skill() { ID = 1000 };
                            S.WriteThis(BW);
                            S = new Game.Skill() { ID = 1005 };
                            S.WriteThis(BW);
                        }

                        BW.Write((byte)0);//Friend Count
                        BW.Write((byte)0);//Enemy Count
                        

                        BW.Write(false);
                        BW.Write((int)0);
                        BW.Write((int)0);
                        BW.Write((long)0);
                        BW.Write((int)0);
                        BW.Write((byte)0);
                        BW.Write((byte)0);
                        BW.Write((byte)1);//Merchant
                        BW.Write(0);//  
                        BW.Write(DateTime.Now.Ticks);
                        BW.Write((ushort)0);
                        BW.Write(false);
                        BW.Write((byte)0);//lottery uses today
                        BW.Write("0");//WH Pass
                        BW.Write("None");//Spouse Name
                        BW.Write((uint)0);//Quiz Pts       
                        BW.Write((int)0);//TopEffect
                        BW.Write(false);//ClaimGW
                        BW.Flush();
                        FS.Flush();

                        BW.Close();
                        FS.Close();
                        FS = new FileStream(@"C:\OldCODB\Users\" + Account + ".usr", FileMode.Append);
                        BW = new BinaryWriter(FS);
                        BW.Write((byte)Name.Length);
                        BW.Write(Encoding.ASCII.GetBytes(Name));
                        BW.Flush();
                        FS.Flush();
                        BW.Close();
                        FS.Close();
                        Game.Character C = LoadCharacter(Name, ref Account);
                        if (C != null)
                        {
                            C.UniversityPoints = 0;
                            SaveCharacter(C, Account);
                        }
                    }
                    catch { return "Error! Try again."; }
                    return "ANSWER_OK";
                }
                return "Error: Character already exists!";

            }
            catch (Exception Exc) { Console.WriteLine(Exc); return "Failed to create the character."; }
        }
    }
Arcо is offline  
Thanks
2 Users
Old 02/14/2010, 22:55   #3
 
elite*gold: 0
Join Date: Feb 2009
Posts: 700
Received Thanks: 79
Thanks Arco.
copz1337 is offline  
Old 02/15/2010, 04:15   #4
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,765
Received Thanks: 5,291
Np, anytime you need help, don't hesitate to pm me.
Arcо is offline  
Reply


Similar Threads Similar Threads
[Release] Delete Character 5165
08/06/2010 - CO2 PServer Guides & Releases - 20 Replies
Not sure if this has been released or not but here it is First of add this to PacketHandler.cs in case 10010: case 95: //Delete Character { GC.Disconnect(); Database.DeleteCharacter(GC.MyChar.Name); break; }
5165 Character creation problem
07/30/2010 - CO2 Private Server - 10 Replies
when i create a new account using /newacc test test and log in with it the character has like 100+ rbs and it increases every character i make can anyone help?
Change character name 5165
05/22/2010 - CO2 Private Server - 25 Replies
Does anybody know how i can delete and change character names in the 5165 client? thanks :)
5165 Source Character Creation error...
03/09/2010 - CO2 Private Server - 13 Replies
Ok so I now get this error saying "Error! Please try again" when a person wants to create his/her character, and therefore cannot create it...I need help on dis since it happened recently and I've hadn't much time to fix my source lately... help would be greatly appreciated!
5165 character creating problem.
01/01/2010 - CO2 Private Server - 0 Replies
Ok, so, recently i made my server online,its just for fun, nothing big or stuff like that,but, appearantly the other ppl got a problem. After they create an account on site, they log in, create the character, and you get dc after you create it, as we all know, but, when they relog to play, they are sent back to character creation,but when i make an account from cmd window, it works fine. so pls a little help , Thank you very much!



All times are GMT +2. The time now is 00:53.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.