@elielder
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)
local voc_bonus = { -- valor da cura adicional, ex: 0%, 10%, 50%, 100%, 200%
["Tanque"] = 50,
["Suporte"] = 25,
["Dano"] = 0,
}
local table_vocs = { -- last_id é o último id da vocação, a tabela precisa estar em ordem crescente.
[1] = {last_id = 12, voc = "Naruto", classe = "Dano"},
[2] = {last_id = 20, voc = "Sasuke", classe = "Dano"},
[3] = {last_id = 30, voc = "Chouji", classe = "Tanque"},
[4] = {last_id = 40, voc = "Hidan", classe = "Tanque"},
[5] = {last_id = 50, voc = "Hashirama", classe = "Suporte"},
[6] = {last_id = 60, voc = "Obito", classe = "Suporte"},
}
local function getBonus(cid, base)
local pvoc = getPlayerVocation(cid)
for k, _ in ipairs(table_vocs) do
if pvoc <= table_vocs[k].last_id then
bonus = voc_bonus[table_vocs[k].classe]/100 + 1
total = base * bonus
return total
end
end
end
function onGetPlayerMinMaxValues(cid, level, magLevel)
local min = ((level*0)+(magLevel*0)+200)
local max = ((level*0)+(magLevel*0)+250)
return getBonus(cid, min), getBonus(cid, max)
end
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetPlayerMinMaxValues")
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end