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

Attack formula.

masterqwerty

New Member
Joined
Mar 25, 2012
Messages
20
Reaction score
0
Hello Otlanders! I have a problem. In my tfs 0.3.6pl1 attacks are dependent on the skill's/ magic level. How can I change that on formula- "level+skill+weapon attack"?

Thank you and best regards!
 
take a look at exori hur spell and take it as a base:
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, true)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_WEAPONTYPE)
setCombatParam(combat, COMBAT_PARAM_USECHARGES, true)

function onGetFormulaValues(cid, level, skill, attack, factor)
	local skillTotal, levelTotal = skill + attack, level / 5
	return -(skillTotal / 3 + levelTotal), -(skillTotal + levelTotal)
end

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

Where:
Lua:
function onGetFormulaValues(cid, level, skill, attack, factor)
	local skillTotal, levelTotal = skill + attack, level / 5
	return -(skillTotal / 3 + levelTotal), -(skillTotal + levelTotal)
end
Is the dmg formula.
 
Thanks for your help, but not about hit from spells. I want to modify melee damage from weapon- sword etc. Probably I need to modify source but I do not know what and where. :)
 
Back
Top