• 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!

Compiling Walking through players in PZ

Testerus

Intermediate OT User
Joined
Mar 18, 2014
Messages
673
Reaction score
126
Hello everybody!
I would like to know how to make people walk through each other anywhere till level 80 or atleast in protection zones.

I already searched and read this:
http://otland.net/threads/windows-7-walking-through-players-in-pz.141314/#post1361483

I didn't really understand how I can do it.

I'm currently using:
The Forgotten Server - Edited By Cyko V8, version 0.3.6 -
Edited By Cyko V8 (Crying Damson - Edited By Cyko V8)
Compiled with GNU C++ version 3.4.5 (mingw special)

Running it on a 64-bit Windows 8.

If anyone could help, please?

Skype (if you need): lifehie

Kind regards,
 
What does your player.cpp look like? I'm not sure if it's the same as TFS 1.0 but this is what mine looks like maybe it can help.

But for mine you need to remove the PZ zone of the Glowing switch tile (depot tile) and add it as Non-pvp zone in the map editor.
Else players will be able to walk on to players depot tile while they are below level 80.

So in this system players who are below the protection level can be walked through inside PZ and outside. Except not in non-pvp zones.

This is how I edited mine with help from @EvilSkillz

Code:
bool Player::canWalkthrough(const Creature* creature) const
{
    if (group->access || creature->isInGhostMode()) {
        return true;
    }

    const Player* player = creature->getPlayer();
    if (!player) {
        return false;
    }
    if ((player->isAttackable() &&
    (player->getLevel() < (uint32_t)g_config.getNumber(ConfigManager::PROTECTION_LEVEL))))
    return true;
   
    const Tile* playerTile = player->getTile();
    if (playerTile && playerTile->hasFlag(TILESTATE_PROTECTIONZONE)) {
        Item* playerTileGround = playerTile->ground;
        if (playerTileGround && playerTileGround->hasWalkStack()) {
            Player* thisPlayer = const_cast<Player*>(this);
            if ((OTSYS_TIME() - lastWalkthroughAttempt) > 2000) {
                thisPlayer->setLastWalkthroughAttempt(OTSYS_TIME());
                return true;
            }

            if (creature->getPosition() != lastWalkthroughPosition) {
                thisPlayer->setLastWalkthroughPosition(creature->getPosition());
                return false;
            }

            thisPlayer->setLastWalkthroughPosition(creature->getPosition());
            return true;
        }
    }

    return false;
}

bool Player::canWalkthroughEx(const Creature* creature) const
{
    if (group->access) {
        return true;
    }

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

    const Tile* playerTile = player->getTile();
    if (playerTile && playerTile->hasFlag(TILESTATE_NOPVPZONE)){
        return false;
    }
    return playerTile && playerTile->hasFlag(TILESTATE_NONE);
}
 
this won't work because what imkingran did is for tfs 1.0
here is the function from Cykotitan code
i removed colored , etc
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() != 11063
        ) && (
            !player->hasCustomFlag(PlayerCustomFlag_GamemasterPrivileges)
            || player->getAccess() <= getAccess()
        )
    ) return true;

    return (player->isGhost() && getGhostAccess() < player->getGhostAccess())
        || (isGhost() && getGhostAccess() > player->getGhostAccess());
}
 
this won't work because what imkingran did is for tfs 1.0
here is the function from Cykotitan code
i removed colored , etc
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() != 11063
        ) && (
            !player->hasCustomFlag(PlayerCustomFlag_GamemasterPrivileges)
            || player->getAccess() <= getAccess()
        )
    ) return true;

    return (player->isGhost() && getGhostAccess() < player->getGhostAccess())
        || (isGhost() && getGhostAccess() > player->getGhostAccess());
}
this cod give me this error
[Linker error] undefined reference to `IOGuild::updateWar(War_t&)'
*** [TheForgottenServer.exe] Error 1
 
Back
Top