gohamvsgoku
Member
- Joined
- Aug 21, 2017
- Messages
- 151
- Reaction score
- 9
I would like to implement players to gain experience by killing other players, well i found this on config lua
looking some files sources i found this function here
how could i add one more condition, so that only players gain experience killing other players in pvp tiles?
my world is normal pvp, but there are some pvp enforced areas, so for that reason i can't change directly in config.lua to pvp enforced
how could this be done? only gain experience from other playing tiles with pvp property?
Lua:
experienceByKillingPlayers = true
looking some files sources i found this function here
C++:
uint64_t Player::getGainedExperience(Creature* attacker) const
{
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;
}
how could i add one more condition, so that only players gain experience killing other players in pvp tiles?
my world is normal pvp, but there are some pvp enforced areas, so for that reason i can't change directly in config.lua to pvp enforced
how could this be done? only gain experience from other playing tiles with pvp property?