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

Need Source help TFS V1.3

Hahstudios

New Member
Joined
Mar 11, 2010
Messages
49
Solutions
3
Reaction score
1
im trying to get the spell "utevo res" to allow me to walk through the creatures but only the master ofc.

i have tried several bools and just cant seem to get it to work

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

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

    auto summons = player->getSummons();
    auto summonsIt = find(summons.begin(), summons.end(), creature);
    if (summonsIt != summons.end()) {
        return true;
    }

    const Tile* playerTile = player->getTile();
    if (!playerTile || !playerTile->hasFlag(TILESTATE_PROTECTIONZONE)) {
        return false;
    }

    const Item* playerTileGround = playerTile->getGround();
    if (!playerTileGround || !playerTileGround->hasWalkStack()) {
        return false;
    }

    Player* thisPlayer = const_cast<Player*>(this);
    if ((OTSYS_TIME() - lastWalkthroughAttempt) > 2000) {
        thisPlayer->setLastWalkthroughAttempt(OTSYS_TIME());
        return false;
    }

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

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

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();
    return playerTile && playerTile->hasFlag(TILESTATE_PROTECTIONZONE);
}
 
Back
Top