function getPlayerReset(cid)
local check = db.getResult("SELECT `reset` FROM `players` WHERE `id`= "..getPlayerGUID(cid))
return check:getDataInt("reset") <= 0 and 0 or check:getDataInt("reset")
end
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HOLYAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_HOLY)
function onGetFormulaValues(cid, level, maglevel)
min = -(level*2.6)*(getResets(cid)+ 5 )
max = -(level*2.6)*(getResets(cid)+ 5 )
return min, max
end
local arr = {
{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, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 2, 1, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 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}
}
local area = createCombatArea(arr)
setCombatArea(combat, area)
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
local resetmin = 1
function onCastSpell(cid, var)
if getPlayerReset(cid) >= resetmin then
doCombat(cid, combat, var)
else
doPlayerSendCancel(cid, "DESCULPA, VOCE NAO TEM ".. resetmin .." RESET PARA USAR ESSA SPELL.")
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
end
return true
end