void Player::getGainExperience(uint64_t& gainExp, bool fromMonster)
{
if(fromMonster || g_config.getNumber(ConfigManager::RATES_FOR_PLAYER_KILLING)){
gainExp = (uint64_t)std::floor(gainExp * getRateValue(LEVEL_EXPERIENCE));
if (fromMonster) {
gainExp = (uint64_t)std::floor(gainExp * 1.5);
}
}
}
https://github.com/TwistedScorpio/OTHire/blob/master/source/player.cpp#L4109
I think you will need to edit this function to add something to be like this:
PHP:void Player::getGainExperience(uint64_t& gainExp, bool fromMonster) { if(fromMonster || g_config.getNumber(ConfigManager::RATES_FOR_PLAYER_KILLING)){ gainExp = (uint64_t)std::floor(gainExp * getRateValue(LEVEL_EXPERIENCE)); if (fromMonster) { gainExp = (uint64_t)std::floor(gainExp * 1.5); } } }
The bonus is 1.5 which means 50% bonus, you can set how much you want(like 1.2 if you want 20% bonus).
The bonus will only work if it has been given by a monster = hunt exp. It won't affect exp added by a script or by killing a player.
CONTAINER_ITEMS_AUTO_STACK,
RATE_BONUS_FOR_PREM,
m_confInteger[CONTAINER_ITEMS_AUTO_STACK] = getGlobalBoolean(L, "container_items_auto_stack", false);
m_confInteger[RATE_BONUS_FOR_PREM] = getGlobalNumber(L, "rate_bonus_for_prem", 1);
void Player::getGainExperience(uint64_t& gainExp, bool fromMonster)
void Player::getGainExperience(uint64_t& gainExp, bool fromMonster)
{
if(fromMonster || g_config.getNumber(ConfigManager::RATES_FOR_PLAYER_KILLING)){
gainExp = (uint64_t)std::floor(gainExp * getRateValue(LEVEL_EXPERIENCE));
if (fromMonster) {
uint8_t prembonus = g_config.getNumber(ConfigManager::RATE_BONUS_FOR_PREM);
float bonus = ((getPremiumDays() > 0) ? (prembonus * 0.1) : 0.0);
gainExp += (uint64_t)std::floor(gainExp * bonus);
}
}
}
-- 1 equals 10%
rate_bonus_for_prem = 1
Nice, you made it way better to modify(now his don't need anymore to edit the sources every time he wants to change the premium bonus).configmanager.h
find this
place this underneathCode:CONTAINER_ITEMS_AUTO_STACK,
Code:RATE_BONUS_FOR_PREM,
configmanager.cpp
find this
place this underneathCode:m_confInteger[CONTAINER_ITEMS_AUTO_STACK] = getGlobalBoolean(L, "container_items_auto_stack", false);
Code:m_confInteger[RATE_BONUS_FOR_PREM] = getGlobalNumber(L, "rate_bonus_for_prem", 1);
find this
Code:void Player::getGainExperience(uint64_t& gainExp, bool fromMonster)
replace the entire thing with this
Code:void Player::getGainExperience(uint64_t& gainExp, bool fromMonster) { if(fromMonster || g_config.getNumber(ConfigManager::RATES_FOR_PLAYER_KILLING)){ gainExp = (uint64_t)std::floor(gainExp * getRateValue(LEVEL_EXPERIENCE)); if (fromMonster) { uint8_t prembonus = g_config.getNumber(ConfigManager::RATE_BONUS_FOR_PREM); float bonus = ((getPremiumDays() > 0) ? (prembonus * 0.1) : 0.0); gainExp += (uint64_t)std::floor(gainExp * bonus); } } }
place this anywhere in config.lua
Code:-- 1 equals 10% rate_bonus_for_prem = 1