• 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!
  • If you're using Gesior 2012 or MyAAC, please review this thread for information about a serious security vulnerability and a fix.

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

Alkenyx

Member
Joined
Jun 6, 2014
Messages
97
Solutions
1
Reaction score
15
Location
Germany
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:

Alkenyx

Member
Joined
Jun 6, 2014
Messages
97
Solutions
1
Reaction score
15
Location
Germany
Redone it again with an fresh TFS 1.3 and 1098 spr/dat/items.xml/items.otbm.
Still not working.
-bumb-
 

Narg

Member
Joined
Jul 11, 2012
Messages
28
Reaction score
9
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!!
 

Extrodus

|| Blazera.net ||
Premium User
Joined
Dec 22, 2008
Messages
2,563
Solutions
6
Reaction score
406
Location
Canada
Awesome system, thanks for the release! Using it in the upcoming patch to Blazera ;D

Tested & Working for TFS 1.5 Downgrade <3
 

ralke

(҂ ͠❛ ෴ ͡❛)ᕤ
Joined
Dec 17, 2011
Messages
1,154
Solutions
27
Reaction score
624
Location
Santiago - Chile
GitHub
ralke23
Twitch
ralke23
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
 

leik meris

Member
Joined
Feb 17, 2010
Messages
37
Solutions
1
Reaction score
17
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
 

ralke

(҂ ͠❛ ෴ ͡❛)ᕤ
Joined
Dec 17, 2011
Messages
1,154
Solutions
27
Reaction score
624
Location
Santiago - Chile
GitHub
ralke23
Twitch
ralke23
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
 

ralke

(҂ ͠❛ ෴ ͡❛)ᕤ
Joined
Dec 17, 2011
Messages
1,154
Solutions
27
Reaction score
624
Location
Santiago - Chile
GitHub
ralke23
Twitch
ralke23
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:

Extrodus

|| Blazera.net ||
Premium User
Joined
Dec 22, 2008
Messages
2,563
Solutions
6
Reaction score
406
Location
Canada

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'
 

ralke

(҂ ͠❛ ෴ ͡❛)ᕤ
Joined
Dec 17, 2011
Messages
1,154
Solutions
27
Reaction score
624
Location
Santiago - Chile
GitHub
ralke23
Twitch
ralke23
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") {
 

Extrodus

|| Blazera.net ||
Premium User
Joined
Dec 22, 2008
Messages
2,563
Solutions
6
Reaction score
406
Location
Canada
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") {
 

ralke

(҂ ͠❛ ෴ ͡❛)ᕤ
Joined
Dec 17, 2011
Messages
1,154
Solutions
27
Reaction score
624
Location
Santiago - Chile
GitHub
ralke23
Twitch
ralke23
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:

Extrodus

|| Blazera.net ||
Premium User
Joined
Dec 22, 2008
Messages
2,563
Solutions
6
Reaction score
406
Location
Canada
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:
Top