• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Walking through players only in protection zones

experienced

Intermediate OT User
Joined
Jan 13, 2011
Messages
418
Reaction score
102
Location
Poland
I tried all replacements in player.cpp but they didn't meet my expectations and I fail to modify these scripts ;d

I don't wanna walking only through player who are under protection level because I have protection level 1 so don't care
I just wanna walk through everybody but only in protection zones of course except this glowing switch tile id 11059
 
in player.cpp
change
bool Player::canWalkthrough(const Creature* creature) const

to
Code:
bool Player::canWalkthrough(const Creature* creature) const
{
    if(creature == this || creature->isWalkable() ||
        (creature->getMaster() && creature->getMaster() != this && canWalkthrough(creature->getMaster())))
        return true;

    const Player* player = creature->getPlayer();
    if(!player)
        return false;

    if(
        (
            (
                (
                    (
                        player->getVocation()->isAttackable() &&
                        player->getLevel() < (uint32_t)g_config.getNumber(ConfigManager::PROTECTION_LEVEL)
                    )
                    || (
                        player->getTile()->hasFlag(TILESTATE_PROTECTIONZONE) &&
                        !player->getTile()->hasFlag(TILESTATE_HOUSE)
                    )
                )
            ) && player->getTile()->ground &&
                player->getTile()->ground->getID() != 11059
        ) && (
            !player->hasCustomFlag(PlayerCustomFlag_GamemasterPrivileges)
            || player->getAccess() <= getAccess()
        )
    ) return true;

    return (player->isGhost() && getGhostAccess() < player->getGhostAccess())
        || (isGhost() && getGhostAccess() > player->getGhostAccess());
}
 
remove this line
player->getLevel() < (uint32_t)g_config.getNumber(ConfigManager::pROTECTION_LEVEL)
 
Back
Top