trollebror
Developer
Hello!
Does anyone know how to put a combat object with a onGetFormulaValues-callback in the global.lua? Putting a combat object in global.lua is no problem, but when adding the callback to the combat-object all hell break loose.
I'm getting this error:
>> Loading script systems
[Warning - CallBack::loadCallBack] Event onGetFormulaValuesSpecial not found.
Example code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
function onGetFormulaValuesSpecial(cid, level, maglevel)
min = ((level / 5) + (maglevel * 6.3) + 45)
max = ((level / 5) + (maglevel * 14.4) + 90)
return min, max
end
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValuesSpecial")
Does anyone know how to put a combat object with a onGetFormulaValues-callback in the global.lua? Putting a combat object in global.lua is no problem, but when adding the callback to the combat-object all hell break loose.
I'm getting this error:
>> Loading script systems
[Warning - CallBack::loadCallBack] Event onGetFormulaValuesSpecial not found.
Example code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
function onGetFormulaValuesSpecial(cid, level, maglevel)
min = ((level / 5) + (maglevel * 6.3) + 45)
max = ((level / 5) + (maglevel * 14.4) + 90)
return min, max
end
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValuesSpecial")