secondlife
Member
- Joined
- Aug 1, 2009
- Messages
- 298
- Reaction score
- 23
Hi guys!
I'm using @Mkalo's party group share experience for tfs 0.4: https://otland.net/threads/is-possible-check-sharing-exp.243688/page-2#post-2366196
My problem is that, i have new vocations (for example: Knight, Elite Knight and Legendary Knight// Druid, Elder Druid, Alchemist etc). I would like to know how i can limit the maximum experience bonus obtained to 100%, because if i put 5 different vocations (Ex: Elite Knight, Elder Druid, Master Sorcerer, Royal Paladin and one Alchemist) in the party (ex: 25% per vocation), the experience gained goes to 125%. I would like to make the maximum bonus at 100%, even if they have more than 4 different vocations in the same party.
Many thanks!
I'm using @Mkalo's party group share experience for tfs 0.4: https://otland.net/threads/is-possible-check-sharing-exp.243688/page-2#post-2366196
My problem is that, i have new vocations (for example: Knight, Elite Knight and Legendary Knight// Druid, Elder Druid, Alchemist etc). I would like to know how i can limit the maximum experience bonus obtained to 100%, because if i put 5 different vocations (Ex: Elite Knight, Elder Druid, Master Sorcerer, Royal Paladin and one Alchemist) in the party (ex: 25% per vocation), the experience gained goes to 125%. I would like to make the maximum bonus at 100%, even if they have more than 4 different vocations in the same party.
Code:
double Player::getPartyBonus() {
double bonus = 1;
bool vocations[] = {false, false, false, false, false, false, false, false, false, false, false, false, false, false};
if(Party* party = this->getParty()) {
if(party->isSharedExperienceEnabled() && party->isSharedExperienceActive()) {
PlayerVector list = party->getMembers();
list.push_back(party->getLeader());
for(PlayerVector::const_iterator it = list.begin(); it != list.end(); ++it) {
uint32_t vocId = (*it)->getBaseVoc();
if(!vocations[vocId]) {
vocations[vocId] = true;
bonus += 0.25;
}
}
}
}
return bonus;
}
Many thanks!