Register for your free account! | Forgot your password?

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

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

Advertisement



Create entity question.

Discussion on Create entity question. within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Aug 2010
Posts: 940
Received Thanks: 76
Create entity question.

So I have been looking through a source 5670 and I find that new characters are VIP 6 straight away, simple I'll just edit the code. I attempted to add something thinking it might do what I was intending but it did nothing and the newly created character is STILL VIP 6 o.O Anyway the code is here

Code:
public static bool CreateEntity(Network.GamePackets.EnitityCreate eC, Client.GameState client, ref string message)
        {
            if (eC.Name.Length > 16)
                eC.Name = eC.Name.Substring(0, 16);
            if (eC.Name == "")
                return false;

            if (InvalidCharacters(eC.Name))
            {
                message = "Invalid characters inside the name.";
                return false;
            }
            var rdr = new MySqlReader(new MySqlCommand(MySqlCommandType.SELECT).Select("entities").Where("name", eC.Name));
            if (rdr.Read()) {
                rdr.Close();
                message = "The chosen name is already in use.";
                return false;
            }
            rdr.Close();
            client.Entity = new Game.Entity(Game.EntityFlag.Player, false);
            client.Entity.Name = eC.Name;
            DataHolder.GetStats(eC.Class, 1, client);
            client.Entity.UID = Program.EntityUID.Next;
            new MySqlCommand(MySqlCommandType.UPDATE).Update("configuration").Set("EntityID", client.Entity.UID).Where("Server", ServerBase.Constants.ServerName).Execute();
            client.CalculateStatBonus();
            client.CalculateHPBonus();
            client.VIPDays = 0; <<---I added this but it did nothing anyway as I expected lol.
            new MySqlCommand(MySqlCommandType.INSERT)
                .Update("LotteryIn")
                .Insert("UID", client.Entity.UID)
                .Insert("Name", client.Entity.Name)
                .Execute();
            new MySqlCommand(MySqlCommandType.INSERT)
              .Update("top2")
              .Insert("UID", client.Entity.UID)
                .Insert("TopTrojan2", 0)
                .Insert("TopWarrior2", 0)
                .Insert("TopPirate2", 0)
                .Insert("TopMonk2", 0)
                .Insert("TopNinja2", 0)
                .Insert("TopWaterTaoist2", 0)
                .Insert("TopArcher2", 0)
                .Insert("TopFireTaoist2", 0)
              .Insert("Name", client.Entity.Name)
              .Execute();
            new MySqlCommand(MySqlCommandType.INSERT)
            .Update("top1")
            .Insert("UID", client.Entity.UID)
              .Insert("TopTrojan", 0)
              .Insert("TopWarrior", 0)
              .Insert("TopPirate", 0)
              .Insert("TopMonk", 0)
              .Insert("TopNinja", 0)
              .Insert("TopWaterTaoist", 0)
              .Insert("TopArcher", 0)
              .Insert("TopFireTaoist", 0)
            .Insert("Name", client.Entity.Name)
            .Execute();
            new MySqlCommand(MySqlCommandType.INSERT)
          .Update("top3")
          .Insert("UID", client.Entity.UID)
            .Insert("TopGuildLeader", 0)
            .Insert("TopDeputyLeader", 0)
            .Insert("WeeklyPKChampion", 0)
            .Insert("MonthlyPK", 0)
          .Insert("Name", client.Entity.Name)
          .Execute();
            client.Entity.Hitpoints = client.Entity.MaxHitpoints;
            client.Entity.Mana = (ushort)(client.Entity.Spirit * 5);
            client.Entity.Class = eC.Class;
            client.Entity.Body = eC.Body;
            if (eC.Body == 1003 || eC.Body == 1004)
                client.Entity.Face = (ushort)ServerBase.Kernel.Random.Next(1, 50);
            else
                client.Entity.Face = (ushort)ServerBase.Kernel.Random.Next(201, 250);
            byte Color = (byte)ServerBase.Kernel.Random.Next(4, 8);
            client.Entity.HairStyle = (ushort)(Color * 100 + 10 + (byte)ServerBase.Kernel.Random.Next(4, 9));
            client.Account.EntityID = client.Entity.UID;
            client.Account.Save();
            //723753

            MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
            cmd.Insert("entities").Insert("Name", eC.Name).Insert("Owner", client.Account.Username).Insert("Class", eC.Class).Insert("UID", client.Entity.UID)
                .Insert("Hitpoints", client.Entity.Hitpoints).Insert("Mana", client.Entity.Mana).Insert("Body", client.Entity.Body)
                .Insert("Face", client.Entity.Face).Insert("HairStyle", client.Entity.HairStyle).Insert("Strength", client.Entity.Strength)
                .Insert("Agility", client.Entity.Agility).Insert("Vitality", client.Entity.Vitality).Insert("Spirit", client.Entity.Spirit);

            cmd.Execute();
            message = "ANSWER_OK";

            return true;
        }
Basic question is how do I change the characters from starting with VIP 6 to VIP 1 or even 0?
denominator is offline  
Old 04/03/2014, 23:25   #2

 
GameHackerPM's Avatar
 
elite*gold: 153
Join Date: Mar 2011
Posts: 631
Received Thanks: 489
Well, it looks like that this is a 5165+ Source! Something like that true?!

Anyway, i think the problem maybe from the navicat itself. How to fix it or check if it's the problem?
Just on Entities table, Right click ---> Design Table ---> Go to the raw of VIP, and press on it ---> Check "Default Value" it should be 6 ---> Make it 0!

I hope it works!
GameHackerPM is offline  
Thanks
1 User
Old 04/03/2014, 23:48   #3
 
elite*gold: 0
Join Date: Aug 2010
Posts: 940
Received Thanks: 76
Thank you I was looking in the source rather than the database lol
denominator is offline  
Old 04/04/2014, 00:33   #4
 
elite*gold: 0
Join Date: Feb 2006
Posts: 726
Received Thanks: 271
That hurt my eyes....
Glad you got it fixed though
Aceking is offline  
Thanks
3 Users
Old 04/04/2014, 12:23   #5
 
elite*gold: 0
Join Date: May 2011
Posts: 648
Received Thanks: 413


I'd structurize that code a little more. Work in progress^
Y u k i is offline  
Reply


Similar Threads Similar Threads
Entity Create Thing.
05/21/2012 - CO2 Private Server - 8 Replies
Yesterday i was trying to disable creating ninja and monks in my server. I cant figure out how did they handle it in Classic Co . I am using impulse 5518+. Heres the image of what i mean. http://i45.tinypic.com/f9kpp3.jpg help would be apreciated. thanks in advance
Quick Entity Spawn Question
11/27/2011 - CO2 Private Server - 2 Replies
While working on my 5017 source. It seems like its treating my characters as a mob instead of a char. Showing green/black/white names accordingly, and not allowing me to view equips. Is there a certain flag that needs to be set in the spawn packet or? Any help is appreciated. Thanks a lot.
[Question] of Ch Create
06/30/2010 - Metin2 Private Server - 5 Replies
Ich frage sie, sich zu bewegen, um Raum zu korrigieren I ask them to move to correct area -------------------ENGLISH-------------------- It should not be in the correct zone but still I hope you will clarify. I wonder create CH 2 on my server, already researched did not find. If someone has a link to the tut please post. Thanks
[Question]How Can I Create a Dll......
10/21/2009 - Soldier Front Philippines - 2 Replies
Is Anyone Know How TO create a Dll...????
Question to = Create Proxy and NPC
07/04/2007 - Conquer Online 2 - 1 Replies
Can someone tell me how to create my own Proxy, because all proxy's are with hacks I heard someone said you can put NPC to everywhere u want. Can someone tell me how to do, and how to put items able to buy?



All times are GMT +2. The time now is 19:24.


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.