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

[Help] Weapon

Cornwallis

Member
Joined
Jan 3, 2010
Messages
480
Reaction score
16
well i made this, which doesn't work ofc :P but what it does is when you attack, it attacks like this; say your level 100, sword skill 50, and attack on your weapon is 2; it'll do 15*50=750*2=1500/10=150 minimum, and max; 20*50=1000*2=2000/10=200 soo, the it's min/max is 150/200 at level 100 if you have sword 50.
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, true)
setCombatParam(combat, COMBAT_PARAM_USECHARGES, true)

function onGetFormulaValues(cid, level, skill, attack, factor)
	return -(level * 0.15 * skill * attack / 10), -(level * 0.15 * skill * attack / 10)
end

setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
function onUseWeapon(cid, var)
	return doCombat(cid, combat, var)
end

Edit; SORRY, 0.3.6pl1
 
Last edited:
LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, true)
setCombatParam(combat, COMBAT_PARAM_USECHARGES, true)

function onGetFormulaValues(cid, level, skill, attack, factor)
	min = (level * 0.15 * skill * attack) / 10
	max = (level * 0.15 * skill * attack) / 7.5
	return -min, -max
end

setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
function onUseWeapon(cid, var)
	return doCombat(cid, combat, var)
end

You formula didn't have a min or a max set, try this one.
 
Last edited:
Back
Top