Create entity question.

04/03/2014 22:52 denominator#1
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?
04/03/2014 23:25 GameHackerPM#2
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!
04/03/2014 23:48 denominator#3
Thank you I was looking in the source rather than the database lol
04/04/2014 00:33 Aceking#4
That hurt my eyes....
Glad you got it fixed though
04/04/2014 12:23 Y u k i#5
[Only registered and activated users can see links. Click Here To Register...]

I'd structurize that code a little more. Work in progress^