Jump to content
  • 0

I want the expin level that comes to the person who cuts the mob to be not more than 10%


creedy

Question

Regardless of the exp value written in mob_proto
I want the expin level that comes to the person who cuts the mob to be not more than 10% of the desired expin

example: exp required for 1 level: 300
I want to get an exp 30 to be taken from 1 mob while at most 1 level

Link to post

13 answers to this question

Recommended Posts

  • 0
Posted (edited)

char_battle.cpp above this: to->PointChange(POINT_EXP, iExp, true);

Paste this:

if ((to->GetNextExp() / 10) > iExp)
    iExp = to->GetNextExp() / 10;

Edit: Tested, working. A wild dog gives 30xp when lv2 needs 300.

Edited by TMP4 (see edit history)
Link to post
  • 0
17 minutes ago, TMP4 said:

char_battle.cpp above this: to->PointChange(POINT_EXP, iExp, true);

Paste this:

if ((to->GetNextExp() / 10) > iExp)     iExp = to->GetNextExp() / 10;

if ((to->GetNextExp() / 10) > iExp)
    iExp = to->GetNextExp() / 10;

Edit: Tested, working. A wild dog gives 30xp when lv2 needs 300.


For example, when the level is 60,
If the exp for the level 61 is 500.000

exp from cut mob 10.000

if 10.000/10=1000
isn't he doing it?

Link to post
  • 0
Posted (edited)

I think you misunderstand it.

GetNextExp() does not calculates the needed amount, but it calculates the whole exp from 60 to 61 if the player is level 60.

See: 

DWORD CHARACTER::GetNextExp() const
{
	if (PLAYER_EXP_TABLE_MAX < GetLevel())
		return 2500000000;
	else
		return exp_table[GetLevel()];
}

So if the exp is 500.000 in your exp table for lv61, then a mob can't give you more then 50.000 with my code what is 10 percent as you asked.

That's what you want, isn't it?

Edited by TMP4 (see edit history)
Link to post
  • 0
20 hours ago, TMP4 said:

I think you misunderstand it.

GetNextExp() does not calculates the needed amount, but it calculates the whole exp from 60 to 61 if the player is level 60.

See: 

DWORD CHARACTER::GetNextExp() const { if (PLAYER_EXP_TABLE_MAX < GetLevel()) return 2500000000; else return exp_table[GetLevel()]; }

DWORD CHARACTER::GetNextExp() const
{
	if (PLAYER_EXP_TABLE_MAX < GetLevel())
		return 2500000000;
	else
		return exp_table[GetLevel()];
}

So if the exp is 500.000 in your exp table for lv61, then a mob can't give you more then 50.000 with my code what is 10 percent as you asked.

That's what you want, isn't it?

 

char_battle.cpp I arranged the way you say.  : F4wWpz.png

 

the problem did not improve :

 

 

must be :

 

 

Link to post
  • 0
Posted (edited)

EDIT: Found your error, you have this:

#define ENABLE_NEWEXP_CALCULATION
#ifdef ENABLE_NEWEXP_CALCULATION

Please edit this ifdef's code too and it will working.

(Line 2634 for you)

    {
        to->PointChange(POINT_EXP, iExp, true);
        from->CreateFly(FLY_EXP, to);
    }

Modify:

    {
        if ((to->GetNextExp() / 10) > iExp)
            iExp = to->GetNextExp() / 10;
        
        to->PointChange(POINT_EXP, iExp, true);
        from->CreateFly(FLY_EXP, to);
    }

 

@creedy Tag you because idk if you see i edited this.

Edited by TMP4 (see edit history)
Link to post
  • 0
Posted (edited)
3 hours ago, TMP4 said:

EDIT: Found your error, you have this:

#define ENABLE_NEWEXP_CALCULATION #ifdef ENABLE_NEWEXP_CALCULATION

#define ENABLE_NEWEXP_CALCULATION
#ifdef ENABLE_NEWEXP_CALCULATION

Please edit this ifdef's code too and it will working.

(Line 2634 for you)

    {         to->PointChange(POINT_EXP, iExp, true);         from->CreateFly(FLY_EXP, to);     }

    {
        to->PointChange(POINT_EXP, iExp, true);
        from->CreateFly(FLY_EXP, to);
    }

Modify:

    {         if ((to->GetNextExp() / 10) > iExp)             iExp = to->GetNextExp() / 10;                  to->PointChange(POINT_EXP, iExp, true);         from->CreateFly(FLY_EXP, to);     }

    {
        if ((to->GetNextExp() / 10) > iExp)
            iExp = to->GetNextExp() / 10;
        
        to->PointChange(POINT_EXP, iExp, true);
        from->CreateFly(FLY_EXP, to);
    }

 

@creedy Tag you because idk if you see i edited this.

 

char_battle.cpp : https://paste.tc/Nwo3jSo20O

I edited it as you said but it didn't happen again
Edited by creedy (see edit history)
Link to post
  • 0

Okey, since you're not using a default source i can't help more. You have to find where the character get exp in your source and edit there. I'm pass this.

Link to post
  • 0
4 minutes ago, TMP4 said:

Okey, since you're not using a default source i can't help more. You have to find where the character get exp in your source and edit there. I'm pass this.

 

martsama source

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.