[Error] Prof EXP

06/27/2022 07:00 Soulfly25#1
Hello,

Does anyone know what is the error here shown in the picture?
[Only registered and activated users can see links. Click Here To Register...]

I used this Experience Pts used in client
Code:
 private static uint[] ExpPTs = new uint[21] { 0, 1200, 68000, 250000, 640000, 1600000, 4000000, 10000000, 22000000, 40000000, 90000000, 95000000, 142500000, 213750000, 320625000, 480937500, 721406250, 1082109375, 1623164063, 2100000000, 0 };
Yet, still this give me an error.

What could be the reason why I get this exp?
06/27/2022 13:45 ConquerFiles#2
WeaponSkillLevelExp.ini < Make sure the values in your source match the ones here.
Once you are sure, you need to add +1 level when it reaches 100 exp. I guess you don't do this checking on source and it just keeps going.
06/27/2022 14:01 Soulfly25#3
Quote:
Originally Posted by ConquerFiles View Post
WeaponSkillLevelExp.ini < Make sure the values in your source match the ones here.
Once you are sure, you need to add +1 level when it reaches 100 exp. I guess you don't do this checking on source and it just keeps going.
Thank you for a quick reply, Yes source exp and the client side exp pts (WeaponSkillLevelEXP.ini) is match to what I have it.

Also I added prof.Level++; when the exp reached 100%

Quote:
1,0
2,1200
3,68000
4,250000
5,640000
6,1600000
7,4000000
8,10000000
9,22000000
10,40000000
11,90000000
12,95000000
13,142500000
14,213750000
15,320625000
16,480937500
17,721406250
18,1082109375
19,1623164063
20,2100000000
06/27/2022 15:32 ConquerFiles#4
prof.Level++; < Can you share your codes about this place, I think you may have a small mistake somewhere.
06/27/2022 15:44 Soulfly25#5
Quote:
Originally Posted by ConquerFiles View Post
prof.Level++; < Can you share your codes about this place, I think you may have a small mistake somewhere.
Here is the code for the profiency,

Code:
private static uint[] proficiencyLevelExperience = new uint[21] { 0, 1200, 68000, 250000, 640000, 1600000, 4000000, 10000000, 22000000, 40000000, 90000000, 95000000, 142500000, 213750000, 320625000, 480937500, 721406250, 1082109375, 1623164063, 2100000000, 0 };

        public static uint ProficiencyLevelExperience(byte Level)
        {
            return proficiencyLevelExperience[Math.Min(Level, (byte)20)];
        }

        public ConcurrentDictionary<uint, Game.MsgServer.MsgProficiency> ClientProf = new ConcurrentDictionary<uint, Game.MsgServer.MsgProficiency>();

        private Client.GameClient Owner;

        public Proficiency(Client.GameClient _own)
        {
            Owner = _own;
        }
        public bool CheckProf(ushort ID, byte level)
        {
            Game.MsgServer.MsgProficiency prof;
            if (ClientProf.TryGetValue(ID, out prof))
            {
                return prof.Level >= level;
            }
            return false;
        }
        public unsafe void Add(ServerSockets.Packet stream, uint ID, uint Level = 0, uint Experience = 0, byte PreviousLevel = 0, bool ClearExp = false)
        {
            Game.MsgServer.MsgProficiency prof;
            if (ClientProf.TryGetValue(ID, out prof))
            {
                prof.UID = Owner.Player.UID;
                prof.Level = Level;
                prof.Experience = Experience;
                prof.PreviouseLevel = PreviousLevel;
                if (prof.Level == 20 || ClearExp)
                    prof.Experience = 0;
            }
            else
            {
                prof = new MsgProficiency();
                prof.ID = ID;
                prof.UID = Owner.Player.UID;
                prof.Level = Level;
                prof.Experience = Experience;
                if (prof.Level == 20 || ClearExp)
                    prof.Experience = 0;
                prof.PreviouseLevel = PreviousLevel;
                ClientProf.TryAdd(prof.ID, prof);
            }
            Owner.Send(stream.ProficiencyCreate(prof.ID, prof.Level, prof.Experience, Owner.Player.UID));
            UpdSpell(prof.ID, prof.Level, prof.Experience, stream);
        }
        private unsafe void UpdSpell(uint ID, uint level, uint Experience, ServerSockets.Packet stream)
        {
            Owner.Send(stream.ProficiencyCreate(ID, level, Experience, Owner.Player.UID));

           // Owner.Send(stream.UpdateProfExperienceCreate(Experience, Owner.Player.UID, ID));
        }
        public unsafe void CheckUpdate(uint ID, uint GetExperience, ServerSockets.Packet stream)
        {
            if (GetExperience == 0)
                return;
            //if (ID == 1050)
            //    return;
            if (Enum.IsDefined(typeof(Database.MagicType.WeaponsType), (Database.MagicType.WeaponsType)ID))
            {
                Game.MsgServer.MsgProficiency prof;
                if (ClientProf.TryGetValue(ID, out prof))
                {
                    if (prof.Level < 20)
                    {
                        //if (Owner.Player.Map == 1039 && GetExperience >= 10000)
                        //    GetExperience /= 40;
                        //uint nRatio = (uint)(100 - (prof.Level - 12) * 20);//*20
                        //if (nRatio < 10)
                        //    nRatio = 10;
                        if (prof.Level < 4)
                        {
                            GetExperience *= 100;
                        }
                        else if (prof.Level > 13)
                        {
                            GetExperience /= (uint)(prof.Level + 30);
                        }
                        else
                        {
                            GetExperience /= (uint)(prof.Level + 1);
                        }

                        //GetExperience = Role.Core.MulDiv(GetExperience, nRatio, 100) / 2;
                        prof.Experience += GetExperience * Program.ServerConfig.ExpRateProf;

                        bool leveled = false;

                        while (prof.Experience >= ProficiencyLevelExperience((byte)prof.Level))
                        {
                            prof.Experience -= ProficiencyLevelExperience((byte)prof.Level);
                            prof.Level++;

                            if (prof.Level == 20)
                            {
                                prof.Experience = 0;
                                Owner.Send(stream.ProficiencyCreate(prof.ID, prof.Level, prof.Experience, Owner.Player.UID));
                                Owner.SendSysMesage("You have just leveled your proficiency.", Game.MsgServer.MsgMessage.ChatMode.System);
                                UpdSpell(prof.ID, prof.Level, prof.Experience, stream);
                                return;
                            }
                            leveled = true;
                            Owner.SendSysMesage("You have just leveled your proficiency.", Game.MsgServer.MsgMessage.ChatMode.System);
                            if (prof.PreviouseLevel != 0)
                            {
                                if (prof.Level >= prof.PreviouseLevel / 2 && prof.Level < prof.PreviouseLevel)
                                {
                                    prof.Level = prof.PreviouseLevel;
                                    prof.Experience = 0;
                                }
                            }
                        }
                        if (leveled)
                        {
                            Owner.Send(stream.ProficiencyCreate(prof.ID, prof.Level, prof.Experience, Owner.Player.UID));
                        }
                        UpdSpell(prof.ID, prof.Level, prof.Experience, stream);


                    }
                }
                else
                {
                    Add(stream, ID);
                }
            }
        }
        public unsafe void SendAll(ServerSockets.Packet stream)
        {
            foreach (var prof in ClientProf.Values)
                Owner.Send(stream.ProficiencyCreate(prof.ID, prof.Level, prof.Experience, Owner.Player.UID));
        }
06/27/2022 20:04 ConquerFiles#6
if (prof.Level >= prof.PreviouseLevel / 2 && prof.Level < prof.PreviouseLevel)

I think your problem comes from here.
For example : After you levelup from 8 to 9 your prof.level = 9 and PreviouseLevel 8

its will not work like this 9 < 8

if you can't, give your discord account, let me check with teamviewer

and why are you returning your prof level to its old level here?
prof.Level = prof.PreviouseLevel;
06/28/2022 13:58 Soulfly25#7
Quote:
Originally Posted by ConquerFiles View Post
if (prof.Level >= prof.PreviouseLevel / 2 && prof.Level < prof.PreviouseLevel)

I think your problem comes from here.
For example : After you levelup from 8 to 9 your prof.level = 9 and PreviouseLevel 8

its will not work like this 9 < 8

if you can't, give your discord account, let me check with teamviewer

and why are you returning your prof level to its old level here?
prof.Level = prof.PreviouseLevel;

Thank you for this suggestion,
I found out that the ProfEXP is set to 1,000,000 until prof level 20. It seems like it's on a client side but don't know which should I start.
06/28/2022 19:33 thisismyaccountokay#8
What patch version are you on?
06/28/2022 21:35 Soulfly25#9
Quote:
Originally Posted by thisismyaccountokay View Post
What patch version are you on?
Version 5517
06/29/2022 22:20 teroareboss1#10
If I don't wrong, you need to send the packet 1104 when you receive experience.

Code:
 public static Packet UpdateProfExperienceCreate(this Packet stream, uint experience, uint uid, uint id)
        {
            stream.InitWriter();

            stream.Write(experience);
            stream.Write(uid);
            stream.Write(id);
            stream.ZeroFill(8);//unknow

            stream.Finalize(GamePackets.UpgradeSpellExperience);
            return stream;
        }
The problem is here:
Code:
while (prof.Experience >= ProficiencyLevelExperience((byte)prof.Level))

Use here a constant like:

Code:
public const uint MaxExperience = 1000000;

while (prof.Experience >= MaxExperience){

prof.Experience -= MaxExperience;
prof.Level++;

if (prof.Level == 20)
                            {
                                prof.Experience = 0;
                                Owner.Send(stream.ProficiencyCreate(prof.ID, prof.Level, prof.Experience, Owner.Player.UID));
                                Owner.SendSysMesage("You have just leveled your proficiency.", Game.MsgServer.MsgMessage.ChatMode.System);
                                UpdSpell(prof.ID, prof.Level, prof.Experience, stream);
                                return;
                            }

... bla bla bla
}
06/30/2022 01:14 ConquerFiles#11
Update packet was wrong. Your method was correct and I added it for him. Its working for him now.

Quote:
Originally Posted by teroareboss1 View Post
If I don't wrong, you need to send the packet 1104 when you receive experience.

Code:
 public static Packet UpdateProfExperienceCreate(this Packet stream, uint experience, uint uid, uint id)
        {
            stream.InitWriter();

            stream.Write(experience);
            stream.Write(uid);
            stream.Write(id);
            stream.ZeroFill(8);//unknow

            stream.Finalize(GamePackets.UpgradeSpellExperience);
            return stream;
        }
The problem is here:
Code:
while (prof.Experience >= ProficiencyLevelExperience((byte)prof.Level))

Use here a constant like:

Code:
public const uint MaxExperience = 1000000;

while (prof.Experience >= MaxExperience){

prof.Experience -= MaxExperience;
prof.Level++;

if (prof.Level == 20)
                            {
                                prof.Experience = 0;
                                Owner.Send(stream.ProficiencyCreate(prof.ID, prof.Level, prof.Experience, Owner.Player.UID));
                                Owner.SendSysMesage("You have just leveled your proficiency.", Game.MsgServer.MsgMessage.ChatMode.System);
                                UpdSpell(prof.ID, prof.Level, prof.Experience, stream);
                                return;
                            }

... bla bla bla
}
06/30/2022 14:21 Soulfly25#12
Quote:
Originally Posted by teroareboss1 View Post
If I don't wrong, you need to send the packet 1104 when you receive experience.

Code:
 public static Packet UpdateProfExperienceCreate(this Packet stream, uint experience, uint uid, uint id)
        {
            stream.InitWriter();

            stream.Write(experience);
            stream.Write(uid);
            stream.Write(id);
            stream.ZeroFill(8);//unknow

            stream.Finalize(GamePackets.UpgradeSpellExperience);
            return stream;
        }
The problem is here:
Code:
while (prof.Experience >= ProficiencyLevelExperience((byte)prof.Level))

Use here a constant like:

Code:
public const uint MaxExperience = 1000000;

while (prof.Experience >= MaxExperience){

prof.Experience -= MaxExperience;
prof.Level++;

if (prof.Level == 20)
                            {
                                prof.Experience = 0;
                                Owner.Send(stream.ProficiencyCreate(prof.ID, prof.Level, prof.Experience, Owner.Player.UID));
                                Owner.SendSysMesage("You have just leveled your proficiency.", Game.MsgServer.MsgMessage.ChatMode.System);
                                UpdSpell(prof.ID, prof.Level, prof.Experience, stream);
                                return;
                            }

... bla bla bla
}
Yes, This is correct, This is the code which is already in the source. I am working on a new way to not just set the weapon prof experience to 1000000 exp pts. I want to set the prof experience pts to what in the client side is which is:

I think this is a client side from conquer.exe which @[Only registered and activated users can see links. Click Here To Register...] help me trace the error. which now my problem is where to start which I don't know how to work on exe files.

Code:
1,0
2,1200
3,68000 
4,250000 
5,640000 
6,1600000 
7,4000000 
8,10000000 
9,22000000 
10,40000000  
11,90000000  
12,95000000  
13,142500000 
14,213750000 
15,320625000 
16,480937500 
17,721406250  
18,1082109375 
19,1623164063 
20,2100000000
06/30/2022 14:27 ConquerFiles#13
No no, you don't need to do anything. This problem existed because your update packet was wrong. Already working with those experince rates.
07/01/2022 17:09 Soulfly25#14
Quote:
Originally Posted by ConquerFiles View Post
No no, you don't need to do anything. This problem existed because your update packet was wrong. Already working with those experince rates.
Yeah, Thank you for the help. The one we fixed earlier is already in the source at the first place, which is set to Max Experience 1M Exp Pts. I just edit to look like the experience pts from the client but it seems like you said the error is in the Conquer.exe which the weapon exp prof is set to 1,000,000 to all prof level.
07/01/2022 17:23 thisismyaccountokay#15
In 5517 I think they made packet 1104 MsgFlushExp obselete and instead you need to send the required maximum level as part of the MsgWeaponSkill (1025) packet at offset 16.

[Only registered and activated users can see links. Click Here To Register...]

Double check if you're doing that or feel free to post the snippet of the packet here if you haven't already.