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

Feature Quiver [TFS 1.X + 0.X]

Sadly not working for TFS 1.3 I think.. I've redone your TFS 1.x tutorial a couple of times now and my bow still don't wants to shoot.
These were my steps, after doing your tutorial:
1. Created Quiver in Object Builder copied hunter's quiver and set all (included trade as) like an expedition bag.
Bild_2021-08-09_142703.pngBild_2021-08-09_142616.pngBild_2021-08-09_142637.png
2. In ItemEditor i've copied the hunter's quiver too and changed all like an expedition bag (incl. ware ID).
Bild_2021-08-09_142231.png
3. In Items.xml I've create thise one:
Lua:
    <item id="26385" article="a" name="Quiver">
        <attribute key="weight" value="17" />
        <attribute key="containerSize" value="6" />
        <attribute key="slotType" value="ammo" />
    </item>
 
Last edited:
Redone it again with an fresh TFS 1.3 and 1098 spr/dat/items.xml/items.otbm.
Still not working.
-bumb-
 
How do I set only ammo inside the quiver?
 
Hello. Inspired @xydius solution I've created possibility to make use for quivers for both TFS (1.X based on otland/forgottenserver (https://github.com/otland/forgottenserver) and 0.X on Fir3element/3777 (https://github.com/Fir3element/3777)).

I won't post what to change in what line, instead here you have GitHub branches:
My solution will require creating an item which have name set to Quiver:
- TFS 1.X
Lua:
local item = Game.createItem(11241, 1) -- example ID, in my case Expedition Backpack
item:setAttribute(ITEM_ATTRIBUTE_NAME, 'Quiver')
item:setAttribute(ITEM_ATTRIBUTE_ARTICLE, 'a') -- in my case Expedition Backpack have prefix "an", so I'm changing it here
player:addItemEx(item)
- TFS 0.X
Lua:
local item = doCreateItemEx(11241, 1)
doItemSetAttribute(item, 'name', 'Quiver')
doItemSetAttribute(item, 'article', 'a')
doPlayerAddItemEx(cid, item)

Created Quiver will:
  • not allow to put inside otems other than ammo (container.cpp part)
  • have max items amount set to 4 both in "look at" and "put into" (container.h, item.cpp and protocolgame.cpp part); if you don't want to set max amout, just skip that changes
  • get first matching ammo item from Quiver in arrow slot
  • allow in newer versions to put Quiver in arrow slot without enabling CLASSIC_EQUIPMENT_SLOTS option

Hope you enjoy :)
Works great man, thank you!!
 
Awesome system, thanks for the release! Using it in the upcoming patch to Blazera ;D

Tested & Working for TFS 1.5 Downgrade <3
 
How to make them not place other items in the quiver compare?
You mean don't be allowed to move items that not are ammunition inside the quiver?
Or you mean, if you have 2 quivers how to recognize them both as quiver?

Please attach more information, can't understand specifically what is needed :p
 
You mean don't be allowed to move items that not are ammunition inside the quiver?
Or you mean, if you have 2 quivers how to recognize them both as quiver?

Please attach more information, can't understand specifically what is needed :p


backpacks with ammunition can be placed in the quiver
 
backpacks with ammunition can be placed in the quiver
Just tested, you're right. Also I can place a backpack on the arrow slot (not a quiver) and use it as quiver, it will still consume arrows inside (even if it doesn't has a quiver inside). Any thoughts of how it can be fixed? @kor
 
I've just switched all "Quiver" to "quiver" and now it doesn't allow me to place items inside the quiver (only arrows). That's fixed. But I actually can place arrows in a normal backpack, and that works as quiver aswell. Exactly like @leik meris said, someone can fix that? :) Thanks in advance!!

PS. When I changed "Quiver" to "quiver" It also decreased the slots of my quiver to 4, and items.xml has it with 60 slots. Why is that?
I have no idea where to place this aswell.
Lua:
local item = Game.createItem(11241, 1) -- example ID, in my case Expedition Backpack
item:setAttribute(ITEM_ATTRIBUTE_NAME, 'Quiver')
item:setAttribute(ITEM_ATTRIBUTE_ARTICLE, 'a') -- in my case Expedition Backpack have prefix "an", so I'm changing it here
player:addItemEx(item)
 
Last edited:

Unfortunately, I don't have time to fix things you all mentioned :(
I believe the error with backpacks being able to be used in arrow slot as a quiver is because of this line in player.cpp:
if (Container* container = ammoItem->getContainer()) {

Seems like possibly adding if getcontainer name has "quiver" -- otherwise it must be backpack/bag other type of 'container'
 
I believe the error with backpacks being able to be used in arrow slot as a quiver is because of this line in player.cpp:
if (Container* container = ammoItem->getContainer()) {

Seems like possibly adding if getcontainer name has "quiver" -- otherwise it must be backpack/bag other type of 'container'

Sorry for haven't tested it yet, but should be this on line 226?
C++:
if (Container* container = ammoItem->getContainer() & item->getName() == "quiver") {
 
Sorry for haven't tested it yet, but should be this on line 226?
C++:
if (Container* container = ammoItem->getContainer() & item->getName() == "quiver") {
I think would probably be like this, but also not tested.
Code:
if (Container* container = ammoItem->getContainer() & container->getName() == "quiver") {
 
Code:
if (Container* container = ammoItem->getContainer() & container->getName() == "quiver") {
1663840635435.png
Happened this, but changed it a little bit to
C++:
if (Container* container = ammoItem->getContainer(); item->getName() == "quiver") {
And it was able to compile, but, didn't work either now the quivers doesn't work.

Any other ideas? :)
Regards!

PS.
ralke said:
When I changed "Quiver" to "quiver" It also decreased the slots of my quiver to 4, and items.xml has it with 60 slots. Why is that?
I have no idea where to place this aswell.
This is fixed already, just switched number 4 to the desired number of slots
 
Last edited:
View attachment 70752
Happened this, but changed it a little bit to
C++:
if (Container* container = ammoItem->getContainer(); item->getName() == "quiver") {
And it was able to compile, but, didn't work either now the quivers doesn't work.

Any other ideas? :)
Regards!

PS.

This is fixed already, just switched number 4 to the desired number of slots
Doesn't it require to be like this? if (Container* container = ammoItem->getContainer() && container->getName() == "quiver") {

I may be wrong; but also just do this instead maybe.
if (Container* container = ammoItem->getContainer(); {
if container->getName() == "quiver"; {

Something like that possibly, just adding new if statement to add extra check. Im not great with C++; usually outsource for that stuff xD
 
Last edited:
Doesn't it require to be like this? if (Container* container = ammoItem->getContainer() && container->getName() == "quiver") {

I may be wrong; but also just do this instead maybe.
if (Container* container = ammoItem->getContainer(); {
if container->getName() == "quiver"; {

Something like that possibly, just adding new if statement to add extra check. Im not great with C++; usually outsource for that stuff xD
hello!

any solution for the problem about other containers like backpacks can be used as a quiver?

i've implemented on my server the feature, everything works fine but i has this issue about the containers, probably something must be changed on source codes.. but it runs away of my knowledgement
 
The changes for 0.X are missing, can someone repost please?
 
Back
Top