Hello guys,
Can you help me with 1 script? I have no idea how to fix it. I need to change type of damage for diffrent vocations with the same wand, it is not the ptoblem. Problem is I have no idea how to change attack range for diffrent vocations. I wrote this and I have no idea what next:
Any ideas?
Can you help me with 1 script? I have no idea how to fix it. I need to change type of damage for diffrent vocations with the same wand, it is not the ptoblem. Problem is I have no idea how to change attack range for diffrent vocations. I wrote this and I have no idea what next:
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HOLYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_HOLY)
local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
function onGetFormulaValues(cid, level, skill, attack, factor)
min = -100
max = -175
return min, max
end
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
function onGetFormulaValues2(cid, level, skill, attack, factor)
local fist = getPlayerSkillLevel(cid, 0)
min = - fist
max = - 1.5 * fist
return min, max
end
setCombatCallback(combat2, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues2")
function onUseWeapon(cid, var)
local pozycja = getCreaturePosition(cid)
local cel = getCreatureTarget(cid)
local pozycja2 = getCreaturePosition(cel)
if getPlayerVocation(cid) == 4 then
return doCombat(cid, combat, var)
else
return doCombat(cid, combat2, var)
-- I need to change range for combat 2, in items.xml I set 3 range
end
end