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

Spears in 7.6 Avesta, please help!

Erevius

It Was A Good Day
Joined
Feb 12, 2010
Messages
157
Reaction score
7
Location
Poland/Olsztyn
Here is a bug with spears in 7.6 Avesta. I mean that the spear stays in hands while attacking. In real Tibia 7.6 spears where removed from our hands and appeared on the ground, under our target (or nearby if missed). I wanted to make my own script in "server/data/weapons" but something went wrong. My script:
PHP:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SPEAR)

function onUseWeapon(cid, var, pos, topos, item)
	if(math.random(1,10) ~= 1) then
		doCombat(cid, combat, var)
		doPlayerRemoveItem(cid, 2389, 1)
		doCreateItem(2389, 1, topos)
	else
		doCombat(cid, combat, var)
		doPlayerRemoveItem(cid, 2389, 1)
	end
end

An error in my console:
fotoerror.png


When I'm attacking any monster with spear, every spear removes from my hand but don't appear under the monster.
Please help and sorry for my english :P
 
Code:
<item id="2389" article="a" name="spear" plural="spears">
        <attribute key="weight" value="2000"/>
        <attribute key="attack" value="25"/>
        <attribute key="weaponType" value="distance"/>
        <attribute key="shootType" value="spear"/>
        <attribute key="ammoAction" value="move"/>
        <attribute key="range" value="7"/>
</item>
You don't need any scripts. I have these attributes in items.xml and everything works okay.
 
It is not working. Unfortunately I am using edited version of Avesta (Avesta v4 by Shynzo). It seems like server doesn't read the ammotype. It doesnt matter if i put move, moveback, removecount etc. Any resolutions?

Sorry, It was an epic fail :D I set in config not to remove ammo :D - Didnt know it will work like it is.
 
Last edited:
Try this
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SPEAR)

function onUseWeapon(cid, var, pos, topos, item)
    if(math.random(1,10) ~= 1) then
        doCombat(cid, combat, var)
        doPlayerRemoveItem(cid, 2389, 1)
        doCreateItem(2389, 1, topos)
    else
        doCombat(cid, combat, var)
        doPlayerRemoveItem(cid, 2389, 1)
        doCreateItem(2389, 1, topos)
    end
end
 
Back
Top