• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Compiling [HELP] TFS 1.0 Shared Exp

kaiquefb

New Member
Joined
Feb 18, 2010
Messages
62
Reaction score
0
Hello,

Use TFS 1.0 and would like to fix the shared xp.
Every vocation entering the party 20% + regardless of vocation EXP, only 20% + per player. when we reach 5 or more player he is at the maximum of 100%.
So if xp is 10x with 5 or more player to xp will be a maximum 20x

Example.
Normal Exp 10x
2 player party 14x exp
3 player party 16x exp
4 player party 18x exp
5 player party 20x exp
6 player party 20x exp
7 player party 20x exp
8 player party 20x exp
.....

in party.cpp on line 400 has this code, I must change something here?

Code:
    size_t size = vocationIds.size();
    if (size > 1) {
        extraExpRate = size * (10 + (size - 1) * 5) / 100.f;
    } else {
        extraExpRate = 0.20f;
    }
}
 
Code:
    size_t size = vocationIds.size(); 
    if (size > 1) {
        switch(size){
            case 2 :
                extraExpRate = 0.14f;
                break;
            case 3 :
                extraExpRate = 0.16f;
                break;
            case 4 :
                extraExpRate = 0.18f;
                break;
            case 5 :
            case 6 :
            case 7 :
            case 8 :
                extraExpRate = 0.20f;
                break;
        }
    } else {
        extraExpRate = 0.20f;
    }
 
Okay,
And in this format, you could explain to me how it works?

Code:
    size_t size = vocationIds.size();
    if (size > 1) {
        extraExpRate = size * (10 + (size - 1) * 5) / 100.f;
    } else {
        extraExpRate = 0.20f;
    }
}
 
Size is all of the unique vocation id's in group minus you times 5 plus 10 multiplied by size then divided by 100 which gives you the extra xp rate per player.
This code tells you its per id and not per player
Code:
vocationIds.insert(vocationId);

If you want to know more about std::set you can read about it here.
http://www.cplusplus.com/reference/set/set/insert/
 
and if this method as is the code

Example.
Normal Exp 10x
2 player party +50% exp = 15x
3-6 player party +40% exp = 14x
7-18 player party +30% exp = 13x
19-999 player party ( Normal ) 10x
 
How would the shared exp in this format

Example.
Normal Exp 10x
2 player party exp = 15x
3of the6 player party exp = 14x
7of the18 player party exp = 13x
19of the999 player party ( Normal ) 10x
 
or another format.

The same exp for everyone.

Dragon lord exp = 21k

2 player in the party = 21k for all
5 player in the party = 21k for all
20 player in the party = 21k for all
 
Party's extra experience does not distribute experience based on the number of players in group, it distributes based on the number of unique vocation id's in group.

If the extra experience for the same vocation is 0.20f or 20% and 100.f is 100% then just change this
Code:
    size_t size = vocationIds.size();
    if (size > 1) {
        extraExpRate = size * (10 + (size - 1) * 5) / 100.f;
    } else {
        extraExpRate = 0.20f;
    }
To this
Code:
    extraExpRate = 100.f;
 
I have this other tfs 1.0 and party.cpp is different, as would be in this format?

Dragon lord = exp 21k
ALL player shared exp party 21k xp

My party.cpp
http://pastebin.com/eMz9982H

is that part should I change?
Code:
void Party::shareExperience(uint64_t experience)
{
    uint32_t shareExperience = (uint64_t)std::ceil((((double)experience / (memberList.size() + 1)) + ((double)experience * 0.05)));
    for (Player* member : memberList) {
        member->onGainSharedExperience(shareExperience);
    }
    leader->onGainSharedExperience(shareExperience);
}

bool Party::canUseSharedExperience(const Player* player) const
{
    if (memberList.empty()) {
        return false;
    }

    uint32_t highestLevel = leader->getLevel();
    for (Player* member : memberList) {
        if (member->getLevel() > highestLevel) {
            highestLevel = member->getLevel();
        }
    }

    uint32_t minLevel = (int32_t)std::ceil(((float)(highestLevel) * 2) / 3);
    if (player->getLevel() < minLevel) {
        return false;
    }
 
Last edited:
Back
Top