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

Exhaustion from Stairs [TFS v0.2.15]

Elvarion

Member
Joined
Apr 14, 2010
Messages
99
Reaction score
13
Right now people can use spells without exhaustion.
Melee / Ranged has the 2 sec exhaustion.

Config.lua
Code:
stairJumpExhaustion = 2000
Changing this does not hinder spells in anyway. Just hinders melee/ranged even more :p

Is it possible to fix so that your not able to use spells before the 2 sec exhaust?
Makes it easy for sorcs/druids to just go down/up and cast a aoe spell to clear stuff..
 
Nothing is impossible. To further answer your question, everything from attacking with a weapon to using a spell should be exhausted using that feature. Since it is not working for you I assume the feature is incomplete in your current TFS version.

I don't know for certain the answer to your question, however...

In player.cpp

Find something similar to this:
Code:
Player::onCreatureMove

Somewhere in that function you should find something similar to this:
Code:
createCondition(CONDITIONID_DEFAULT, CONDITION_PACIFIED, ticks)
What that does is exhaust weapon attacks.

What I assume you are missing is something similar to this:
Code:
addExhaust(ticks, EXHAUST_COMBAT);
This will handle the rest of your combat exhaust.

With both of those combined you should have full exhaustion when jumping up and down stairs.


Here is an example of how it looks on my version of TFS 0.4 (Note that it most likely will not look like this since you are using a completely different version of TFS)

Code:
void Player::onCreatureMove(const Creature* creature, const Tile* newTile, const Position& newPos,
    const Tile* oldTile, const Position& oldPos, bool teleport)
{
    Creature::onCreatureMove(creature, newTile, newPos, oldTile, oldPos, teleport);
    if(creature != this)
        return;

    if(getParty())
        getParty()->updateSharedExperience();

    //check if we should close trade
    if(tradeState != TRADE_TRANSFER && ((tradeItem && !Position::areInRange<1,1,0>(tradeItem->getPosition(), getPosition()))
        || (tradePartner && !Position::areInRange<2,2,0>(tradePartner->getPosition(), getPosition()))))
        g_game.internalCloseTrade(this);

    if((teleport || oldPos.z != newPos.z) && !hasCustomFlag(PlayerCustomFlag_CanStairhop))
    {
        int32_t ticks = g_config.getNumber(ConfigManager::STAIRHOP_DELAY);
        if(ticks > 0)
        {
            addExhaust(ticks, EXHAUST_COMBAT);
            if(Condition* condition = Condition::createCondition(CONDITIONID_DEFAULT, CONDITION_PACIFIED, ticks))
                addCondition(condition);
        }
    }
}
 
Back
Top