Register for your free account! | Forgot your password?

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

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

Advertisement



Experience not working properly?

Discussion on Experience not working properly? within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jul 2012
Posts: 9
Received Thanks: 0
Experience not working properly?

Code:
namespace Source.Structures.Instances
{
    class Experience
    {
        public static void ProcessLeveling(GameClient Attacker, IBaseEntity Opponent, GuildMonster GuildMob, uint Damage, ushort SpellID)
        {
            #region TG
            if (GuildMob != null)
            {
                if (Attacker.Entity.MapID.ID == 1039)
                {
                    if (SpellID == 0)
                        ConquerSpell.CalculateProfExp(Attacker, Damage);
                    if (SpellID != 0)
                        ConquerSpell.CalculateSpellExp(Attacker, SpellID, Damage);

                    CalculateExp(Attacker, GuildMob.Level, Damage);
                    return;
                }
            }
            #endregion
            #region Monsters
            else if (Attacker.Entity.EntityFlag == EntityFlag.Player && Opponent.EntityFlag == EntityFlag.Monster)
            {
                Monster Monster = (Monster)Opponent.Owner;
                if (Monster.IsGuard) return;

                if (SpellID == 0)
                    ConquerSpell.CalculateProfExp(Attacker, Damage);
                if (SpellID != 0)
                    ConquerSpell.CalculateSpellExp(Attacker, SpellID, Damage);
                if (Attacker.Team.Active)
                    ConquerTeam.CalculateExp(Attacker, (byte)(Opponent.Owner as Entity).Level); //Problem

                    CalculateExp(Attacker, (Opponent.Owner as Monster).Entity.Level, Damage);
            }
            #endregion
        }
        public static void CalculateExp(GameClient Attacker, int OpponentLv, uint Damage)
        {
            if (Attacker.Entity.Level < 130)
            {
                double AddedExp = 0;
                if (OpponentLv + 4 < Attacker.Entity.Level) AddedExp = 0.1;
                if (OpponentLv + 4 >= Attacker.Entity.Level) AddedExp = 1;
                if (OpponentLv >= Attacker.Entity.Level) AddedExp = 1.1;
                if (OpponentLv - 4 > Attacker.Entity.Level) AddedExp = 1.3;

                Damage = Convert.ToUInt32(Damage * AddedExp);
                Damage *= (uint)DataStructures.ExperienceRate;

                if (Attacker.ExperienceMultiply > 0)
                    Damage *= Attacker.ExperienceMultiply;
                if (Attacker.Entity.MapID == 1039)
                    Damage = (uint)Math.Round((double)Damage * 0.1); // * tgModifier

                Attacker.Experience += (int)Damage;

                uint Needed = Database.LoadLevelExp((byte)Attacker.Entity.Level);
                if ((int)(Attacker.Experience - Needed) >= 0)
                {
                    //Attacker.Experience -= (int)Needed;
                    Attacker.Experience = 0;
                    StatusChange.Level(Attacker, (byte)(Attacker.Entity.Level + 1), true);
                }
                Attacker.Send(new StatTypePacket(Attacker.Entity.UID, (uint)Attacker.Experience, StatIDs.Experience).Serialize());
            }
        }
    }
}
I am having troubles getting the experience to work properly maybe because of this? I am not sure, but when I kill a monster none of the experience is adding to the bar. Every time I try to fix it, it because worse and even more errors show. If someone can help it would be beyond great! Yes, I am trying to learn how to code so excuse the sloppy work.
ProperCodes is offline  
Old 07/25/2012, 20:29   #2
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,226
Received Thanks: 868
Are you level 130+?

Is monster null?

Check
_DreadNought_ is offline  
Old 07/25/2012, 20:49   #3
 
elite*gold: 0
Join Date: Jul 2012
Posts: 9
Received Thanks: 0
I am level 1 and how do I check if monster is null? (Stupid question)
ProperCodes is offline  
Old 07/25/2012, 20:54   #4
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,226
Received Thanks: 868
Learn breakpointing, That will more than likely solve your current problem of figuring out what the problem was in the first place.
_DreadNought_ is offline  
Old 07/25/2012, 21:25   #5
 
shadowman123's Avatar
 
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
Well show us the Error .. and you should call these once each attack bet Player -> monster btw i like the way u coded it
shadowman123 is offline  
Reply


Similar Threads Similar Threads
L2 walker for GOD Working properly...
02/13/2013 - Lineage 2 - 2 Replies
Anyone have l2 walker ig that works full on GOD oficial??? PLZ HELP ME...
Hi, my mon control is not working properly help
08/04/2010 - Ragnarok Online - 4 Replies
Hi, my mon control is not working properly help I want to disconnect my bot when the Gazeti attacks me...I dont know what to put in mon_control.txt help pls
sv not working properly
08/17/2007 - CO2 Exploits, Hacks & Tools - 4 Replies
well since the last patch, when my sv kills a mob and the mob drops lets say a met he chooses the next target to attack then finds met aproaches to get it and then the attack function overrides the met picking and he attacks the mob the met disapearing .... am i the only one with this problem ? and dont lol at me cuz i got 2 posts i am not jocking :)



All times are GMT +1. The time now is 10:33.


Powered by vBulletin®
Copyright ©2000 - 2026, 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 ©2026 elitepvpers All Rights Reserved.