Lyky
Well-Known Member
- Joined
- May 27, 2014
- Messages
- 295
- Solutions
- 8
- Reaction score
- 89
Hi,
I was trying endlessly to include distance skill and attack value of the burst arrows to stack together with magic level in the formula
Here is my attempts:
I'm getting following error
Lua Script Error: [Weapon Interface]
in callback: data/weapons/scripts/explosive_arrow.lua
nGetFormulaValues
(Unknown scriptfile)
data/weapons/scripts/explosive_arrow.lua:11: attempt to perform arithmetic on lo
cal 'skill' (a nil value)
I was trying endlessly to include distance skill and attack value of the burst arrows to stack together with magic level in the formula
Here is my attempts:
LUA:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, 1)
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_BURSTARROW)
local area = createCombatArea( { {1, 1, 1}, {1, 3, 1}, {1, 1, 1} } )
combat:setArea(area)
function onGetFormulaValues(cid, level, maglevel, skill, attack, factor)
local skillTotal = skill * attack, Player(cid):getLevel() / 5
min = 0
max = -((level * 2) + (maglevel * 3) + (skillTotal * 2)) * 0.6
return min, max
end
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onUseWeapon(player, var)
return combat:execute(player, var)
end
I'm getting following error
Lua Script Error: [Weapon Interface]
in callback: data/weapons/scripts/explosive_arrow.lua
(Unknown scriptfile)
data/weapons/scripts/explosive_arrow.lua:11: attempt to perform arithmetic on lo
cal 'skill' (a nil value)