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

Solved Knight And Paladin Bug with attack dmg

vvglex

New Member
Joined
Jan 2, 2015
Messages
162
Reaction score
2
Hey i have bug with paladins and knights attack dmg ....

sometime they hit like 200 and then suddely 1000 and the attack is never stable they go from 100-1000 every attack how can i make it stable so they hit like 600-800 everytime?
@Limos
 
Did you save it and restarted the server? Post the weapons.xml line of the weapon you are using.
yes and yes!
Code:
        <melee id="7405" level="20" unproperly="1" event="function" value="attack.lua">
        <vocation id="4"/>
        <vocation id="8" showInDescription="1"/>
    </melee>

and my attack.lua
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
function onGetFormulaValues(cid, level, skill, attack, factor)
     min = 0.04 * attack * skill + (level/5)
     max = 0.06 * attack * skill + (level/5)
     return -min, -max
end

setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

function onUseWeapon(cid, var)
    return doCombat(cid, combat, var)
end
 
Last edited by a moderator:
Add a distance effect, so create different scripts for the distance weapons since they have different distance effects.
 
Add a distance effect, so create different scripts for the distance weapons since they have different distance effects.
okay can you give me the distance effect

Add a distance effect, so create different scripts for the distance weapons since they have different distance effects.
is this a good one?
Code:
 setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT)

is this good
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT)
function onGetFormulaValues(cid, level, skill, attack, factor)
     min = 0.04 * attack * skill + (level/5)
     max = 0.06 * attack * skill + (level/5)
     return -min, -max
end

setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

function onUseWeapon(cid, var)
    return doCombat(cid, combat, var)
end
 
Last edited by a moderator:
Back
Top