Jaki Maoh
Member
- Joined
- Sep 13, 2017
- Messages
- 52
- Reaction score
- 12
Hello Community!
I was searching the forum for a way to implement a quiver system and found this post:
First of all, a little modification to @Infernum 's edit, allowing to add multiple items as different quivers:
then, modified the items.xml file to get the bow to be one handed:
and the quiver itself:
The attempt was to make the quiver dressable in the "shield slot" instead of the arrow/torch slot.
The problem, I believe, is that unless the source is edited in c++ to arrange the code in a way that it is possible to dress the quivers in the shield hand, it will simply not work.
Can anyone share some light in this matter?
Thanks in advance,
Jaki
I was searching the forum for a way to implement a quiver system and found this post:
After following the tutorial and experimenting some things here and there, I tried to make some alterations.Hello fellow otlanders heres a little edit i did for my custom ot and i felt like sharing it.
First of all what is a quiver? A quiver is a container where u can put your arrows/bolts and use them while equiped with a bow/crossbow like show in the picture below.
View attachment 30370
EDIT
FAQ
- First go to your source files and look for player.cpp
- Then look for
mine was at line 230 so your should be around that line also.Code:Item* Player::getWeapon(slots_t slot, bool ignoreAmmo) const
- In that function look for
and right below that just addCode:if (it.ammoType != AMMO_NONE) { Item* ammoItem = inventory[CONST_SLOT_AMMO];
Code:/*edit for quiver*/ if (!ammoItem) { return nullptr; } if (Container* container = ammoItem->getContainer()) { for (ContainerIterator iter = container->iterator(); iter.hasNext(); iter.advance()) { const ItemType& itr = Item::items[(*iter)->getID()]; if (itr.ammoType == it.ammoType) { item = (*iter); return item; } } } /*end of edit*/
- Thats it LoL.
- To add an item to add as a quiver remember to edit it with an itemEditor so it can work as a container and add the attribute to the item like this
and that should do.Code:<attribute key="containerSize" value="20" />
Q.- do you "bla bla bla" for tfs 0.4?
A.- No, i dont. Move on already guys.
First of all, a little modification to @Infernum 's edit, allowing to add multiple items as different quivers:
C++:
if (container->getID() == 38218 || 38180) // change quiver id here
Lua:
<item id="2456" article="a" name="bow">
<attribute key="weight" value="3100" />
<attribute key="weaponType" value="distance" />
<!-- <attribute key="slotType" value="two-handed" /> -->
<attribute key="ammoType" value="arrow" />
<attribute key="range" value="6" />
</item>
Lua:
<item id="38218" article="a" name="brown quiver">
<attribute key="weight" value="180" />
<attribute key="containerSize" value="8" />
<attribute key="description" value="It's a miracle it took so long." />
<!-- <attribute key="slotType" value="ammo" /> -->
<attribute key="weaponType" value="shield" />
<attribute key="speed" value="10" />
</item>
The problem, I believe, is that unless the source is edited in c++ to arrange the code in a way that it is possible to dress the quivers in the shield hand, it will simply not work.
Can anyone share some light in this matter?
Thanks in advance,
Jaki