Hi everyone, this spell has a kind of error that I can not fix, can you help me?
erro:
script:
erro:
[18:6:45.812] [Error - Spell Interface]
[18:6:45.821] data/spells/scripts/attack/exevo gran mas cold.luanCastSpell
[18:6:45.853] Description:
[18:6:45.861] data/spells/scripts/attack/exevo gran mas cold.lua:23: bad argument #1 to 'random' (interval is empty)
[18:6:45.881] stack traceback:
[18:6:45.890] [C]: in function 'random'
[18:6:45.914] data/spells/scripts/attack/exevo gran mas cold.lua:23: in function <data/spells/scripts/attack/exevo gran mas cold.lua:5>
script:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -50.0, -1500, -30.0, -1800)
function onCastSpell(cid, var)
if getPlayerStorageValue(cid, 10569) == 1 then
doSendAnimatedText((getCreaturePosition(cid)), "Socorro!", 255)
doSendMagicEffect(getCreaturePosition(cid), 19)
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return false
end
if getPlayerStorageValue(cid, 23066) < os.time () then
setPlayerStorageValue(cid, 23066, 9) -- 9 = 9 segundos
local cooldown = 10
local playerpos = getCreaturePosition(cid)
local target = getCreatureTarget(cid)
local trapos = getCreaturePosition(target)
local level = getPlayerMagLevel(cid)
local numero1 = (level*99.99) -- Dano Mínimo
local numero2 = (level*99.99) -- Dano Máximo
for i = numero1, numero2 do
levelz = (math.random(numero2))
end
function mascold(cid)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "CD: Exevo Gran Mas Cold.")
end
mana1 = (10*getCreatureMaxMana(cid)/100 +300)
mana = math.ceil(mana1)
doPlayerAddMana(cid,mana)
doCreatureAddMana(target, -levelz)
doSendAnimatedText(trapos, levelz, 29)
doCreatureAddMana(cid, levelz)
doCreatureAddMana(cid, -0) -- Quanto Vai Gastar de Mana
doSendMagicEffect(trapos, 41)
doSendMagicEffect(playerpos, 41)
doSendAnimatedText(getThingPos(cid),"Drainage!",29)
doSendDistanceShoot(trapos, playerpos, 28)
if exhaustion.check(cid, 23066) == false then
exhaustion.set(cid, 23066, cooldown)
addEvent(mascold, cooldown*1000, cid)
return doCombat(cid, combat, var)
else
doSendMagicEffect(getCreaturePosition(cid), 2)
doPlayerSendCancel(cid, "Golpe em cooldown por " ..exhaustion.get(cid, 23066).." segundos")
return false
end
return doCombat(cid, combat, var)
end
end