Id like to modify this code in order to make the following changes in game:
1. Players don't lose skills or magic level on death
2. Player won't downgrade from level 100 when dying
Im not sure how exactly to make the changes in order to not bug the src files when compiling, any advice or help implementing the modification will be appretiated
1. Players don't lose skills or magic level on death
C++:
//Magic level loss
uint64_t sumMana = 0;
for (uint32_t i = 1; i <= magLevel; ++i) {
sumMana += vocation->getReqMana(i);
}
//double deathLossPercent = getLostPercent() * (unfairFightReduction / 100.);
double deathLossPercent = getLostPercent();
removeManaSpent(static_cast<uint64_t>((sumMana + manaSpent) * deathLossPercent), false);
//Skill loss
for (uint8_t i = SKILL_FIRST; i <= SKILL_LAST; ++i) { //for each skill
uint64_t sumSkillTries = 0;
for (uint16_t c = MINIMUM_SKILL_LEVEL + 1; c <= skills[i].level; ++c) { //sum up all required tries for all skill levels
sumSkillTries += vocation->getReqSkillTries(i, c);
}
2. Player won't downgrade from level 100 when dying
C++:
while (level > 1 && experience < Player::getExpForLevel(level)) {
--level;
healthMax = std::max<int32_t>(0, healthMax - vocation->getHPGain());
manaMax = std::max<int32_t>(0, manaMax - vocation->getManaGain());
capacity = std::max<int32_t>(0, capacity - vocation->getCapGain());
}
Im not sure how exactly to make the changes in order to not bug the src files when compiling, any advice or help implementing the modification will be appretiated