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

Solved Spells exhaustion

sirspray

New Member
Joined
Dec 15, 2012
Messages
93
Reaction score
2
Location
Sweden
Hello i have an "bug" and i dont know how to fix it i dont see whats wrong. So lets get to it, When someone does like exevo gran mas frigo/flam and that why dosent it work to make an mwall after or firebomb? i need to wait the x exhaustion time on the spell then i can do the mwall or firebomb or the other runes would be glad to get help with this error!
 
why would you bump and ignore his response?
since you didn't post your tfs version, i'll assume you're using 1.x
im pretty sure in 1.x you can use spell groups, which can help separate cooldowns for things
can have group="1" for example on your runes, and group="2" for your ue spells
 
why would you bump and ignore his response?
since you didn't post your tfs version, i'll assume you're using 1.x
im pretty sure in 1.x you can use spell groups, which can help separate cooldowns for things
can have group="1" for example on your runes, and group="2" for your ue spells

I did ignore his message because it isnt right and no im using tfs 0.4
 
Lua:
   local config = {
       storage = 11112,
       cooldown = 60
   }
    if(os.time() - getPlayerStorageValue(cid, config.storage)) < config.cooldown then
       doPlayerSendCancel(cid, "You can use it just one time every 60 sec.")
       doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
       return false
   end

Put this under onCastSpell

and add this too

Lua:
    setPlayerStorageValue(cid, config.storage, os.time())

then change the exhastion time in spells.xml with "1000"

and done xD

EDIT: You can change the storage if you want xD
and the coultdown too xD :p
 
Lua:
   local config = {
       storage = 11112,
       cooldown = 60
   }
    if(os.time() - getPlayerStorageValue(cid, config.storage)) < config.cooldown then
       doPlayerSendCancel(cid, "You can use it just one time every 60 sec.")
       doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
       return false
   end

Put this under onCastSpell

and add this too

Lua:
    setPlayerStorageValue(cid, config.storage, os.time())

then change the exhastion time in spells.xml with "1000"

and done xD

EDIT: You can change the storage if you want xD
and the coultdown too xD :p

i dont find any "oncastspell" in my doucment and i have tfs 0.4
 
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
setHealingFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 10, 12)

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

Lua:
function onCastSpell(cid, var)

and here a explain how it should look like

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
setHealingFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 10, 12)

function onCastSpell(cid, var)
  local config = {
       storage = 11112,
       cooldown = 60
   }
    if(os.time() - getPlayerStorageValue(cid, config.storage)) < config.cooldown then
       doPlayerSendCancel(cid, "You can use it just one time every 60 sec.")
       doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
       return false
   end
       setPlayerStorageValue(cid, config.storage, os.time())
    return doCombat(cid, combat, var)
end
 
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
setHealingFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 10, 12)

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

Lua:
function onCastSpell(cid, var)

and here a explain how it should look like

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
setHealingFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 10, 12)

function onCastSpell(cid, var)
  local config = {
       storage = 11112,
       cooldown = 60
   }
    if(os.time() - getPlayerStorageValue(cid, config.storage)) < config.cooldown then
       doPlayerSendCancel(cid, "You can use it just one time every 60 sec.")
       doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
       return false
   end
       setPlayerStorageValue(cid, config.storage, os.time())
    return doCombat(cid, combat, var)
end

dosent work :/
 
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
setAttackFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 6, 17)


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

function onCastSpell(cid, var)
  local config = {
       storage = 11112,
       cooldown = 6
   }
    if(os.time() - getPlayerStorageValue(cid, config.storage)) < config.cooldown then
       doPlayerSendCancel(cid, "You can use it just one time every 6 sec.")
       doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
       return false
   end
setPlayerStorageValue(cid, config.storage, os.time())
return doCombat(cid, combat, var)
end

Keep in mind to change the exhastion time to 1000 instead of 6000

change exhastion in Spells.xml!

Thanks to Hashirama479!
 
why would you bump and ignore his response?
since you didn't post your tfs version, i'll assume you're using 1.x
im pretty sure in 1.x you can use spell groups, which can help separate cooldowns for things
can have group="1" for example on your runes, and group="2" for your ue spells
could you give me an example to make it work as in old versions example uh exura vita + exori vis etc?
 
Back
Top