• 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.3] Spell cooldown. I am exhausted

ivvanek

New Member
Joined
Mar 24, 2009
Messages
113
Reaction score
3
Hello

Spells working like too exhausted because when i use "exevo gran mas flam" and trying to hit with "sd rune" then i am exhausted for too long time and i cannot hit any runes or spells.

Code:
<instant group="attack" name="Hell's Core" words="exevo gran mas flam" level="60" mana="1100" premium="1" cooldown="1600" selftarget="1" needlearn="0" script="attack/hell's_core.lua">
        <vocation name="Sorcerer" />
        <vocation name="Master Sorcerer" />
    </instant>

When i reduce "cooldown" value from spells.xml from "16000" to "1600" for UE Spell then i can use runes sd after a little delay (it is good btw.) but i can again use ue spell without delay :p
2. When i change back the value from spells.xml from "1600" to "16000" for UE Spell then i again i cannot use runes sd after using UE spell.... with toooooo long delay or exahust.

Who knows a solution to fix MULTI SPELLS exhaust/cooldown after using UE for example. ?


EDIT:
Maybe it is hard to explain what i am talking about but in short words, After use UE i cannot use any other spell or rune because i am exhasted. I think it is a bug...
 
Last edited:
Solution
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
combat:setArea(createCombatArea(AREA_CIRCLE5X5))

function onGetFormulaValues(player, level, magicLevel)
    local min = (level / 5) + (magicLevel * 8) + 50
    local max = (level / 5) + (magicLevel * 12) + 75
    return -min, -max
end
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")



function onCastSpell(creature, variant)
    local player = Player(creature)
    if player:getStorageValue(55555) >= os.time() then
    player:sendTextMessage(MESSAGE_STATUS_SMALL, "You are exhausted")
        return true
    end
    player:setStorageValue(55555, os.time() + 3) -- last...
I'm pretty sure that a higher value for cooldown and a lower value for groupcooldown would give the effect you're looking for.
Why don't you start with the default xml from TFS 1.3 and change the cooldown to fit your needs?
XML:
<instant group="attack" spellid="24" name="Hell's Core" words="exevo gran mas flam" level="60" mana="1100" premium="1" cooldown="40000" groupcooldown="4000" selftarget="1" needlearn="0" script="attack/hell's_core.lua">
    <vocation name="Sorcerer" />
    <vocation name="Master Sorcerer" />
</instant>
 
I'm pretty sure that a higher value for cooldown and a lower value for groupcooldown would give the effect you're looking for.
Why don't you start with the default xml from TFS 1.3 and change the cooldown to fit your needs?
XML:
<instant group="attack" spellid="24" name="Hell's Core" words="exevo gran mas flam" level="60" mana="1100" premium="1" cooldown="40000" groupcooldown="4000" selftarget="1" needlearn="0" script="attack/hell's_core.lua">
    <vocation name="Sorcerer" />
    <vocation name="Master Sorcerer" />
</instant>

I have changed values to:
Code:
    <instant group="attack" spellid="24" name="Hell's Core" words="exevo gran mas flam" level="60" mana="1100" premium="1" cooldown="3000" groupcooldown="30000" selftarget="1" needlearn="0" script="attack/hell's_core.lua">
        <vocation name="Sorcerer" />
        <vocation name="Master Sorcerer" />
    </instant>

And i can spam UE for 3 seconds, when i set it back to:
Code:
    <instant group="attack" spellid="24" name="Hell's Core" words="exevo gran mas flam" level="60" mana="1100" premium="1" cooldown="30000" groupcooldown="3000" selftarget="1" needlearn="0" script="attack/hell's_core.lua">
        <vocation name="Sorcerer" />
        <vocation name="Master Sorcerer" />
    </instant>
Then i cannot use any other spells and runes for 30 seconds

In config.lua i have
Code:
-- Item Usage
timeBetweenActions = 200
timeBetweenExActions = 1000

Any ideas?
 
Groupcooldown was removed, because 8.6 had unified cooldowns for everything and group of spells didnt exist.
 
Then i copy backup of folder Spells from your repository @Nekiro and run server and again i have cooldown after use "exevo gran mas flam", cannot use other spells and runes, only heal and haste spells i can use. It is something wrong with my spells... and i dont have idea what is wrong...

EDIT:
Today i installed a clean tfs 1.3 compiled by @Nekiro and run it. It is problem with spells and runes on his repo and no idea how to fix it.


EDIT2:
I have combined with aggressive="0" and now it is looking like:
Code:
<rune group="attack" name="Sudden Death Rune" id="2268" allowfaruse="1" charges="3" level="45" magiclevel="15" aggressive="0" cooldown="2000" needtarget="1" blocktype="solid" script="attack/sudden_death_rune.lua" />
But the problem now is i can use SD rune instant after ue ^^ i want now make delay after ue like 2 seconds...
Any ideas?
 
Last edited:
Still have this problem
How to change cooldown for every spells? tried modify spells.xml but working weird.
Delete cooldown, make it "0" and make in every spell cooldown as you want like that:

Code:
function onCastSpell(cid, var)
    if player:getStorageValue(55555) >= os.time() then
    player:sendTextMessage(MESSAGE_STATUS_SMALL, "You are exhausted")
        return true
    end
    player:setStorageValue(55555, os.time() + 3) -- last number "3"  is the cooldown in seconds
addEvent(doCombat, 100, cid.uid, combat, var)
    return true
end
 
Delete cooldown, make it "0" and make in every spell cooldown as you want like that:

Code:
function onCastSpell(cid, var)
    if player:getStorageValue(55555) >= os.time() then
    player:sendTextMessage(MESSAGE_STATUS_SMALL, "You are exhausted")
        return true
    end
    player:setStorageValue(55555, os.time() + 3) -- last number "3"  is the cooldown in seconds
addEvent(doCombat, 100, cid.uid, combat, var)
    return true
end

Here is my Hell's Core.lua:
Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
combat:setArea(createCombatArea(AREA_CIRCLE5X5))

function onGetFormulaValues(player, level, magicLevel)
    local min = (level / 5) + (magicLevel * 8) + 50
    local max = (level / 5) + (magicLevel * 12) + 75
    return -min, -max
end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(creature, variant)
    return combat:execute(creature, variant)
end

How to modify that?

same for SD rune:
Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)

function onGetFormulaValues(player, level, magicLevel)
    local min = (level / 5) + (magicLevel * 4.3) + 32
    local max = (level / 5) + (magicLevel * 7.4) + 48
    return -min, -max
end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(creature, variant, isHotkey)
    return combat:execute(creature, variant)
end
 
Groupcooldown was removed, because 8.6 had unified cooldowns for everything and group of spells didnt exist.

This is good to know. For me 8.6 is about a favored era in aesthetics, and any features that theoretically could have been modded in back then shouldn't be removed.

Would be interesting to do 🤔
8.6 protocol, but maxed out forward features, and client spr and items.otb built with a "anything that can be ported back, will be" mindset.

Available cip client binary patches for effects, mp, hp, etc to be expected by default. Yep. That sounds about the ideal baseline.
 
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
combat:setArea(createCombatArea(AREA_CIRCLE5X5))

function onGetFormulaValues(player, level, magicLevel)
    local min = (level / 5) + (magicLevel * 8) + 50
    local max = (level / 5) + (magicLevel * 12) + 75
    return -min, -max
end
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")



function onCastSpell(creature, variant)
    if player:getStorageValue(55555) >= os.time() then
    player:sendTextMessage(MESSAGE_STATUS_SMALL, "You are exhausted")
        return true
    end
    player:setStorageValue(55555, os.time() + 3) -- last number "3"  is the cooldown in seconds
    return combat:execute(creature, variant)
end
 
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
combat:setArea(createCombatArea(AREA_CIRCLE5X5))

function onGetFormulaValues(player, level, magicLevel)
    local min = (level / 5) + (magicLevel * 8) + 50
    local max = (level / 5) + (magicLevel * 12) + 75
    return -min, -max
end
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")



function onCastSpell(creature, variant)
    if player:getStorageValue(55555) >= os.time() then
    player:sendTextMessage(MESSAGE_STATUS_SMALL, "You are exhausted")
        return true
    end
    player:setStorageValue(55555, os.time() + 3) -- last number "3"  is the cooldown in seconds
    return combat:execute(creature, variant)
end

Not working...

Code:
Lua Script Error: [Spell Interface]
data/spells/scripts/attack/hell's_core.lua:onCastSpell
data/spells/scripts/attack/hell's_core.lua:16: attempt to index global 'player' (a nil value)
stack traceback:
        [C]: in function '__index'
        data/spells/scripts/attack/hell's_core.lua:16: in function <data/spells/scripts/attack/hell's_core.lua:15>
 
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
combat:setArea(createCombatArea(AREA_CIRCLE5X5))

function onGetFormulaValues(player, level, magicLevel)
    local min = (level / 5) + (magicLevel * 8) + 50
    local max = (level / 5) + (magicLevel * 12) + 75
    return -min, -max
end
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")



function onCastSpell(creature, variant)
    local player = Player(creature)
    if player:getStorageValue(55555) >= os.time() then
    player:sendTextMessage(MESSAGE_STATUS_SMALL, "You are exhausted")
        return true
    end
    player:setStorageValue(55555, os.time() + 3) -- last number "3"  is the cooldown in seconds
    return combat:execute(creature, variant)
end
 
Solution
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
combat:setArea(createCombatArea(AREA_CIRCLE5X5))

function onGetFormulaValues(player, level, magicLevel)
    local min = (level / 5) + (magicLevel * 8) + 50
    local max = (level / 5) + (magicLevel * 12) + 75
    return -min, -max
end
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")



function onCastSpell(creature, variant)
    local player = Player(creature)
    if player:getStorageValue(55555) >= os.time() then
    player:sendTextMessage(MESSAGE_STATUS_SMALL, "You are exhausted")
        return true
    end
    player:setStorageValue(55555, os.time() + 3) -- last number "3"  is the cooldown in seconds
    return combat:execute(creature, variant)
end
Right, forgot that :D
 
Back
Top