• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

onGetFormulaValues in global.lua

trollebror

Developer
Joined
Aug 8, 2009
Messages
362
Reaction score
58
Location
Sweden, Linköping
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")
 
Back
Top