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

TFS 1.X+ cooldown on ramp

SixNine

Active Member
Joined
Dec 12, 2018
Messages
452
Reaction score
41
How can i add cooldown on ramps, saw that only stairs have cooldown (stairJumpExhaustion) but ramps doesnt. Tfs 1.2
 
Are you sure about that? Had a look in onCreatureMove in player.cpp, and it seems to be adding this exhaust if you change floor regardless of stairs, ramp or ladders:

C++:
    if (teleport || oldPos.z != newPos.z) {
        int32_t ticks = g_config.getNumber(ConfigManager::STAIRHOP_DELAY);
        if (ticks > 0) {
            if (Condition* condition = Condition::createCondition(CONDITIONID_DEFAULT, CONDITION_PACIFIED, ticks, 0)) {
                addCondition(condition);
            }
        }
    }
 
Last edited:
Are you sure about that? Had a look in onCreatureMove in player.cpp, and it seems to be adding this exhaust if you change floor regardless of stairs, ramp or ladders:

C++:
    if (teleport || oldPos.z != newPos.z) {
        int32_t ticks = g_config.getNumber(ConfigManager::STAIRHOP_DELAY);
        if (ticks > 0) {
            if (Condition* condition = Condition::createCondition(CONDITIONID_DEFAULT, CONDITION_PACIFIED, ticks, 0)) {
                addCondition(condition);
            }
        }
    }
Yea im sure i can spam floor change like crazy there is 0 cooldown
 
Explain what you mean, you want to get exhausted from walking up and down? Or do you mean exhausted in attacking?
 
in onCreatureMove in creature.cpp, try change this:

C++:
        if (!teleport) {
            if (oldPos.z != newPos.z) {
                //floor change extra cost
                lastStepCost = 2;
            } else if (Position::getDistanceX(newPos, oldPos) >= 1 && Position::getDistanceY(newPos, oldPos) >= 1) {
                //diagonal extra cost
                lastStepCost = 3;
            }
        } else {
            stopEventWalk();
        }

With:

C++:
        if (teleport) {
            stopEventWalk();
        }
        
        if (oldPos.z != newPos.z) {
            //floor change extra cost
            lastStepCost = 2;
        } else if (Position::getDistanceX(newPos, oldPos) >= 1 && Position::getDistanceY(newPos, oldPos) >= 1) {
            //diagonal extra cost
            lastStepCost = 3;
        }
 
in onCreatureMove in creature.cpp, try change this:

C++:
        if (!teleport) {
            if (oldPos.z != newPos.z) {
                //floor change extra cost
                lastStepCost = 2;
            } else if (Position::getDistanceX(newPos, oldPos) >= 1 && Position::getDistanceY(newPos, oldPos) >= 1) {
                //diagonal extra cost
                lastStepCost = 3;
            }
        } else {
            stopEventWalk();
        }

With:

C++:
        if (teleport) {
            stopEventWalk();
        }
       
        if (oldPos.z != newPos.z) {
            //floor change extra cost
            lastStepCost = 2;
        } else if (Position::getDistanceX(newPos, oldPos) >= 1 && Position::getDistanceY(newPos, oldPos) >= 1) {
            //diagonal extra cost
            lastStepCost = 3;
        }
No errors but still zero cooldowns can change floors instantly
 
Back
Top