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

Does anyone know how to put this exhaust?

Jpstafe

Well-Known Member
Joined
Aug 8, 2011
Messages
507
Reaction score
68
Hello otland community, for several days I have been investigating the issue of the exhaust in the ots 7x, and I would like to change it, how the ots use it, I know that it is not the original exhaust of the version, but the players who play my ot me They ask, how can it be changed... now I leave some examples, I have changed them from the spells but nothing...

this is how they are in my ot:
exori vis:

1.gif
exura vita:
exura vita con.gif

-----------------------------------------------------------------------
I get this exhaust from another one now..
I would like to throw the spells like this:
exori vis:

sinnn.gif
exura vita:
final22.gif

My version of ot is otx 7x, I know it's old, and that it has many bugs, but I've already fixed it enough, they recommended changing it to tfs 1.5, but since my aspiration to ot is a server for friends, and not Another serious type of server... I decide to keep the otx, but I would like to fix these exhausts, because we use this ot to practice pvp as a team.

Fix exhaust (ejemplo exura + exori vis, etc) by brewsterl · Pull Request #53 · mattyx14/otxserver (https://github.com/mattyx14/otxserver/pull/53)
They gave me a github link with the otx bug posts, and I found a possible solution... but in the same post it says. "This small fix is temporary, the bug appears if you use exori vis + exura, etc. that is to say the opposite, but using exura + exori vis no,"

in my spells.cpp the exhaust is like this..

Lua:
if(groupExhaustions.empty())
        {
            if(isAggressive)
                groupExhaustions[SPELLGROUP_ATTACK] = 2000;
            else
                groupExhaustions[SPELLGROUP_HEALING] = 1000;

 
You should have these in each of your spells files, just change it to 1 * 1000.
Code:
spell:cooldown(2 * 1000)
spell:groupCooldown(2 * 1000)
 
and you want spells to have a cooldown and a storage system, you can consider the following implementation as an example.

exori vis.
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)


local cooldownInSeconds = 10
local storage = 1000 -- Custom storage to control recharge time

function onGetFormulaValues(player, level, magicLevel)
    local min = (level / 5) + (magicLevel * 1.4) + 8
    local max = (level / 5) + (magicLevel * 2.2) + 14
    return -min, -max
end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(creature, variant)
    local player = Player(creature)
    if player:getStorageValue(storage) > os.time() then
        player:sendCancelMessage("Wait for recharge time.")
        return false
    end

    player:setStorageValue(storage, os.time() + cooldownInSeconds)
    return combat:execute(creature, variant)
end

exura vita.
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
combat:setParameter(COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false)


local cooldownInSeconds = 10
local storage = 2000 -- Custom storage to control recharge time

function onGetFormulaValues(player, level, magicLevel)
    local min = (level / 5) + (magicLevel * 6.8) + 42
    local max = (level / 5) + (magicLevel * 12.9) + 90
    return min, max
end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(creature, variant)
    local player = Player(creature)
    if player:getStorageValue(storage) > os.time() then
        player:sendCancelMessage("Wait for recharge time.")
        return false
    end

    player:setStorageValue(storage, os.time() + cooldownInSeconds)
    return combat:execute(creature, variant)
end
If you want to add a cooldown and storage system to spells, you can try making the following changes as needed. However, I cannot guarantee that it will work flawlessly, as it depends on the context and the specific implementation you are using.
 
You should have these in each of your spells files, just change it to 1 * 1000.
Code:
spell:cooldown(2 * 1000)
spell:groupCooldown(2 * 1000)
In what lua is this? Because in the exori vis or exura vita I do not find it
Post automatically merged:

and you want spells to have a cooldown and a storage system, you can consider the following implementation as an example.

exori vis.
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)


local cooldownInSeconds = 10
local storage = 1000 -- Custom storage to control recharge time

function onGetFormulaValues(player, level, magicLevel)
    local min = (level / 5) + (magicLevel * 1.4) + 8
    local max = (level / 5) + (magicLevel * 2.2) + 14
    return -min, -max
end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(creature, variant)
    local player = Player(creature)
    if player:getStorageValue(storage) > os.time() then
        player:sendCancelMessage("Wait for recharge time.")
        return false
    end

    player:setStorageValue(storage, os.time() + cooldownInSeconds)
    return combat:execute(creature, variant)
end

exura vita.
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
combat:setParameter(COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false)


local cooldownInSeconds = 10
local storage = 2000 -- Custom storage to control recharge time

function onGetFormulaValues(player, level, magicLevel)
    local min = (level / 5) + (magicLevel * 6.8) + 42
    local max = (level / 5) + (magicLevel * 12.9) + 90
    return min, max
end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(creature, variant)
    local player = Player(creature)
    if player:getStorageValue(storage) > os.time() then
        player:sendCancelMessage("Wait for recharge time.")
        return false
    end

    player:setStorageValue(storage, os.time() + cooldownInSeconds)
    return combat:execute(creature, variant)
end
If you want to add a cooldown and storage system to spells, you can try making the following changes as needed. However, I cannot guarantee that it will work flawlessly, as it depends on the context and the specific implementation you are using.
In the lua of my server, exori vis or exura vita, are totally different, nose that version of lua is this that happened to me ..
energy strike. lua:
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0.25, -0, -0.55, 0)

function onCastSpell(cid, var)
    if exhaustion.check(cid, 30030) then
     doPlayerSendCancel(cid, "You are exhausted.")
     else
    exhaustion.set(cid, 30030, 1)
    return doCombat(cid, combat, var)
    end
end
energy_striker.lua:
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_TELEPORT)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0.25, -0, -0.55, 0)

local arr = {
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 3, 0}
}

local area = createCombatArea(arr)
setCombatArea(combat, area)

function onCastSpell(cid, var)
    return doCombat(cid, combat, var)
end
 
What engine are you using?
If its not done in revscript then you should have spells.xml file.
If you do then change:
Code:
exhaustion="2000"
in your spell line to whatever cd you want, 1000 = 1 second.
 
What engine are you using?
If its not done in revscript then you should have spells.xml file.
If you do then change:
Code:
exhaustion="2000"
in your spell line to whatever cd you want, 1000 = 1 second.
otx 772 use, if I change it from spells.xml, but nothing, I put it at 1000 which is = at 1 sec
Lua:
<instant name="Energy Strike" words="exori vis" mana="20" maglv="3" prem="0" direction="1" blockwalls="1" exhaustion="1000" needlearn="0" event="script" value="attack/energy strike.lua">
        <vocation id="1;5"/>
        <vocation id="2;6"/>
    </instant>
 
In what lua is this? Because in the exori vis or exura vita I do not find it
Post automatically merged:


In the lua of my server, exori vis or exura vita, are totally different, nose that version of lua is this that happened to me ..
energy strike. lua:

energy_striker.lua:
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_TELEPORT)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0.25, -0, -0.55, 0)

local arr = {
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 3, 0}
}

local area = createCombatArea(arr)
setCombatArea(combat, area)

function onCastSpell(cid, var)
    return doCombat(cid, combat, var)
end

Cooldown and Exhaustion are the same thing, as I mentioned earlier. I made some simple changes like setting a 1 second cooldown just as an example. If you wish, you can increase this value according to your compulsives.

Lua:
local combat = createCombatObject()

setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0.25, -0, -0.55, 0)

local exhaust = 30030 -- The exhaust ID you want to use
local cooldown = 1000 -- 1 second cooldown in milliseconds

function onCastSpell(cid, var)
    if exhaustion.check(cid, exhaust) then
        doPlayerSendCancel(cid, "You are exhausted.")
    else
        exhaustion.set(cid, exhaust, cooldown / 1000) -- Set cooldown in seconds
        return doCombat(cid, combat, var)
    end
end
Post automatically merged:

otx 772 use, if I change it from spells.xml, but nothing, I put it at 1000 which is = at 1 sec
Within the "spells.xml" tag, there is no reference to cooldown or exhaustion. I've already made changes to the exhaust, but it doesn't seem to be working. Only within the script, using cooldown or exhaustion, does it work correctly.
 
Cooldown and Exhaustion are the same thing, as I mentioned earlier. I made some simple changes like setting a 1 second cooldown just as an example. If you wish, you can increase this value according to your compulsives.

Lua:
local combat = createCombatObject()

setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0.25, -0, -0.55, 0)

local exhaust = 30030 -- The exhaust ID you want to use
local cooldown = 1000 -- 1 second cooldown in milliseconds

function onCastSpell(cid, var)
    if exhaustion.check(cid, exhaust) then
        doPlayerSendCancel(cid, "You are exhausted.")
    else
        exhaustion.set(cid, exhaust, cooldown / 1000) -- Set cooldown in seconds
        return doCombat(cid, combat, var)
    end
end
Post automatically merged:


Within the "spells.xml" tag, there is no reference to cooldown or exhaustion. I've already made changes to the exhaust, but it doesn't seem to be working. Only within the script, using cooldown or exhaustion, does it work correctly.
It didn't work for me, I copied it as it is, but it still has the same exhaust :(
 
In that case change this line in your sources:
Code:
groupExhaustions[SPELLGROUP_ATTACK] = 2000;
to 1000.
The thing is it will affect all of attacking spells (every spell will have 1 sec cd).
 
Looks like it works for you, but I'm not sure if it's compatible with Otx. This spell was developed for TFS 0.4, so it should work, but it's important to run tests to confirm its compatibility.
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0.25, -0, -0.55, 0)

function onCastSpell(cid, var)
if getPlayerStorageValue(cid, 10569) == 1 then
doSendAnimatedText((getCreaturePosition(cid)), "exhaust", 255)
doSendMagicEffect(getCreaturePosition(cid), 110)
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return false
end
 
return doCombat(cid, combat, var)
end

or

Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0.25, -0, -0.55, 0)

local spellExhaust = 30030 -- Exhaustion ID for the spell
local spellCooldown = 1 -- Cooldown time in seconds

function onCastSpell(cid, var)
    if exhaustion.isExhausted(cid, spellExhaust) then
        doSendAnimatedText(getCreaturePosition(cid), "Exhausted", COLOR_RED)
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
        doPlayerSendCancel(cid, "You are exhausted.")
        return false
    end

    exhaustion.set(cid, spellExhaust, spellCooldown)
    return doCombat(cid, combat, var)
end

or again
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0.25, -0, -0.55, 0)

local spellExhaust = 30030 -- Exhaustion ID for the spell

function onCastSpell(cid, var)
    if exhaustion.isExhausted(cid, spellExhaust) then
        doSendAnimatedText(getCreaturePosition(cid), "Exhausted", COLOR_RED)
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
        doPlayerSendCancel(cid, "You are exhausted.")
        return false
    end

    exhaustion.set(cid, spellExhaust, 1) -- Set exhaustion for 1 second
    return doCombat(cid, combat, var)
end
 
Last edited:
Looks like it works for you, but I'm not sure if it's compatible with Otx. This spell was developed for TFS 0.4, so it should work, but it's important to run tests to confirm its compatibility.
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0.25, -0, -0.55, 0)

function onCastSpell(cid, var)
if getPlayerStorageValue(cid, 10569) == 1 then
doSendAnimatedText((getCreaturePosition(cid)), "exhaust", 255)
doSendMagicEffect(getCreaturePosition(cid), 110)
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return false
end
 
return doCombat(cid, combat, var)
end

or

Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0.25, -0, -0.55, 0)

local spellExhaust = 30030 -- Exhaustion ID for the spell
local spellCooldown = 1 -- Cooldown time in seconds

function onCastSpell(cid, var)
    if exhaustion.isExhausted(cid, spellExhaust) then
        doSendAnimatedText(getCreaturePosition(cid), "Exhausted", COLOR_RED)
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
        doPlayerSendCancel(cid, "You are exhausted.")
        return false
    end

    exhaustion.set(cid, spellExhaust, spellCooldown)
    return doCombat(cid, combat, var)
end

or again
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0.25, -0, -0.55, 0)

local spellExhaust = 30030 -- Exhaustion ID for the spell

function onCastSpell(cid, var)
    if exhaustion.isExhausted(cid, spellExhaust) then
        doSendAnimatedText(getCreaturePosition(cid), "Exhausted", COLOR_RED)
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
        doPlayerSendCancel(cid, "You are exhausted.")
        return false
    end

    exhaustion.set(cid, spellExhaust, 1) -- Set exhaustion for 1 second
    return doCombat(cid, combat, var)
end
It didn't work, and it broke xd.. still the same exhaust, the base ot I use is this: https://otland.net/threads/7-4-otx-rlmap-100-port-hope-7-4-poi -demon-oak-war-system-shared-exp.249949/
 

Attachments

It's probably a source-related issue. There might be some change needed but as I am not very familiar with OTX I don't have enough knowledge about how it works. My experience is mostly with TFS.
 
I would recommend you to handle the exhaust strictly on source side
However, here is a quick fix for your current issue

Go to data/lib/034-exhaustion.lua, you will find the check function inside there
Lua:
    check = function (cid, storage)
        if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
            return false
        end

        return getCreatureStorage(cid, storage) >= os.time()
    end,

Just change the operator >= to >
Thats the reason why the minimum exhaust its apparently 2 seconds instead 1 second
 
check = function (cid, storage) if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then return false
I would recommend you to handle the exhaust strictly on source side
However, here is a quick fix for your current issue

Go to data/lib/034-exhaustion.lua, you will find the check function inside there
Lua:
    check = function (cid, storage)
        if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
            return false
        end

        return getCreatureStorage(cid, storage) > os.time()
    end,

Just change the operator >= to >
Thats the reason why the minimum exhaust its apparently 2 seconds instead 1 second
There I did what you told me, and it's still the same. I'll give you the complete code in case I made a mistake, but I only did the deleting the >= and leaving the >
Lua:
exhaustion =
{
    check = function (cid, storage)
        if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
            return false
        end

        return getCreatureStorage(cid, storage) > os.time()
    end,

    get = function (cid, storage)
        if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
            return false
        end

        local exhaust = getPlayerStorageValue(cid, storage)
        if(exhaust > 0) then
            local left = exhaust - os.time()
            if(left >= 0) then
                return left
            end
        end

        return false
    end,

    set = function (cid, storage, time)
        setPlayerStorageValue(cid, storage, os.time() + time)
    end,

    make = function (cid, storage, time)
        local exhaust = exhaustion.get(cid, storage)
        if(not exhaust) then
            exhaustion.set(cid, storage, time)
            return true
        end

        return false
    end
}
 
So is it more how often can action be executed and not like cooldown?
So the "poof" effect won't be shown always?
for me it is the exhaust... because in the gifs it is shown that my exori vis or exura vitan are thrown every 2 seconds... and in the example that I want it, they are 1 second
 
So is it more how often can action be executed and not like cooldown?
So the "poof" effect won't be shown always?
The thing is I know for a fact that on the otx version he uses besides the .xml exhaustion, it also uses storages on the spell scripts to make a "shared group system" which is not ideal but that how it was done

for me it is the exhaust... because in the gifs it is shown that my exori vis or exura vitan are thrown every 2 seconds... and in the example that I want it, they are 1 second
If both exhaustions are set to 1 second or even 1ms on spells.xml, then it must be something on source side.
You can post your spells.cpp and we may help you
 
Back
Top