People cannot Level

07/18/2009 09:10 Arcotemple:)#1
people on my server cant level
i just recently came across this problem

they attack stuf they dont level
they use exp balls they dont level
any1 know what sup
07/18/2009 09:17 Incariuz#2
What source?
07/18/2009 09:23 Arcotemple:)#3
Quote:
Originally Posted by Incariuz View Post
What source?
lol 5017 look at my siggy
07/18/2009 09:28 CptSky#4
Check your AddExp fonction.
07/18/2009 09:31 Arcotemple:)#5
Quote:
Originally Posted by CptSky View Post
Check your AddExp fonction.
i did and i cant seem to figure out whats wrong with it
07/18/2009 09:34 Incariuz#6
If it's LOTF, it should work fine, unless you've tampered with it. On a side note though, I don't suggest trying to run a server off LOTF, simply use it to learn. You'll never hold more then 10-20 players, regardless how many bugs you fix. The entire source needs to e re-written in order to avoid DB data transfer issues.

Edit: On a side note though, if you tell me where it is in what file, I'll go through my old lotf source, and try and find a way to fix it.
07/18/2009 09:36 vhalang2009#7
works works works
07/18/2009 09:57 Arcotemple:)#8
Code:
        public bool AddExp(ulong Amount, bool CountMisc)
        {

            Ready = false;
            if (CountMisc)
                Exp += (ulong)(Amount * DataBase.ExpRate * AddExpPc * (Convert.ToDouble(Potency) / 100 + 1));
            else
                Exp += Amount;
            bool Leveled = false;

            if (Exp > DataBase.NeededXP(Level) && Level < 130)
            {
                Leveled = true;
                while (Exp > DataBase.NeededXP(Level) && Level < 130)
                {
                    Exp -= DataBase.NeededXP(Level);
                        ;
                    if (Level == 3)
                    {
                        if (Job < 16 && Job > 9)
                            LearnSkill(1110, 0);
                        if (Job < 16 && Job > 9 || Job < 26 && Job > 19)
                            LearnSkill(1015, 0);
                        if (Job < 26 && Job > 19)
                            LearnSkill(1025, 0);
                    }
                }
            }
there it is
anything wrong with it?
07/18/2009 10:02 damianpesta#9
Quote:
Originally Posted by Arcotemple:) View Post
Code:
        public bool AddExp(ulong Amount, bool CountMisc)
        {

            Ready = false;
            if (CountMisc)
                Exp += (ulong)(Amount * DataBase.ExpRate * AddExpPc * (Convert.ToDouble(Potency) / 100 + 1));
            else
                Exp += Amount;
            bool Leveled = false;

            if (Exp > DataBase.NeededXP(Level) && Level < 130)
            {
                Leveled = true;
                while (Exp > DataBase.NeededXP(Level) && Level < 130)
                {
                    Exp -= DataBase.NeededXP(Level);
                        ;
                    if (Level == 3)
                    {
                        if (Job < 16 && Job > 9)
                            LearnSkill(1110, 0);
                        if (Job < 16 && Job > 9 || Job < 26 && Job > 19)
                            LearnSkill(1015, 0);
                        if (Job < 26 && Job > 19)
                            LearnSkill(1025, 0);
                    }
                }
            }
there it is
anything wrong with it?
Now you'll learn to be doing backups every 1-2 days lol.
07/18/2009 11:08 Incariuz#10
This is what I have in mine. May not function 100% for you, depending on how your source has been altered, but hope it helps.

Code:
        public bool AddExp(ulong Amount, bool CountMisc)
        {
            Ready = false;
            if (RBCount < 1)
                Amount /= 3;
            if (CountMisc && !EPot)
                Exp += (ulong)(Amount * DataBase.ExpRate * AddExpPc * (Convert.ToDouble(Potency) / 100 + 1));
            else if (EPot)
                Exp += (ulong)((Amount * DataBase.ExpRate * AddExpPc * (Convert.ToDouble(Potency) / 100 + 1)) * 2);

            else
                if (EPot)
                {
                    Exp *= 2;
                }

            Exp += Amount;
            if (EPotRate == true)
                Exp += (ulong)((double)Amount * (double)DataBase.ExpRate * (double)AddExpPc * (Convert.ToDouble(Potency) / 100 + 1));

            bool Leveled = false;

            if (Exp > DataBase.NeededXP(Level) && Level < 135)
            {
                Leveled = true;
                while (Exp > DataBase.NeededXP(Level) && Level < 135)
                {
                    Exp -= DataBase.NeededXP(Level);
                    Level++;
                    if (RBCount > 0)
                    {
                        StatP += 3;
                        MyClient.SendPacket(General.MyPackets.Vital(UID, 11, StatP));
                    }
                    if (Level == 3)
                    {
                        if (Job < 16 && Job > 9)
                            LearnSkill(1110, 0);
                        if (Job < 16 && Job > 9 || Job < 26 && Job > 19)
                            LearnSkill(1015, 0);
                        if (Job < 26 && Job > 19)
                            LearnSkill(1025, 0);
                    }
                }
            }
            if (Leveled)
            {
                if (MyGuild != null)
                    MyGuild.Refresh(this);
                if (RBCount < 1)
                    DataBase.GetStats(this);
                GetEquipStats(1, true);
                GetEquipStats(2, true);
                GetEquipStats(3, true);
                GetEquipStats(4, true);
                GetEquipStats(5, true);
                GetEquipStats(6, true);
                GetEquipStats(8, true);
                MaxHP = BaseMaxHP();
                MaxMP = BaseMaxMP();
                MinAtk = Str;
                MaxAtk = Str;
                Potency = Level;
                GetEquipStats(1, false);
                GetEquipStats(2, false);
                GetEquipStats(3, false);
                GetEquipStats(4, false);
                GetEquipStats(5, false);
                GetEquipStats(6, false);
                GetEquipStats(8, false);

                CurHP = MaxHP;
                CurMP = MaxMP;

                if (Level >= 120)
                    StatP += 3;

                MyClient.SendPacket(General.MyPackets.Vital((long)UID, 13, Level));
                MyClient.SendPacket(General.MyPackets.Vital((long)UID, 16, Str));
                MyClient.SendPacket(General.MyPackets.Vital((long)UID, 17, Agi));
                MyClient.SendPacket(General.MyPackets.Vital((long)UID, 15, Vit));
                MyClient.SendPacket(General.MyPackets.Vital((long)UID, 14, Spi));
                MyClient.SendPacket(General.MyPackets.Vital((long)UID, 0, CurHP));
                MyClient.SendPacket(General.MyPackets.Vital(UID, 11, StatP));
                World.LevelUp(this);
            }

            MyClient.SendPacket(General.MyPackets.Vital((long)UID, 5, Exp));
            Ready = true;

            if (Leveled)
                return true;
            else
                return false;
        }
Edit: Yes, I did the minor fix that most people never noticed or tried to fix... I made it so characters gain 3 Att points every level after 120.
07/18/2009 14:27 ~Yuki~#11
Same i forgot about that fix ( i was never 120 in real co so i didnt knew :P)
07/18/2009 22:17 CptSky#12
Quote:
Originally Posted by Incariuz View Post
If it's LOTF, it should work fine, unless you've tampered with it. On a side note though, I don't suggest trying to run a server off LOTF, simply use it to learn. You'll never hold more then 10-20 players, regardless how many bugs you fix. The entire source needs to e re-written in order to avoid DB data transfer issues.

Edit: On a side note though, if you tell me where it is in what file, I'll go through my old lotf source, and try and find a way to fix it.
I can hold 50-75 players with my edited LOTF source but after a moment, the game server freeze:rolleyes: The login server work fine because I use my login server and the DataBase is in flat-file format. But it's true, LOTF has to be re-written:D
07/19/2009 08:50 Arcotemple:)#13
Quote:
Originally Posted by damianpesta View Post
Now you'll learn to be doing backups every 1-2 days lol.
i do do backups every 1-2 days and i put my backup code in place of the regular code and debugged and shit and people still cant level!