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

Lua help with this spell

lalovega

New Member
Joined
Nov 4, 2008
Messages
85
Reaction score
1
Code:
local combat = createCombatObject() 
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_MANADRAIN) 
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_LIFEDRAIN)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 40) 
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0) 
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1) 

function onGetFormulaValues(cid, level, maglevel) 
min = 1450
max = 1800

return min, max 
end 

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues") 

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

hi guys, this is a hp and mana rune at the same time but it doesnt add mana just hp where is the error in the script? rep ++
 
Try:
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_TARGETCASTERORTOPMOST, TRUE)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)

function onCastSpell(cid, var)
local minimum, maximum = 100, 200
local heal = math.random(minimum, maximum)
    doCreatureAddHealth(cid, heal)
    doCreatureAddMana(cid, heal)
    return doCombat(cid, combat, var)
end
 
Last edited:
Try:
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_TARGETCASTERORTOPMOST, TRUE)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)

function onCastSpell(cid, var)
local minimum, maximum = 100, 200
    doCreatureAddHealth(cid, math.ceil(math.random(minimmum, maximum)))
    doCreatureAddMana(cid, math.ceil(math.random(minimmum, maximum)))
    return doCombat(cid, combat, var)
end
it doesnt work heres the error:

bad argument #1 to `random` number expected, got nil
stack traceback
[c]: in function random
 
Back
Top