I wanna control damages in LUA scripts like
How to check if player attack mode is offencive,balanced and defensive like this script?
How to check if player attack mode is offencive,balanced and defensive like this script?
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
function onGetFormulaValues(cid, level, skill, attack, factor)
local formulamin = 0.01
local formulamax = 0.02
if player fight mode == offensive then
formulamin = formulamin * 3
formulamax = formulamax * 3
elseif player fight mode == balanced then
formulamin = formulamin * 2
formulamax = formulamax * 2
elseif player fight mode == defensive then
formulamin = formulamin * 1
formulamax = formulamax * 1
min = ((formulamin) * (attack) * (skill)) * -1
max = ((formulamax) * (attack) * (skill)) * -1
return min, max
end
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
function onUseWeapon(cid, var)
return doCombat(cid, combat, var)
end