Silba
is stephany, the josh wife
- Joined
- Aug 22, 2013
- Messages
- 458
- Solutions
- 9
- Reaction score
- 386
Hello I would like to modify the source code or create a script which will allow me to set the level range for pvp-enforced experience to be based on a percentage rather than the normal level range which never changes.
Right now in config.lua I have
The source code is:
I pretty much die inside looking at source code, could someone help me with modifying the source to make
Otherwise an lua script would be ideal but a problem I ran in to looking at scripts I found on the forum was making sure everyone who attacks the players gets some experience proportionate to their damage dealt. Way too complicated for me.
For example
Any help is appreciated, thank you
Right now in config.lua I have
expFromPlayersLevelRange = 80
and this is very limited and pretty much useless if players can reach high levels such as 1k+. Set it high and low level pvp is weird, set it low and high level pvp is weird, there's no way to make this work well for high level players and low level players.The source code is:
C++:
{
if (g_config.getBoolean(ConfigManager::EXPERIENCE_FROM_PLAYERS)) {
Player* attackerPlayer = attacker->getPlayer();
if (attackerPlayer && attackerPlayer != this && skillLoss && std::abs(static_cast<int32_t>(attackerPlayer->getLevel() - level)) <= g_config.getNumber(ConfigManager::EXP_FROM_PLAYERS_LEVEL_RANGE)) {
return std::max<uint64_t>(0, std::floor(getLostExperience() * getDamageRatio(attacker) * 0.75));
}
}
return 0;
}
I pretty much die inside looking at source code, could someone help me with modifying the source to make
expFromPlayersLevelRange
represent the percentage difference instead?Otherwise an lua script would be ideal but a problem I ran in to looking at scripts I found on the forum was making sure everyone who attacks the players gets some experience proportionate to their damage dealt. Way too complicated for me.
For example
expFromPlayersLevelRange = 15
would mean a player level 200 would get exp if he killed a player 30 levels above(230) or below(170) him. 15% difference and not a flat 15 level difference.Any help is appreciated, thank you