• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

TFS 1.0 wand give more damage for level and magic level

Devlinn

Member
Joined
Mar 25, 2015
Messages
295
Reaction score
6
hi otland
someone have or can help to create
wand give more damage for level and magic level
shotype="fire"
work on all monster if posible
min damage 500
max 1000
 
Last edited:
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)
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 200, with magic level 80)
Code:
min = ((200 * 2.5 + 80 * 3) * 5)
max = ((200 * 2.5 + 80 * 3) * 10)
math.random(3700, 7400)
(example damage for level 20, with magic level 10)
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
 
Last edited by a moderator:
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)
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 200, with magic level 80)
Code:
min = ((200 * 2.5 + 80 * 3) * 5)
max = ((200 * 2.5 + 80 * 3) * 10)
math.random(3700, 7400)
(example damage for level 20, with magic level 10)
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

how to use? im newbie on lua
i create wand.lua and add on action.xml
 
bumppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
 
Since @Xikini has explained the formulas, here is the code you can play around with:
Code:
    <wand id="WANDID" level="100" mana="20" min="30" max="50" type="fire" script="customWand.lua" />
        <vocation name="Druid" />
        <vocation name="Sorcerer" />
    </wand>


Code:
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

Hint you put this code, in weapons folder.
 
Back
Top