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

Lua Problem with weapon on hit effect, how to declare it? [weapons.xml]

lynx_

New Member
Joined
Sep 15, 2011
Messages
25
Reaction score
0
Hey.

I wanted to use Paco el Maverick's script that would give a weapon additional on-hit effect - in this case energy damage and cloud effect, but I think this script is very old and I don't know how to declare it in weapons.xml.

This is thunder_hammer.lua located in data/weapons/scripts

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_BIGCLOUDS)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 0, 0, -105)
 
local arr = { 
{0, 0, 0, 0, 0, 0, 0}, 
{0, 0, 0, 0, 0, 0, 0}, 
{0, 0, 1, 1, 1, 0, 0}, 
{0, 0, 1, 3, 1, 0, 0}, 
{0, 0, 1, 1, 1, 0, 0}, 
{0, 0, 0, 0, 0, 0, 0}, 
{0, 0, 0, 0, 0, 0, 0} 
} 
 
local area = createCombatArea(arr) 
setCombatArea(combat, area) 
 
function onUseWeapon(cid, var)
	return doCombat(cid, combat, var)
end

And this is what he proposed to write in weapons.xml
Code:
<melee id="2421" enabled="1" exhaustion="0" hitchance="80" script="thunder_hammer.lua"></melee>

What should I write in weapons.xml to make this melee weapon (ID 2421) use thunder_hammer.lua?
(using tfs 0.3.6)
I know that error is in declaration in weapons.xml, cause thunder_hammer.lua effect worked well when I swapped it with posion arrow effect.

Please, help, giving reputation for help attempts.
 
Last edited:
Back
Top