Struvim
New Member
- Joined
- Aug 22, 2021
- Messages
- 5
- Reaction score
- 0
Cause problems when inserting inside a function?
Ex:
Ex:
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
combat:setParameter(COMBAT_PARAM_USECHARGES, true)
combat:setArea(createCombatArea(AREA_SQUARE1X1))
function onGetFormulaValues(player, skill, attack, factor)
local min = (player:getLevel() / 5) + (skill * attack * 0.06) + 13
local max = (player:getLevel() / 5) + (skill * attack * 0.11) + 27
return -min, -max
end
combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
function onCastSpell(creature, variant)
local armor = true --example
if armor then
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
--have problem?
end
return combat:execute(creature, variant)
end