sharpy
New Member
- Joined
- Jan 4, 2010
- Messages
- 77
- Reaction score
- 0
I am trying to make a new wand script using this code:
what I need to know is, if there is a way to set a maximum amount that min and max could be?
I tried making the script like this:
it doesn't return any errors however it only returns low and high for min and max and ignores the max limits I set..
does anyone know if this is possible or what i am doing wrong?
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLHOLY)
function onGetFormulaValues(cid, level, maglevel)
min = -(level * 1 + maglevel * 1) * 1
max = -(level * 2 + maglevel * 2) * 2
return min, max
end
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onUseWeapon(cid, var)
return doCombat(cid, combat, var)
end
what I need to know is, if there is a way to set a maximum amount that min and max could be?
I tried making the script like this:
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLHOLY)
function onGetFormulaValues(cid, level, maglevel)
low = -(level * 1 + maglevel * 1) * 1
high = -(level * 2 + maglevel * 2) * 2
if low > -100 then
min = -100
elseif low <= -100 then
min = low
end
if high > -300 then
max = -300
elseif high <= -300 then
max = high
end
return min, max
end
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onUseWeapon(cid, var)
return doCombat(cid, combat, var)
end
it doesn't return any errors however it only returns low and high for min and max and ignores the max limits I set..
does anyone know if this is possible or what i am doing wrong?
Last edited: