Hello all,
I wish ask you if could you improve and fix it.
I wish ask you if could you improve and fix it.
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
function onGetFormulaValues(cid, level, maglevel)
min = -(level * 22) / 10
max = -(level * 38.5) / 10
return min, max
end
function onCastSpell(cid, var)
local sword = getPlayerSkill(cid,2)
local axe = getPlayerSkill(cid,3)
local club = getPlayerSkill(cid,1)
if sword < axe then local skill = axe
else
local skill = sword
elseif sword < club then local skill = club
end
local combat = math.random(min, max)
setCombatFormula(combat, var)
local arr = {
{0, 0, 0, 0, 0},
{0, 1, 1, 1, 0},
{0, 1, 2, 1, 0},
{0, 1, 1, 1, 0},
{0, 0, 0, 0, 0}
}
local area = createCombatArea(arr)
setCombatArea(combat, area)
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
end