Mateus Robeerto
Excellent OT User
Does anyone know how to solve this PZ issue? For example, when I try to enable experience sharing anywhere, it doesn't work. Only works in PZ. How do I remove this PZ restriction and allow experience sharing? Can someone help me?
I don't want to be in PZ to enable experience sharing.
I removed that part of PZ and tested it. However, you still need to be in PZ to enable experience sharing. I want to completely remove this restriction.
party.cpp
I don't want to be in PZ to enable experience sharing.
I removed that part of PZ and tested it. However, you still need to be in PZ to enable experience sharing. I want to completely remove this restriction.
party.cpp
C++:
SharedExpStatus_t Party::getMemberSharedExperienceStatus(const Player * player) const
{
if (memberList.empty()) {
return SHAREDEXP_EMPTYPARTY;
}
uint32_t highestLevel = leader->getLevel();
for (Player* member : memberList) {
if (member->getLevel() > highestLevel) {
highestLevel = member->getLevel();
}
}
uint32_t minLevel = static_cast<uint32_t>(std::ceil((static_cast<float>(highestLevel) * 2) / 3));
if (player->getLevel() < minLevel) {
return SHAREDEXP_LEVELDIFFTOOLARGE;
}
if (!Position::areInRange<30, 30, 1>(leader->getPosition(), player->getPosition())) {
return SHAREDEXP_TOOFARAWAY;
}
if (!player->hasFlag(PlayerFlag_NotGainInFight)) {
//check if the player has healed/attacked anything recently
auto it = ticksMap.find(player->getID());
if (it == ticksMap.end()) {
return SHAREDEXP_MEMBERINACTIVE;
}
uint64_t timeDiff = OTSYS_TIME() - it->second;
if (timeDiff > static_cast<uint64_t>(g_config.getNumber(ConfigManager::PZ_LOCKED))) {
return SHAREDEXP_MEMBERINACTIVE;
}
}
return SHAREDEXP_OK;
}
Last edited: