Does anyone know the attribute for attackSpeed for 9.31 servers? Or does it have to be a lua script now? If it has to be a lua script does anyone have one?
You could make an item, to use on the weapon (e.g. star wand). After using the wand on the item, it will change the attack speed.
<action itemid="[COLOR="#FF0000"]WAND_ID[/COLOR]" event="script" value="[COLOR="#FF0000"]script.lua[/COLOR]"/>
local t = {
[WEAPON_ID] = {1500} -- 2000 = default, tibia speed
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local k = t[itemEx.itemid]
if k then
doItemSetAttribute(itemEx.uid, 'attackspeed', k[1])
doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
doRemoveItem(item.uid, 1)
else
doPlayerSendCancel(cid, "You cannot use this object.")
end
return true
end
actions.xml
Code:<action itemid="[COLOR="#FF0000"]WAND_ID[/COLOR]" event="script" value="[COLOR="#FF0000"]script.lua[/COLOR]"/>
script.lua
LUA:local t = { [WEAPON_ID] = 500 -- speed // 2000 - 500 = 1500 // faster } function onUse(cid, item, fromPosition, itemEx, toPosition) local k = t[itemEx.itemid] if k then doItemSetAttribute(itemEx.uid, 'attackspeed', (getItemAttackSpeed(itemEx.uid) - k)) doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE) doRemoveItem(item.uid, 1) else return doPlayerSendCancel(cid, "You cannot use this object.") end return true end
Where exactly do i put this code?
I tried the script. Although it wasn't declined it had no change on the weapons attack speed. "table index is nil" "cannot load script"Where exactly do i put this code?