math.random(min, max)
math.random(500, 1000)
min = ((level * x + magic level * y) * z)
max = ((level * x + magic level * y) * zz)
math.random(min, max)
min = ((level * 2.5 + magic level * 3) * 5)
max = ((level * 2.5 + magic level * 3) * 10)
math.random(min, max)
min = ((200 * 2.5 + 80 * 3) * 5)
max = ((200 * 2.5 + 80 * 3) * 10)
math.random(3700, 7400)
min = ((20 * 2.5 + 10 * 3) * 5)
max = ((20 * 2.5 + 10 * 3) * 10)
math.random(400, 800)
-- 0.3.7 tfs example.
min = (getPlayerLevel(cid) * cfg.level + getPlayerMagLevel(cid) * cfg.magic) * cfg.min
max = (getPlayerLevel(cid) * cfg.level + getPlayerMagLevel(cid) * cfg.magic) * cfg.max
Go to the wand script in weapons.. and just change the damage formula
(I'm not well versed in 1.x+ soo just take this below with a grain of salt.)
Current damage formula (most likely)
Code:math.random(min, max)Code:math.random(500, 1000)
New damage formula.
Code:min = ((level * x + magic level * y) * z) max = ((level * x + magic level * y) * zz) math.random(min, max)(example damage for level 200, with magic level 80)Code:min = ((level * 2.5 + magic level * 3) * 5) max = ((level * 2.5 + magic level * 3) * 10) math.random(min, max)
(example damage for level 20, with magic level 10)Code:min = ((200 * 2.5 + 80 * 3) * 5) max = ((200 * 2.5 + 80 * 3) * 10) math.random(3700, 7400)
Code:min = ((20 * 2.5 + 10 * 3) * 5) max = ((20 * 2.5 + 10 * 3) * 10) math.random(400, 800)
Obviously change multipliers to what you want, but just do it that way.
Code:-- 0.3.7 tfs example. min = (getPlayerLevel(cid) * cfg.level + getPlayerMagLevel(cid) * cfg.magic) * cfg.min max = (getPlayerLevel(cid) * cfg.level + getPlayerMagLevel(cid) * cfg.magic) * cfg.max
<wand id="WANDID" level="100" mana="20" min="30" max="50" type="fire" script="customWand.lua" />
<vocation name="Druid" />
<vocation name="Sorcerer" />
</wand>
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE)
function onGetFormulaValues(player, level, maglevel)
local min = (level / 5) + (maglevel * 1.2) + 7
local max = (level / 5) + (maglevel * 2) + 12
return -min, -max
end
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onUseWeapon(player, var)
return combat:execute(player, var)
end