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

Weapon attack speed!!!!

santin

Lost.Realm->Owner
Joined
Jun 2, 2007
Messages
52
Reaction score
0
Location
Brazil
Hey dudes, i know i know, there is already in TFS 0.3 on items.xml the "attackSpeed" thing.. but the minimum delay is 500 i guess, so you can't become an "Assassin Cross" xD...

Sooooo...

Here is the thing:

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat, COMBAT_FORMULA_SKILL , 0, 0, 1.0, 0)

local function m(parameters)
doCombat(parameters.cid, parameters.combat, parameters.var)
end
	
function onUseWeapon(cid, var)
	local delay = 100
	local seconds = 0
	local parameters = { cid = cid, var = var, combat = combat }
	repeat
		addEvent(m, seconds, parameters)
		seconds = seconds + delay
	until seconds == 2000		
end

Configuring:

Code:
local delay = 100

This is the delay between your attacks. The minimum is '100'.

Code:
until seconds == 2000

The '2000' thing is the vocation attack speed, so, it will restart the script after 2 seconds. If you put a number that is smaller than your vocation's attack speed, it will attack and then delay, and then start attacking again.

I suggest putting round numbers, so the script can run smothly.

weapons.xml
Code:
<melee id="XXXX" script="nameOfTheScript.lua"/>

Thats it..

Cya
 
Last edited:
Back
Top