Anyone out there can help me out with the spell below would be great. I would like to know exactly how I can change each own COMBAT_PARAM_EFFECT to individual tiles (1's in area). For now it's only using effect -> 4 and that's why I would like to change that so each tile has its own effect.
I was thinking of adding a for loop if there is one in lua but I am not sure how
code:
I was thinking of adding a for loop if there is one in lua but I am not sure how
code:
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 4)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ICE)
my_area = {
{0, 1, 0},
{1, 1, 1},
{1, 3, 1},
{1, 1, 1},
{0, 1, 0}
}
local area = createCombatArea(my_area)
setCombatArea(combat, area)
function onGetFormulaValues(cid, level, maglevel)
min = -((level / 5) + (maglevel * 1.2) + 7)
max = -((level / 5) + (maglevel * 2.85) + 16)
return min, max
end
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end