• 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!

how to balance a weapon betwen mage and paladin

darknelson

Member
Joined
Jun 19, 2011
Messages
190
Solutions
1
Reaction score
15
on my server paladins are hitting very hard but mages dont

here are two weapons

teach me please how i can make a right calcule to nivelate it

this is sd wand

LUA:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)

function onGetFormulaValues(player, level, maglevel)
    local min = (level / 2) + (maglevel * 1.3) + 12
    local max = (level / 5) + (maglevel * 4.4) + 18
    return -min, -max
end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

 function onUseWeapon(player, variant)
     return combat:execute(player, variant)
 end

XML:
    <item id="25422" article="a" name="Ferumbras' staff">
        <attribute key="weight" value="2900" />
        <attribute key="description" value="It is made of platinum and emeralds and topped by a large F made of gold." />
        <attribute key="weaponType" value="wand" />
        <attribute key="shootType" value="death" />
        <attribute key="magiclevelpoints" value="4" />
        <attribute key="range" value="10" />
    </item>

and this is the slingshot for paladin

LUA:
local area = createCombatArea({
     {0, 1, 1, 1, 0},
     {1, 1, 1, 1, 1},
     {1, 1, 3, 1, 1},
    {1, 1, 1, 1, 1},
    {0, 1, 1, 1, 0},
 })
 
 local combat = Combat()
 combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
 combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ENERGYHIT)
 combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_CRYSTALLINEARROW)
 combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
 combat:setFormula(COMBAT_FORMULA_SKILL, 0, 0, 1, 0)
 combat:setArea(area)
 
 function onUseWeapon(player, variant)
     return combat:execute(player, variant)
 end

XML:
    <item id="5907" article="a" name="slingshot">
        <attribute key="description" value="A hermit near Carlin might be able to tell you more about it." />
        <attribute key="weight" value="220" />
        <attribute key="attack" value="120" />
        <attribute key="elementDeath" value="2" />
        <attribute key="maxHitChance" value="100" />
        <attribute key="weaponType" value="distance" />
        <attribute key="shootType" value="redstar" />
        <attribute key="range" value="5" />
        <attribute key="imbuingSlots" value="3" />
    </item>


and this is knight weapon

XML:
    <item id="24827" article="an" name="ogre klubba">
        <attribute key="weight" value="7900" />
        <attribute key="defense" value="25" />
        <attribute key="weaponType" value="club" />
        <attribute key="attack" value="120" />
        <attribute key="elementDeath" value="2" />
                <attribute key="imbuingSlots" value="3" />
    </item>



how i can make a calcule to nivelate it ?
 
You should calculate and test it by yourself in order to balance vocations/weapons.
First one for the wands.
LUA:
function onGetFormulaValues(player, level, maglevel)
    local min = (level / 2) + (maglevel * 1.3) + 12
    local max = (level / 5) + (maglevel * 4.4) + 18
    return -min, -max
end
Min is the minimum damage can be dealt and you replace level/maglevel with the level/magic level in-game to know the exact damage.
Max is the maximum damage can be dealt and you replace level/maglevel with the level/magic level in-game to know the exact damage.
For second one the distance weapons
LUA:
combat:setFormula(COMBAT_FORMULA_SKILL, 0, 0, 1, 0)
LUA:
combat:setFormula(COMBAT_FORMULA_SKILL, min1, min2, max1, max2)
min2 = minimum damage can be dealt.
Normal weapon (damage/attack)+skills calculated* max1+max2 = maxmium damage can be dealt
min1 is not working I think so.
For the knight weapon I think it works like real Tibia
XML:
<attribute key="attack" value="120" />
which can be calculated here
I suggest using this formula for Distance/melee weapons.
LUA:
function onGetFormulaValues(cid, level, skill, attack, factor)
    local skillTotal, levelTotal = skill + attack, level / 5
    return -(skillTotal * 0.5 + levelTotal), -(skillTotal * 1.5 + levelTotal)
end
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
to calculate it just replace
skillTotal with players' skills+weapon attack
levelTotal with players' level/5
First one is minimum damage and second one is maximum damage.
You can also do some changes in vocations.xml to increase/reduce damage.
by changing those
meleeDamage="1.0" distDamage="1.0" wandDamage="1.0" magDamage="1.0"
For TFS 0.4
and only those
meleeDamage="1.0" distDamage="1.0"
For TFS 1.3/1.2
 
Last edited:
Back
Top