• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Exhausted

Black123

New Member
Joined
Nov 17, 2011
Messages
32
Reaction score
0
I want to do combo system.
When i use spell then i can use 2nd, 3rd with low cd.. But i cant find system/script.
TFS 0.3.6.pl1 8.54
 
Is it just spells with high exhaustion vs spells with low exhaustion?
So for example a spell with 10 seconds exhaustion, then you can still do spells with 2 seconds exhaustion?

You can set the exhaustion of the spells with high exhaustion to 0 in spells.xml, then add exhaustion in the Lua script, so it uses a different exhaustion.

Under function onCastSpell(cid, var)
Code:
if exhaustion.check(cid, 45353) then
     doPlayerSendCancel(cid, "You are still exhausted for "..exhaustion.get(cid, 45353).." seconds.")
     doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
     return false
end
exhaustion.set(cid, 45353, 10)
 
I did it, but after using spell with 10s exh i have communicate " You are exhausted." and anyway i have to w8 about 2s to use other spell.
In 2nd spell i change sotrage and time to 2s. And every 2 use this 2nd spell with 2s exh didnt show magic effect + dont do dmg ;/

1st spell:
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 19)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_NONE)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -2.2, -190, -2.5, -250)

local function delayedTeleport(cid, position)
if(not isCreature(cid)) then return true end
doTeleportThing(cid, position)
return true
end

function onCastSpell(cid, var)
if exhaustion.check(cid, 45353) then
     doPlayerSendCancel(cid, "You are still exhausted for "..exhaustion.get(cid, 45353).." seconds.")
     doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
     return false
end
exhaustion.set(cid, 45353, 10)
addEvent(delayedTeleport, 500, cid, getCreaturePosition(cid))
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
doTeleportThing(cid, getThingPos(variantToNumber(var)), true)
return doCombat(cid, combat, var)
end
2nd spell:
Code:
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat1, COMBAT_PARAM_EFFECT, 165)
setCombatFormula(combat1, COMBAT_FORMULA_LEVELMAGIC, -1.2, 0, -2.5, 0)

local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 35)
setCombatFormula(combat2, COMBAT_FORMULA_LEVELMAGIC, -1.8, -100, -2.5, -120)

arr1 = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
}

arr2 = {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 2, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
}




local area1 = createCombatArea(arr1)
local area2 = createCombatArea(arr2)
setCombatArea(combat1, area1)
setCombatArea(combat2, area2)

local function onCastSpell1(parameters)
    doCombat(parameters.cid, combat1, parameters.var)
end

local function onCastSpell2(parameters)
    doCombat(parameters.cid, combat2, parameters.var)
end




function onCastSpell(cid, var)
if exhaustion.check(cid, 45354) then
     doPlayerSendCancel(cid, "You are still exhausted for "..exhaustion.get(cid, 45353).." seconds.")
     doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
     return false
end
exhaustion.set(cid, 45354, 2)
local parameters = { cid = cid, var = var}
addEvent(onCastSpell1, 1, parameters)
addEvent(onCastSpell2, 1, parameters)
return true
end
i saw this error:
Code:
30/12/2014 20:21:18] [Error - Spell Interface] 
[30/12/2014 20:21:18] data/spells/scripts/naruto/oiroke.lua:onCastSpell
[30/12/2014 20:21:18] Description: 
[30/12/2014 20:21:18] data/spells/scripts/naruto/oiroke.lua:60: attempt to concatenate a boolean value
[30/12/2014 20:21:18] stack traceback:
[30/12/2014 20:21:18]     data/spells/scripts/naruto/oiroke.lua:60: in function <data/spells/scripts/naruto/oiroke.lua:58>
 
Last edited:
Set the exhaustion of the spell with the 10 seconds in spells.xml to 0.
I don't understand what you mean with the second line, is there something wrong with the spell script?

You can keep the exhaustion of the low exhaustion spells in spells.xml (so not in the Lua script), unless the exhaustion should be different when using other spells aswell.

The numbers in the exhaustion should be the same, atm the one from exhaustion.get is different in the second spell.
 
Last edited:
I did exh in spell.xml to 0 ;/
@edit
After set the same exh storage in both spells, after use 1 i cant use 2nd cuz it's showing exh from 1st spel ;/


@edit2
i set other storage and it's work :) anyway it's better than high exh :>
 
Last edited:
Back
Top