exhaustion="5000"
exhaust="5000"
Going to need more information then that to help you.
however in spells.xml you can change/add
that's for newer version's 0.3.7Lua:exhaustion="5000"
I believe 0.3.6 is
Lua:exhaust="5000"
if isInRange(getPlayerPosition(cid), {x = 94, y = 111, z = 7}, {x = 96, y = 113, z = 7}) then
-- exhaustion for that certain area
else
-- exhaustion for the rest of your server
end
If it's just for a few spells you could add exhaustion to the lua file of the spell.
Depense on how long you want the exhaustion, but you can use an exhaustion condition like potions have or exhaustion.check/set.
Then you can use inInRange, like this
Lua:if isInRange(getPlayerPosition(cid), {x = 94, y = 111, z = 7}, {x = 96, y = 113, z = 7}) then -- exhaustion for that certain area else -- exhaustion for the rest of your server end
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ICETORNADO)
setAttackFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 6, 12)
local area = createCombatArea(AREA_CROSS5X5)
setCombatArea(combat, area)
function onCastSpell(cid, var)
local time = 15
local time2 = 2
if isInRange(getPlayerPosition(cid), {x = 94, y = 111, z = 7}, {x = 96, y = 113, z = 7}) then
make.exhaustion(cid, storage, time) == true) then
else
make.exhaustion(cid, storage, time2) == true) then
return doCombat(cid, combat, var)
end
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ICETORNADO)
setAttackFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 6, 12)
local area = createCombatArea(AREA_CROSS5X5)
setCombatArea(combat, area)
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ICETORNADO)
setAttackFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 6, 12)
local area = createCombatArea(AREA_CROSS5X5)
setCombatArea(combat, area)
local storage = 2278 -- storage for exhaustion
function onCastSpell(cid, var)
if(exhaustion.check(cid, storage)) then
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
doPlayerSendCancel(cid, "You are exhausted for "..exhaustion.get(cid, storage).." "..(exhaustion.get(cid, storage) == 1 and "second" or "seconds")..".")
return false
end
if(isInRange(getPlayerPosition(cid), {x = 94, y = 111, z = 7}, {x = 96, y = 113, z = 7})) then
exhaustion.set(cid, storage, 15)
end
return doCombat(cid, combat, var)
end
Lua:local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ICETORNADO) setAttackFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 6, 12) local area = createCombatArea(AREA_CROSS5X5) setCombatArea(combat, area) local storage = 2278 -- storage for exhaustion function onCastSpell(cid, var) if exhaustion.check(cid, storage) then doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) doPlayerSendCancel(cid, "You are exhausted for "..exhaustion.get(cid, storage).." "..(exhaustion.get(cid, storage) == 1 and "second" or "seconds")..".") return true end if isInRange(getPlayerPosition(cid), {x = 94, y = 111, z = 7}, {x = 96, y = 113, z = 7}) then exhaustion.set(cid, storage, 15) end return doCombat(cid, combat, var) end
Should have been false instead of true, edited my post.
And about the range, you can make it as big as you want, also with different floors, so if you want for all floors, instead of 7, 0 and 15.
if exhaustion.check(cid, storage) then
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
doPlayerSendCancel(cid, "You are exhausted for "..exhaustion.get(cid, storage).." "..(exhaustion.get(cid, storage) == 1 and "second" or "seconds")..".")
return [COLOR="#FF0000"]false[/COLOR]
end
This is what I changed.
By using return false in a spell, it won't do the exhaustion and mana cost in the spells.xml line.Code:if exhaustion.check(cid, storage) then doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) doPlayerSendCancel(cid, "You are exhausted for "..exhaustion.get(cid, storage).." "..(exhaustion.get(cid, storage) == 1 and "second" or "seconds")..".") return [COLOR="#FF0000"]false[/COLOR] end
local repeatAmount = 1
local deathFlamesArea = {
createCombatArea({
{0, 1, 0},
{1, 2, 1},
{0, 1, 0}
}),
createCombatArea({
{0, 1, 1, 1, 0},
{1, 1, 0, 1, 1},
{1, 0, 2, 0, 1},
{1, 1, 0, 1, 1},
{0, 1, 1, 1, 0}
}),
createCombatArea({
{0, 0, 1, 1, 1, 0, 0},
{0, 1, 0, 0, 0, 1, 0},
{1, 0, 0, 0, 0, 0, 1},
{1, 0, 0, 2, 0, 0, 1},
{1, 0, 0, 0, 0, 0, 1},
{0, 1, 0, 0, 0, 1, 0},
{0, 0, 1, 1, 1, 0, 0}
})
}
local bigFlamesArea = createCombatArea({
{0, 0, 1, 1, 1, 1, 1, 0, 0},
{0, 1, 1, 0, 0, 0, 1, 1, 0},
{1, 1, 0, 0, 0, 0, 0, 1, 1},
{1, 0, 0, 0, 0, 0, 0, 0, 1},
{1, 0, 0, 0, 2, 0, 0, 0, 1},
{1, 0, 0, 0, 0, 0, 0, 0, 1},
{1, 1, 0, 0, 0, 0, 0, 1, 1},
{0, 1, 1, 0, 0, 0, 1, 1, 0},
{0, 0, 1, 1, 1, 1, 1, 0, 0}
})
local deathFlames = {}
for k, area in ipairs(deathFlamesArea) do
deathFlames[k] = createCombatObject()
setCombatParam(deathFlames[k], COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(deathFlames[k], COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
setCombatFormula(deathFlames[k], COMBAT_FORMULA_LEVELMAGIC, -0.493, -40, -0.729, -100)
setCombatArea(deathFlames[k], area)
end
local bigFlames = createCombatObject()
setCombatParam(bigFlames, COMBAT_PARAM_TYPE, COMBAT_ENERGYLDAMAGE)
setCombatParam(bigFlames, COMBAT_PARAM_EFFECT, CONST_ME_BIGCLOUDS)
setCombatFormula(bigFlames, COMBAT_FORMULA_LEVELMAGIC, -0.766, -50, -0.741, -100)
setCombatArea(bigFlames, bigFlamesArea)
function onTargetTile(cid, pos)
doSendDistanceShoot(getCreaturePosition(cid), pos, CONST_ANI_DEATH)
end
setCombatCallback(bigFlames, CALLBACK_PARAM_TARGETTILE, "onTargetTile")
local function castSpellDelay(p)
if(isCreature(p[1]) == TRUE) then
doCombat(unpack(p))
end
end
function onCastSpell(cid, var)
for i = 0, repeatAmount - 1 do
for k, combat in ipairs(deathFlames) do
addEvent(castSpellDelay, (150 * k) + #deathFlames * 150 * i + 700 * i, {cid, combat, var})
end
addEvent(castSpellDelay, (150 * #deathFlames) + #deathFlames * 150 * i + 700 * i, {cid, bigFlames, var})
end
return LUA_NO_ERROR
end
-- so add this the same way, under function onCastSpell, also don't forget local storage
if(exhaustion.check(cid, storage)) then
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
doPlayerSendCancel(cid, "You are exhausted for "..exhaustion.get(cid, storage).." "..(exhaustion.get(cid, storage) == 1 and "second" or "seconds")..".")
return false
end
if(isInRange(getPlayerPosition(cid), {x = 94, y = 111, z = 7}, {x = 96, y = 113, z = 7})) then
exhaustion.set(cid, storage, 15)
end