This is the item I used:
<item id="28826" article="a" name="diamond arrow">
<attribute key="weight" value="80" />
<attribute key="slotType" value="ammo" />
<attribute key="attack" value="37" />
<attribute key="weaponType" value="ammunition" />
<attribute key="ammoType" value="arrow" />
<attribute key="shootType" value="diamondarrow" />
<attribute key="maxHitChance" value="95" />
<attribute key="decayTo" value="0" />
<attribute key="duration" value="3600" />
<attribute key="showduration" value="1" />
</item>
Item should still be decaying
Decaying is stopped.
Is it in movements.xml with equip/deequip ?
No, it doesn't meant to be. This item should decay from the start, when created/conjured.
I could not recreate this in my server. I was using an item:
<item id="2090" article="a" name="crystal key">
<attribute key="type" value="key"/>
<attribute key="weight" value="100"/>
<attribute key="decayTo" value="0"/>
<attribute key="duration" value="3600"/>
<attribute key="showduration" value="1"/>
<attribute key="slotType" value="ammo" />
</item>
Item was created by NPC, decayed and I was switching it to ammo slot and off few times, logged in or out... It is not in movements too. And it still kept decaying with exact timer. Maybe when using it with a bow as weapon disables decaying?
Maybe because its not actually an ammunition? Also I have it registered in weapons.xml, because its ammunition. It does not happen with normal items, like rings they are decaying.
Paste your weapons.xml entry please
https://github.com/otland/forgottenserver/blob/master/data/weapons/weapons.xml#L701
It's not different from any of these.
Paste yours entry... it鈥檚 important what action you have set there
Didnt I just say that its exactly the same like this one, link is pointing you to?
Its another ammunition, only the id is changed and level number.
Item id 28826 is on my 11.47 server... a tree. I want to point out one more thing. If your ammo does really remove a count, this can be the issue.
What do you mean "does really remove a count"?
Decaying it's working fine while using the item in arrow slot, its removing the count one by one and is still decaying, it stops only when I move it to another slot in backpack or anywhere.
confirmed
Anyone have any thoughts on this which would help to fix the issue? Because I'm going to fix this in my source and make pull request.
There should be a flag to indicate if the item decays on equip, like rings; or decays normally, like corpses.
Was that fixed already @nekiro ? If not, can you share your progress and let me pick it up?
@pzaj2 nah, it's not fixed. I didn't manage to start working on it, so there is no progress.
@nekiro ok, so to my understanding your arrows work perfectly fine until they're removed from ammo slot? Are they stackable?
I'm just wondering if that's actually a bug... well, it is, but is that something we should consider possible? What happens if you have 10 arrows with duration X left and 10 arrows with duration Y and you want to stack them together?
@pzaj2 thats a bug. It doesnt matter if you move them out of the stack or not, you cant stack arrows that are not equal, even if these have same attribute and different duration, you cant stack them.
They stop decaying when you move them anywhere from the slot you created them in.
Alright. I will look into it.
no news?
probably bugged for the same reason as #1753
any idea which commit caused this bug?
@nekiro
does the item decay if you just create it (goes directly into bag/backpack) instead of ammo slot?
From what I can see if you use ammunition it uses the transformto function from game.cpp as the item is obviously in the ammo slot it then fires up onPlayerEquip which then makes the regular checks for level decay and such, the thing now is, once you deequip it, it removes the decay condition as it was deequiped.
This should however not happen if the item is never in the ammo slot in first place.
We would have to introduce a different decay method for this to fully work.
Same thing if it goes to backpack
found the problem it was something with Item* Item::clone() const resetting the attributes but not initializing the decay again.
Will open a pr soon