ConAn Edujawa
Member
- Joined
- Feb 23, 2015
- Messages
- 457
- Reaction score
- 17
hello guys i use 0.4
i use this system party share exp but this system make this bug
exp from player is very hight how i can make this system work on monster only.
player.cpp
player.h
creature.cpp
creature.h
i use this system party share exp but this system make this bug
TFS 0.X - exp from killing player
hello guys i use 0.4 i have problem player level 80 when kill player level 200 he got 8 levels and player level 200 kill player level 200 got 1.5 level its too high exp how i can reduce the exp when player kill other player my config experienceStages = true rateExperience = 5.0...
otland.net
player.cpp
Lua:
uint32_t Player::getBaseVoc() {
uint32_t curVoc = vocationId;
Vocation* voc = Vocations::getInstance()->getVocation(curVoc);
while(voc->getFromVocation() != curVoc) {
curVoc = voc->getFromVocation();
voc = Vocations::getInstance()->getVocation(curVoc);
}
return curVoc;
}
double Player::getPartyBonus() {
double multiplier = 1;
double benefit = 0.25;
bool vocations[] = {
false, // Rook
false, false, false, false, false, // Players, maybe new vocation tree?
false, false, false, false, false, // Atomic new baselines at 4th promotion so a plateau of no backsliding?
false, false, // Convergent Demigod paths?
false // Something else? Did you create getBaseVoc() correctly? Is your vocations.xml sane?
};
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;
multiplier += std::max(benefit, 0.10);
benefit += -0.05;
}
}
}
}
return multiplier;
player.h
Code:
uint32_t getBaseVoc();
double getPartyBonus();
creature.cpp
Code:
double Creature::getGainedExperience(Creature* attacker) {
double bonus = 1;
if(Player* player = attacker->getPlayer()) {
bonus = player->getPartyBonus();
}
return getDamageRatio(attacker) * (double)getLostExperience() * bonus;
}
creature.h
Code:
virtual double getGainedExperience(Creature* attacker);